let () = Scanf.scanf "%2d%2d" @@ fun left right ->
  let yymm = 1 <= right && right <= 12 in
  let mmyy = 1 <= left && left <= 12 in
  print_endline @@
  match (yymm, mmyy) with
  | (true, true) -> "AMBIGUOUS"
  | (true, false) -> "YYMM"
  | (false, true) -> "MMYY"
  | (false, false) -> "NA"