#!/usr/bin/perl -w
use strict;
use warnings;

while (1) {
  my $b = <STDIN>;
  chomp($b);
  if ($b eq "exit") {
    exit;
  }
  if ($b eq "crash") {
    die("all your base are belong to us");
  }
 
  if (substr($b, 0, 7) eq "STDERR:") {
    print STDERR "$b\n";
  } else {
    print STDOUT "STDOUT:$b\n";
  }
}
