#!/usr/bin/perl

use strict;
use warnings;
use feature qw/say/;

say "digraph taikyokushogi {";

while(<>) {
    chomp;
    
    my @F = split/\t/, lc;
    $F[0] =~ s/^\*//;
    
    $F[$_] = join " ", map { ucfirst } split " ", $F[$_] for(0,3);
  
    say qq/    "$F[0]"/, ($F[3] ne "—") ? qq/ -> "$F[3]"/ : "";
}

say "}";
