import java.util.*;
class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
	
		int l=s/100;
		int r=s%100;
		String ans="NA";


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


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


		if(0<l&&l<13&&0<r&&r<13)ans="AMBIGUOUS";
		if(0<l&&l<13&&(r<1||12<r))ans="MMYY";
		if((l<1||12<l)&&0<r&&r<13)ans="YYMM";
		
		System.out.println(ans);
	} main {
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
	
		int l=s/100;
		int r=s%100;
		String ans="NA";


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


		if(0<l&&l<13&&0<r&&r<13)ans="AMBIGUOUS";
		if(0<l&&l<13&&(r<1||12<r))ans="MMYY";
		if((l<1||12<l)&&0<r&&r<13)ans="YYMM";
		
		System.out.println(ans);
	}
}