let a, b = Scanf.scanf " %2d%2d" @@ fun a b -> a, b
let f x = x = 0 || x > 12
let _ = print_endline @@ match f a, f b with true, true -> "NA" | true, false -> "YYMM" | false, true -> "MMYY" | _ -> "AMBIGUOUS"