
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int input = sc.nextInt();
		
		int aa = input / 100;
		int bb = input % 100;
		
		boolean yymm = false;
		boolean mmyy = false;
		
		if(aa >= 1 && aa <= 12) {
			mmyy = true;
		}
		
		if(bb >= 1 && bb <= 12) {
			yymm = true;
		}
		
		if(yymm && mmyy) {
			System.out.println("AMBIGUOUS");
		}
		else if(yymm && !mmyy) {
			System.out.println("YYMM");
		}
		else if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		}
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int input = sc.nextInt();
		
		int aa = input / 100;
		int bb = input % 100;
		
		boolean yymm = false;
		boolean mmyy = false;
		
		if(aa >= 1 && aa <= 12) {
			mmyy = true;
		}
		
		if(bb >= 1 && bb <= 12) {
			yymm = true;
		}
		
		if(yymm && mmyy) {
			System.out.println("AMBIGUOUS");
		}
		else if(yymm && !mmyy) {
			System.out.println("YYMM");
		}
		else if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		}
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int input = sc.nextInt();
		
		int aa = input / 100;
		int bb = input % 100;
		
		boolean yymm = false;
		boolean mmyy = false;
		
		if(aa >= 1 && aa <= 12) {
			mmyy = true;
		}
		
		if(bb >= 1 && bb <= 12) {
			yymm = true;
		}
		
		if(yymm && mmyy) {
			System.out.println("AMBIGUOUS");
		}
		else if(yymm && !mmyy) {
			System.out.println("YYMM");
		}
		else if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		}
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int input = sc.nextInt();
		
		int aa = input / 100;
		int bb = input % 100;
		
		boolean yymm = false;
		boolean mmyy = false;
		
		if(aa >= 1 && aa <= 12) {
			mmyy = true;
		}
		
		if(bb >= 1 && bb <= 12) {
			yymm = true;
		}
		
		if(yymm && mmyy) {
			System.out.println("AMBIGUOUS");
		}
		else if(yymm && !mmyy) {
			System.out.println("YYMM");
		}
		else if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int input = sc.nextInt(); input sc.nextInt() sc.nextInt sc int aa = input / 100; aa input / 100 input 100 int bb = input % 100; bb input % 100 input 100 boolean yymm = false; yymm false boolean mmyy = false; mmyy false if(aa >= 1 && aa <= 12) {
			mmyy = true;
		} aa >= 1 && aa <= 12 aa >= 1 aa 1 aa <= 12 aa 12 {
			mmyy = true;
		} mmyy = true mmyy true if(bb >= 1 && bb <= 12) {
			yymm = true;
		} bb >= 1 && bb <= 12 bb >= 1 bb 1 bb <= 12 bb 12 {
			yymm = true;
		} yymm = true yymm true if(yymm && mmyy) {
			System.out.println("AMBIGUOUS");
		}
		else if(yymm && !mmyy) {
			System.out.println("YYMM");
		}
		else if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		} yymm && mmyy yymm mmyy {
			System.out.println("AMBIGUOUS");
		} System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" if(yymm && !mmyy) {
			System.out.println("YYMM");
		}
		else if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		} yymm && !mmyy yymm !mmyy mmyy {
			System.out.println("YYMM");
		} System.out.println("YYMM") System.out.println System.out System System.out "YYMM" if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		} !yymm && mmyy !yymm yymm mmyy {
			System.out.println("MMYY");
		} System.out.println("MMYY") System.out.println System.out System System.out "MMYY" {
			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) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int input = sc.nextInt();
		
		int aa = input / 100;
		int bb = input % 100;
		
		boolean yymm = false;
		boolean mmyy = false;
		
		if(aa >= 1 && aa <= 12) {
			mmyy = true;
		}
		
		if(bb >= 1 && bb <= 12) {
			yymm = true;
		}
		
		if(yymm && mmyy) {
			System.out.println("AMBIGUOUS");
		}
		else if(yymm && !mmyy) {
			System.out.println("YYMM");
		}
		else if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		}
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int input = sc.nextInt();
		
		int aa = input / 100;
		int bb = input % 100;
		
		boolean yymm = false;
		boolean mmyy = false;
		
		if(aa >= 1 && aa <= 12) {
			mmyy = true;
		}
		
		if(bb >= 1 && bb <= 12) {
			yymm = true;
		}
		
		if(yymm && mmyy) {
			System.out.println("AMBIGUOUS");
		}
		else if(yymm && !mmyy) {
			System.out.println("YYMM");
		}
		else if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		}
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int input = sc.nextInt();
		
		int aa = input / 100;
		int bb = input % 100;
		
		boolean yymm = false;
		boolean mmyy = false;
		
		if(aa >= 1 && aa <= 12) {
			mmyy = true;
		}
		
		if(bb >= 1 && bb <= 12) {
			yymm = true;
		}
		
		if(yymm && mmyy) {
			System.out.println("AMBIGUOUS");
		}
		else if(yymm && !mmyy) {
			System.out.println("YYMM");
		}
		else if(!yymm && mmyy) {
			System.out.println("MMYY");
		}
		else {
			System.out.println("NA");
		}
	}

}
