import java.util.*;
public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int f=a/100;
		int l=a%100;
		String ans="NA";
		if((l>=1&&l<=12)&&(f>=1&&f<=12))
			ans="AMBIGUOUS";
		else if(l>=1&&l<=12)
			ans="YYMM";
		else if(f>=1&&f<=12)
			ans="MMYY";
		System.out.println(ans);

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

	}
} Main public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int f=a/100;
		int l=a%100;
		String ans="NA";
		if((l>=1&&l<=12)&&(f>=1&&f<=12))
			ans="AMBIGUOUS";
		else if(l>=1&&l<=12)
			ans="YYMM";
		else if(f>=1&&f<=12)
			ans="MMYY";
		System.out.println(ans);

	} main {
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int f=a/100;
		int l=a%100;
		String ans="NA";
		if((l>=1&&l<=12)&&(f>=1&&f<=12))
			ans="AMBIGUOUS";
		else if(l>=1&&l<=12)
			ans="YYMM";
		else if(f>=1&&f<=12)
			ans="MMYY";
		System.out.println(ans);

	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int f=a/100; f a/100 a 100 int l=a%100; l a%100 a 100 String ans="NA"; ans "NA" if((l>=1&&l<=12)&&(f>=1&&f<=12))
			ans="AMBIGUOUS";
		else if(l>=1&&l<=12)
			ans="YYMM";
		else if(f>=1&&f<=12)
			ans="MMYY"; (l>=1&&l<=12)&&(f>=1&&f<=12) (l>=1&&l<=12) l>=1 l 1 l<=12 l 12 (f>=1&&f<=12) f>=1 f 1 f<=12 f 12 ans="AMBIGUOUS" ans "AMBIGUOUS" if(l>=1&&l<=12)
			ans="YYMM";
		else if(f>=1&&f<=12)
			ans="MMYY"; l>=1&&l<=12 l>=1 l 1 l<=12 l 12 ans="YYMM" ans "YYMM" if(f>=1&&f<=12)
			ans="MMYY"; f>=1&&f<=12 f>=1 f 1 f<=12 f 12 ans="MMYY" ans "MMYY" System.out.println(ans) System.out.println System.out System System.out ans String arg[] arg public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int f=a/100;
		int l=a%100;
		String ans="NA";
		if((l>=1&&l<=12)&&(f>=1&&f<=12))
			ans="AMBIGUOUS";
		else if(l>=1&&l<=12)
			ans="YYMM";
		else if(f>=1&&f<=12)
			ans="MMYY";
		System.out.println(ans);

	}
} public class Main{
	public static void main(String arg[]){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int f=a/100;
		int l=a%100;
		String ans="NA";
		if((l>=1&&l<=12)&&(f>=1&&f<=12))
			ans="AMBIGUOUS";
		else if(l>=1&&l<=12)
			ans="YYMM";
		else if(f>=1&&f<=12)
			ans="MMYY";
		System.out.println(ans);

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

	}
}