#!/usr/bin/perl -w

use strict;

my %net = ();
while (<>) {
  if (m/^..\//) {
    s/^..\///;
  }

  my ($key, @arr) = split;
  if (! defined($net{$key})) {
    $net{$key} = [];
  }

  push @{$net{$key}}, @arr;
}

for my $key (sort(keys(%net))) {
  print "$key\t", join(' ', @{$net{$key}}), "\n";
}
