#!/bin/env perl

$\="\n";
$,=" ";
use strict;
use Data::Dumper;

while(<>) {
    chomp;
    my $line1 = $_;
    my $line2 = <>;
    chomp $line2;
    my @tok1 = split(" ",$line1);
    my @tok2 = split(" ",$line2);
    if($tok1[1] =~ /hs(8|15|4)/) {
      print @tok2;
      print @tok1;
    } else {
      print @tok1;
      print @tok2;
    }
}
