# $B<B9TJ}K!!'JQ99$7$?$$HO0O$r!V(B# tanitani START$B!W$H!V(B# tanitani END$B!W$G$/$/$k!#(B
# <$BNc(B>
# # node infos
# x y shape bclr(r,g,b) bwidth r1 r2 clr(r,g,b) ltype lclr(r,g,b) lpos lstr
# # tanitani START
# 431.0858 200.6057 3 0 0 0 0.544484 20.57895 5.81579 173 255 47 1 -1 -1 -1 4 aichi
# .............
# 243.55 325.813 3 0 0 0 0.544484 20.57895 5.81579 173 255 47 1 -1 -1 -1 4 yamanashi
# # tanitani END
# 339.9444 212.8759 0 0 0 0 0.544484 0.8947368 0.8947368 0 238 0 4 -1 -1 -1 4

%A = ("aichi" => "127 0 255","akita" => "255 0 127","aomori" => "255 0 127","chiba1" => "238 130 238","chiba2" => "238 130 238","ehime" => "0 255 255","fukuoka" => "0 128 0","fukushima" => "255 0 127","gifu" => "127 0 255","gunma" => "238 130 238","hiroshima" => "0 255 127","hokkaido1" => "255 0 0","hokkaido2" => "255 0 0","hyogo1"=>"0 127 255","hyogo2"=>"0 127 255","ibaraki"=>"238 130 238","ishikawa"=>"0 0 255","iwate1"=>"255 0 127","iwate2"=>"255 0 127","kagawa1"=>"0 255 255","kagawa2" => "0 255 255","kagoshima" => "255 255 0","kanagawa" => "238 130 238","kouchi1" => "0 255 255","kouchi2" => "0 255 255","kumamoto1" => "127 255 0","kumamoto2" => "127 255 0","kyoto" => "0 127 255","mie" => "0 127 255","miyagi" => "255 0 127","miyazaki" => "0 128 0","nagano1" => "127 0 255","nagano2" => "127 0 255","nagasaki1" => "127 255 0","nagasaki2" => "127 255 0","naha" => "255 127 0","nakijin" => "255 127 0","nara" => "0 127 255","nhk" => "238 130 238","nigata1" => "127 0 255","nigata2" => "0 0 255","oita" => "0 128 0","okayama" => "0 255 127","osaka" => "0 127 255","saga" => "127 255 0","shimane" => "0 255 127","shizuoka1" => "127 0 255","shizuoka2" => "127 0 255","tochigi" => "238 130 238","tokushima" => "0 255 255","tokyo" => "238 130 238","toyama" => "0 0 255","wakayama" => "0 127 255","yamagata" => "255 0 127","yamaguchi" => "0 255 127","yamanashi" => "127 0 255");

$flag = 0;
while(<STDIN>){
    if($flag == 1){
	if($_ =~"# tanitani END"){
	    $flag = 0;
	}else{
	    @tmp = split(/\s/,);
	    chomp(@tmp);
	    print $tmp[0] . " " . $tmp[1] . " " . $tmp[2] . " " . $tmp[3] . " " . $tmp[4] . " " . $tmp[5] . " " . $tmp[6] . " " . $tmp[7] . " " . $tmp[8] . " "  . $A{$tmp[17]} . " " .$tmp[12] . " " . $tmp[13] . " " . $tmp[14] . " " . $tmp[15] . " " . $tmp[16] . " " . $tmp[17] . "\n";
	}
    }else{
	if($_ =~ "# tanitani START"){
	    $flag = 1;
	}else{
	    print $_;
	}
    }
}
