#!/usr/bin/perl

my @lines=<STDIN>;
my $lines=$#lines;
my $interval=$ARGV[0];
my ($start,$stop,$total);
if ($interval =~ m@(.*)/(.*)@) {
    $start = $1;
    $total = $2;
}
else {
    $start=$interval;
    $total=0;
}
if ($start =~ m@(.*)-(.*)@) {
    $start = $1;
    $stop = $2;
}
if ($start =~ m@(.*)\+(.*)@) {
    $start = $1;
    #if ($2 =~ /%$/) {
    #}
    #else {
    $stop = $start+$2;
    #}
}
#print "start = $start\n";
#print "stop = $stop\n";
#print "total = $total\n";

$start=int($lines/$total*$start);
$stop=int($lines/$total*$stop);

#print "start = $start\n";
#print "stop = $stop\n";
#print "total = $total\n";
for($i=$start;$i<$stop;$i++){
    print $lines[$i];
}
