use warnings;
use strict;

open(FIA, "<".$ARGV[0]);
open(FIB, "<".$ARGV[1]);



my %COUNTS;

while (<FIA>)
{
   chomp;
   my ($gene, $count)= split (/\t/, $_);
   $COUNTS{$gene}{"A"} = $count;
}
while (<FIB>)
{
   chomp;
   my ($gene, $count)= split (/\t/, $_);
   $COUNTS{$gene}{"B"} = $count;
}


foreach my $gene (keys %COUNTS)
{
   if (!$COUNTS{$gene}{"A"})
   {
      $COUNTS{$gene}{"A"} = 0;
   }
   if (!$COUNTS{$gene}{"B"})
   {
      $COUNTS{$gene}{"B"} = 0;
   }

   print $gene."\t".$COUNTS{$gene}{"A"}."\t".$COUNTS{$gene}{"B"}."\n";
}
