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