Scanf.scanf "%2d%2d" @@ fun n1 n2 ->
  let yymm = 1 <= n2 && n2 <= 12 in
  print_endline @@
    if 1 <= n1 && n1 <= 12 then
      if yymm then "AMBIGUOUS"
      else "MMYY"
    else if yymm then "YYMM"
    else "NA"