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