import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);       
		int n = sc.nextInt();
        int judge = 0;
        if(n%100>0 && n%100<=12){judge++;}
        if(n/100>0 && n/100<=12){judge+=2;}
		if(judge==0){System.out.println("NA");}
        if(judge==1){System.out.println("YYMM");}
        if(judge==2){System.out.println("MMYY");}
        if(judge==3){System.out.println("AMBIGUOUS");}
  }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);       
		int n = sc.nextInt();
        int judge = 0;
        if(n%100>0 && n%100<=12){judge++;}
        if(n/100>0 && n/100<=12){judge+=2;}
		if(judge==0){System.out.println("NA");}
        if(judge==1){System.out.println("YYMM");}
        if(judge==2){System.out.println("MMYY");}
        if(judge==3){System.out.println("AMBIGUOUS");}
  }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);       
		int n = sc.nextInt();
        int judge = 0;
        if(n%100>0 && n%100<=12){judge++;}
        if(n/100>0 && n/100<=12){judge+=2;}
		if(judge==0){System.out.println("NA");}
        if(judge==1){System.out.println("YYMM");}
        if(judge==2){System.out.println("MMYY");}
        if(judge==3){System.out.println("AMBIGUOUS");}
  } main {
		Scanner sc = new Scanner(System.in);       
		int n = sc.nextInt();
        int judge = 0;
        if(n%100>0 && n%100<=12){judge++;}
        if(n/100>0 && n/100<=12){judge+=2;}
		if(judge==0){System.out.println("NA");}
        if(judge==1){System.out.println("YYMM");}
        if(judge==2){System.out.println("MMYY");}
        if(judge==3){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 judge = 0; judge 0 if(n%100>0 && n%100<=12){judge++;} n%100>0 && n%100<=12 n%100>0 n%100 n 100 0 n%100<=12 n%100 n 100 12 {judge++;} judge++ judge if(n/100>0 && n/100<=12){judge+=2;} n/100>0 && n/100<=12 n/100>0 n/100 n 100 0 n/100<=12 n/100 n 100 12 {judge+=2;} judge+=2 judge 2 if(judge==0){System.out.println("NA");} judge==0 judge 0 {System.out.println("NA");} System.out.println("NA") System.out.println System.out System System.out "NA" if(judge==1){System.out.println("YYMM");} judge==1 judge 1 {System.out.println("YYMM");} System.out.println("YYMM") System.out.println System.out System System.out "YYMM" if(judge==2){System.out.println("MMYY");} judge==2 judge 2 {System.out.println("MMYY");} System.out.println("MMYY") System.out.println System.out System System.out "MMYY" if(judge==3){System.out.println("AMBIGUOUS");} judge==3 judge 3 {System.out.println("AMBIGUOUS");} System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);       
		int n = sc.nextInt();
        int judge = 0;
        if(n%100>0 && n%100<=12){judge++;}
        if(n/100>0 && n/100<=12){judge+=2;}
		if(judge==0){System.out.println("NA");}
        if(judge==1){System.out.println("YYMM");}
        if(judge==2){System.out.println("MMYY");}
        if(judge==3){System.out.println("AMBIGUOUS");}
  }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);       
		int n = sc.nextInt();
        int judge = 0;
        if(n%100>0 && n%100<=12){judge++;}
        if(n/100>0 && n/100<=12){judge+=2;}
		if(judge==0){System.out.println("NA");}
        if(judge==1){System.out.println("YYMM");}
        if(judge==2){System.out.println("MMYY");}
        if(judge==3){System.out.println("AMBIGUOUS");}
  }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);       
		int n = sc.nextInt();
        int judge = 0;
        if(n%100>0 && n%100<=12){judge++;}
        if(n/100>0 && n/100<=12){judge+=2;}
		if(judge==0){System.out.println("NA");}
        if(judge==1){System.out.println("YYMM");}
        if(judge==2){System.out.println("MMYY");}
        if(judge==3){System.out.println("AMBIGUOUS");}
  }
}
