module c;time a,b;initial while($fscanf(1<<31,"%h%h",a,b))$write(b/16%17?a&15:b>>8);endmodule