Scanf.scanf "%s %s" (fun a s -> let mapfunc c = if c >= '0' && c <= '9' then a.[int_of_char c - 48] else c in print_endline @@ String.map mapfunc s )