#! /Users/distiller/project/miniconda/conda-bld/gmap_1552130331409/_build_env/bin/perl

use warnings;
use IO::File;

@FPS = ();
foreach $filename (@ARGV) {
    push @FPS, new IO::File($filename) or die "Can't open $filename";
}
$nfiles = $#FPS + 1;
print STDERR "Reading from $nfiles files\n";

while (1) {
    for ($i = 0; $i <= $#FPS; $i++) {
	get_entry($FPS[$i]);
    }
}

exit;



sub get_entry {
    my ($FP) = @_;

    if (!defined($line = <$FP>)) {
	exit;
    } else {
	print $line;
    }

    while (defined($line = <$FP>) && $line =~ /\S/) {
	print $line;
    }
    print "\n";

    return;
}

