import java.util.Scanner;
import java.util.InputMismatchException;

class Main {
   public static void main(String args[]) {
      int x=0 ,y=0;
      int sum = 0;
      try {
         Scanner scanner = new Scanner(System.in);
         x = scanner.nextInt();
         scanner.close();
      } catch (InputMismatchException e) {
         System.out.println("error");
      }
      y = x/100;
      int z = x - y*100;
      if ((y<1 || y>12) && (z<1 || z>12)) {
         System.out.println("NA");
      } else if (y>0 && y<13 && z>0 && z<13) {
         System.out.println("AMBIGUOUS");
      } else if (y>0 && y<13) {
         System.out.println("MMYY");
      } else if (z>0 && z<13) {
         System.out.println("YYMM");
      }
   }
} import java.util.Scanner; Scanner java.util import java.util.InputMismatchException; InputMismatchException java.util class Main {
   public static void main(String args[]) {
      int x=0 ,y=0;
      int sum = 0;
      try {
         Scanner scanner = new Scanner(System.in);
         x = scanner.nextInt();
         scanner.close();
      } catch (InputMismatchException e) {
         System.out.println("error");
      }
      y = x/100;
      int z = x - y*100;
      if ((y<1 || y>12) && (z<1 || z>12)) {
         System.out.println("NA");
      } else if (y>0 && y<13 && z>0 && z<13) {
         System.out.println("AMBIGUOUS");
      } else if (y>0 && y<13) {
         System.out.println("MMYY");
      } else if (z>0 && z<13) {
         System.out.println("YYMM");
      }
   }
} Main public static void main(String args[]) {
      int x=0 ,y=0;
      int sum = 0;
      try {
         Scanner scanner = new Scanner(System.in);
         x = scanner.nextInt();
         scanner.close();
      } catch (InputMismatchException e) {
         System.out.println("error");
      }
      y = x/100;
      int z = x - y*100;
      if ((y<1 || y>12) && (z<1 || z>12)) {
         System.out.println("NA");
      } else if (y>0 && y<13 && z>0 && z<13) {
         System.out.println("AMBIGUOUS");
      } else if (y>0 && y<13) {
         System.out.println("MMYY");
      } else if (z>0 && z<13) {
         System.out.println("YYMM");
      }
   } main {
      int x=0 ,y=0;
      int sum = 0;
      try {
         Scanner scanner = new Scanner(System.in);
         x = scanner.nextInt();
         scanner.close();
      } catch (InputMismatchException e) {
         System.out.println("error");
      }
      y = x/100;
      int z = x - y*100;
      if ((y<1 || y>12) && (z<1 || z>12)) {
         System.out.println("NA");
      } else if (y>0 && y<13 && z>0 && z<13) {
         System.out.println("AMBIGUOUS");
      } else if (y>0 && y<13) {
         System.out.println("MMYY");
      } else if (z>0 && z<13) {
         System.out.println("YYMM");
      }
   } int x=0 x 0 y=0; y 0 int sum = 0; sum 0 try {
         Scanner scanner = new Scanner(System.in);
         x = scanner.nextInt();
         scanner.close();
      } catch (InputMismatchException e) {
         System.out.println("error");
      } catch (InputMismatchException e) {
         System.out.println("error");
      } InputMismatchException e {
         System.out.println("error");
      } System.out.println("error") System.out.println System.out System System.out "error" {
         Scanner scanner = new Scanner(System.in);
         x = scanner.nextInt();
         scanner.close();
      } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) x = scanner.nextInt() x scanner.nextInt() scanner.nextInt scanner scanner.close() scanner.close scanner y = x/100 y x/100 x 100 int z = x - y*100; z x - y*100 x y*100 y 100 if ((y<1 || y>12) && (z<1 || z>12)) {
         System.out.println("NA");
      } else if (y>0 && y<13 && z>0 && z<13) {
         System.out.println("AMBIGUOUS");
      } else if (y>0 && y<13) {
         System.out.println("MMYY");
      } else if (z>0 && z<13) {
         System.out.println("YYMM");
      } (y<1 || y>12) && (z<1 || z>12) (y<1 || y>12) y<1 y 1 y>12 y 12 (z<1 || z>12) z<1 z 1 z>12 z 12 {
         System.out.println("NA");
      } System.out.println("NA") System.out.println System.out System System.out "NA" if (y>0 && y<13 && z>0 && z<13) {
         System.out.println("AMBIGUOUS");
      } else if (y>0 && y<13) {
         System.out.println("MMYY");
      } else if (z>0 && z<13) {
         System.out.println("YYMM");
      } y>0 && y<13 && z>0 && z<13 z>0 y>0 && y<13 && z>0 && z<13 y>0 y 0 y<13 y 13 z>0 z 0 z<13 z 13 {
         System.out.println("AMBIGUOUS");
      } System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" if (y>0 && y<13) {
         System.out.println("MMYY");
      } else if (z>0 && z<13) {
         System.out.println("YYMM");
      } y>0 && y<13 y>0 y 0 y<13 y 13 {
         System.out.println("MMYY");
      } System.out.println("MMYY") System.out.println System.out System System.out "MMYY" if (z>0 && z<13) {
         System.out.println("YYMM");
      } z>0 && z<13 z>0 z 0 z<13 z 13 {
         System.out.println("YYMM");
      } System.out.println("YYMM") System.out.println System.out System System.out "YYMM" String args[] args
import java.util.Scanner;
import java.util.InputMismatchException;

class Main {
   public static void main(String args[]) {
      int x=0 ,y=0;
      int sum = 0;
      try {
         Scanner scanner = new Scanner(System.in);
         x = scanner.nextInt();
         scanner.close();
      } catch (InputMismatchException e) {
         System.out.println("error");
      }
      y = x/100;
      int z = x - y*100;
      if ((y<1 || y>12) && (z<1 || z>12)) {
         System.out.println("NA");
      } else if (y>0 && y<13 && z>0 && z<13) {
         System.out.println("AMBIGUOUS");
      } else if (y>0 && y<13) {
         System.out.println("MMYY");
      } else if (z>0 && z<13) {
         System.out.println("YYMM");
      }
   }
}
