import java.util.*;

class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int n1 = n / 100;
    int n2 = n % 100;
    if (1 <= n1 && n1 <= 12 && (n2 == 0 || 13 <= n2))
      System.out.println("MMYY");
    else if (1 <= n2 && n2 <= 12 && (n1 == 0 || 13 <= n1))
      System.out.println("YYMM");
    else if ((n1 == 0 || 13 <= n1) && (n2 == 0 || 13 <= n2))
      System.out.println("NA");
    else
      System.out.println("AMBIGUOUS");
  }
} import java.util.*; util.* java class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int n1 = n / 100;
    int n2 = n % 100;
    if (1 <= n1 && n1 <= 12 && (n2 == 0 || 13 <= n2))
      System.out.println("MMYY");
    else if (1 <= n2 && n2 <= 12 && (n1 == 0 || 13 <= n1))
      System.out.println("YYMM");
    else if ((n1 == 0 || 13 <= n1) && (n2 == 0 || 13 <= n2))
      System.out.println("NA");
    else
      System.out.println("AMBIGUOUS");
  }
} Main public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int n1 = n / 100;
    int n2 = n % 100;
    if (1 <= n1 && n1 <= 12 && (n2 == 0 || 13 <= n2))
      System.out.println("MMYY");
    else if (1 <= n2 && n2 <= 12 && (n1 == 0 || 13 <= n1))
      System.out.println("YYMM");
    else if ((n1 == 0 || 13 <= n1) && (n2 == 0 || 13 <= n2))
      System.out.println("NA");
    else
      System.out.println("AMBIGUOUS");
  } main {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int n1 = n / 100;
    int n2 = n % 100;
    if (1 <= n1 && n1 <= 12 && (n2 == 0 || 13 <= n2))
      System.out.println("MMYY");
    else if (1 <= n2 && n2 <= 12 && (n1 == 0 || 13 <= n1))
      System.out.println("YYMM");
    else if ((n1 == 0 || 13 <= n1) && (n2 == 0 || 13 <= n2))
      System.out.println("NA");
    else
      System.out.println("AMBIGUOUS");
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int n1 = n / 100; n1 n / 100 n 100 int n2 = n % 100; n2 n % 100 n 100 if (1 <= n1 && n1 <= 12 && (n2 == 0 || 13 <= n2))
      System.out.println("MMYY");
    else if (1 <= n2 && n2 <= 12 && (n1 == 0 || 13 <= n1))
      System.out.println("YYMM");
    else if ((n1 == 0 || 13 <= n1) && (n2 == 0 || 13 <= n2))
      System.out.println("NA");
    else
      System.out.println("AMBIGUOUS"); 1 <= n1 && n1 <= 12 && (n2 == 0 || 13 <= n2) 1 <= n1 && n1 <= 12 && (n2 == 0 || 13 <= n2) 1 <= n1 1 n1 n1 <= 12 n1 12 (n2 == 0 || 13 <= n2) n2 == 0 n2 0 13 <= n2 13 n2 System.out.println("MMYY") System.out.println System.out System System.out "MMYY" if (1 <= n2 && n2 <= 12 && (n1 == 0 || 13 <= n1))
      System.out.println("YYMM");
    else if ((n1 == 0 || 13 <= n1) && (n2 == 0 || 13 <= n2))
      System.out.println("NA");
    else
      System.out.println("AMBIGUOUS"); 1 <= n2 && n2 <= 12 && (n1 == 0 || 13 <= n1) 1 <= n2 && n2 <= 12 && (n1 == 0 || 13 <= n1) 1 <= n2 1 n2 n2 <= 12 n2 12 (n1 == 0 || 13 <= n1) n1 == 0 n1 0 13 <= n1 13 n1 System.out.println("YYMM") System.out.println System.out System System.out "YYMM" if ((n1 == 0 || 13 <= n1) && (n2 == 0 || 13 <= n2))
      System.out.println("NA");
    else
      System.out.println("AMBIGUOUS"); (n1 == 0 || 13 <= n1) && (n2 == 0 || 13 <= n2) (n1 == 0 || 13 <= n1) n1 == 0 n1 0 13 <= n1 13 n1 (n2 == 0 || 13 <= n2) n2 == 0 n2 0 13 <= n2 13 n2 System.out.println("NA") System.out.println System.out System System.out "NA" System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" String args[] args
import java.util.*;

class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int n1 = n / 100;
    int n2 = n % 100;
    if (1 <= n1 && n1 <= 12 && (n2 == 0 || 13 <= n2))
      System.out.println("MMYY");
    else if (1 <= n2 && n2 <= 12 && (n1 == 0 || 13 <= n1))
      System.out.println("YYMM");
    else if ((n1 == 0 || 13 <= n1) && (n2 == 0 || 13 <= n2))
      System.out.println("NA");
    else
      System.out.println("AMBIGUOUS");
  }
}
