#!/usr/bin/perl
%data = ();
while (<STDIN>)
{
  chomp;
  ($k, $p, $hops, $deliv, $expect, $rate) = split('\t', substr($_, 8));
  $data{"$k-$p"}{$hops} = $rate;
}
print "Hops";
foreach $key (sort(keys %data))
{
  print "\t", $key;
}
print "\n";
for ($i=0; $i<29; $i++)
{
  print $i;
  foreach $subkey (sort(keys %data))
  {
    print "\t", $data{$subkey}{$i};
  }
  print "\n";
}

