let rec f?(c=input_char stdin)x=print_char(if x<1 then 'x'else c);f(match c with 'T'->1|'K'->x-50|_->(x+1)mod 51);;f 1