import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_input = Integer.parseInt(sc.next());
    int number_upper = number_input / 100;
    int number_lower = number_input % 100;
    if((1 <= number_upper && number_upper <= 12) && (1 <= number_lower && number_lower <= 12)) {
      System.out.println("AMBIGUOUS");
    } else if(1 <= number_upper && number_upper <= 12) {
      System.out.println("MMYY");
    } else if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    }
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_input = Integer.parseInt(sc.next());
    int number_upper = number_input / 100;
    int number_lower = number_input % 100;
    if((1 <= number_upper && number_upper <= 12) && (1 <= number_lower && number_lower <= 12)) {
      System.out.println("AMBIGUOUS");
    } else if(1 <= number_upper && number_upper <= 12) {
      System.out.println("MMYY");
    } else if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_input = Integer.parseInt(sc.next());
    int number_upper = number_input / 100;
    int number_lower = number_input % 100;
    if((1 <= number_upper && number_upper <= 12) && (1 <= number_lower && number_lower <= 12)) {
      System.out.println("AMBIGUOUS");
    } else if(1 <= number_upper && number_upper <= 12) {
      System.out.println("MMYY");
    } else if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int number_input = Integer.parseInt(sc.next());
    int number_upper = number_input / 100;
    int number_lower = number_input % 100;
    if((1 <= number_upper && number_upper <= 12) && (1 <= number_lower && number_lower <= 12)) {
      System.out.println("AMBIGUOUS");
    } else if(1 <= number_upper && number_upper <= 12) {
      System.out.println("MMYY");
    } else if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int number_input = Integer.parseInt(sc.next()); number_input Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int number_upper = number_input / 100; number_upper number_input / 100 number_input 100 int number_lower = number_input % 100; number_lower number_input % 100 number_input 100 if((1 <= number_upper && number_upper <= 12) && (1 <= number_lower && number_lower <= 12)) {
      System.out.println("AMBIGUOUS");
    } else if(1 <= number_upper && number_upper <= 12) {
      System.out.println("MMYY");
    } else if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    } (1 <= number_upper && number_upper <= 12) && (1 <= number_lower && number_lower <= 12) (1 <= number_upper && number_upper <= 12) 1 <= number_upper 1 number_upper number_upper <= 12 number_upper 12 (1 <= number_lower && number_lower <= 12) 1 <= number_lower 1 number_lower number_lower <= 12 number_lower 12 {
      System.out.println("AMBIGUOUS");
    } System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" if(1 <= number_upper && number_upper <= 12) {
      System.out.println("MMYY");
    } else if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    } 1 <= number_upper && number_upper <= 12 1 <= number_upper 1 number_upper number_upper <= 12 number_upper 12 {
      System.out.println("MMYY");
    } System.out.println("MMYY") System.out.println System.out System System.out "MMYY" if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    } 1 <= number_lower && number_lower <= 12 1 <= number_lower 1 number_lower number_lower <= 12 number_lower 12 {
      System.out.println("YYMM");
    } System.out.println("YYMM") System.out.println System.out System System.out "YYMM" {
      System.out.println("NA");
    } System.out.println("NA") System.out.println System.out System System.out "NA" String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_input = Integer.parseInt(sc.next());
    int number_upper = number_input / 100;
    int number_lower = number_input % 100;
    if((1 <= number_upper && number_upper <= 12) && (1 <= number_lower && number_lower <= 12)) {
      System.out.println("AMBIGUOUS");
    } else if(1 <= number_upper && number_upper <= 12) {
      System.out.println("MMYY");
    } else if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_input = Integer.parseInt(sc.next());
    int number_upper = number_input / 100;
    int number_lower = number_input % 100;
    if((1 <= number_upper && number_upper <= 12) && (1 <= number_lower && number_lower <= 12)) {
      System.out.println("AMBIGUOUS");
    } else if(1 <= number_upper && number_upper <= 12) {
      System.out.println("MMYY");
    } else if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    }
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int number_input = Integer.parseInt(sc.next());
    int number_upper = number_input / 100;
    int number_lower = number_input % 100;
    if((1 <= number_upper && number_upper <= 12) && (1 <= number_lower && number_lower <= 12)) {
      System.out.println("AMBIGUOUS");
    } else if(1 <= number_upper && number_upper <= 12) {
      System.out.println("MMYY");
    } else if(1 <= number_lower && number_lower <= 12) {
      System.out.println("YYMM");
    } else {
      System.out.println("NA");
    }
  }
}
