#!/usr/bin/perl

open IN,"gier.debug" or die;

while($l = <IN>)
{
  chomp($l);
  if($l =~ /^(..) command (\d+) \((\d+)\) to tape unit (\d+), block length (\d+), buffer address: (\d+)$/)
  {
    $command = $1;
    $addr1 = $2;
    $addr2 = $3;
    $unit = $4;
    $length = $5;
    $address = $6;
#   print "$command $addr1 $addr2 $unit $length $address\n";
    if($command eq "US" && ($addr2==0 || $addr2==128 || $addr2==32 || $addr2==160))
    {
      print " "x($unit-1)."W\n";
    }
    elsif($command eq "IL" && ($addr2==0||$addr2==128))
    {
      print " "x($unit-1)."R\n";
    }
  }
}
