import java.util.*;
public class Main {
    public static void main(String[] args) {

		Scanner s = new Scanner((System.in));
		int n = s.nextInt();
		int fh = n / 100;
		int sh = n % 100;

		System.out.println(isMonth(fh) ? (isMonth(sh) ? "AMBIGUOUS " : "MMYY") : (isMonth(sh) ? "YYMM" : "NA"));

    }

    public static Boolean isMonth(int i){
    	return (1 <= i) && (i <= 12);
	}


} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {

		Scanner s = new Scanner((System.in));
		int n = s.nextInt();
		int fh = n / 100;
		int sh = n % 100;

		System.out.println(isMonth(fh) ? (isMonth(sh) ? "AMBIGUOUS " : "MMYY") : (isMonth(sh) ? "YYMM" : "NA"));

    }

    public static Boolean isMonth(int i){
    	return (1 <= i) && (i <= 12);
	}


} Main public static void main(String[] args) {

		Scanner s = new Scanner((System.in));
		int n = s.nextInt();
		int fh = n / 100;
		int sh = n % 100;

		System.out.println(isMonth(fh) ? (isMonth(sh) ? "AMBIGUOUS " : "MMYY") : (isMonth(sh) ? "YYMM" : "NA"));

    } main {

		Scanner s = new Scanner((System.in));
		int n = s.nextInt();
		int fh = n / 100;
		int sh = n % 100;

		System.out.println(isMonth(fh) ? (isMonth(sh) ? "AMBIGUOUS " : "MMYY") : (isMonth(sh) ? "YYMM" : "NA"));

    } Scanner s = new Scanner((System.in)); s new Scanner((System.in)) int n = s.nextInt(); n s.nextInt() s.nextInt s int fh = n / 100; fh n / 100 n 100 int sh = n % 100; sh n % 100 n 100 System.out.println(isMonth(fh) ? (isMonth(sh) ? "AMBIGUOUS " : "MMYY") : (isMonth(sh) ? "YYMM" : "NA")) System.out.println System.out System System.out isMonth(fh) ? (isMonth(sh) ? "AMBIGUOUS " : "MMYY") : (isMonth(sh) ? "YYMM" : "NA") isMonth(fh) isMonth fh (isMonth(sh) ? "AMBIGUOUS " : "MMYY") isMonth(sh) isMonth sh "AMBIGUOUS " "MMYY" (isMonth(sh) ? "YYMM" : "NA") isMonth(sh) isMonth sh "YYMM" "NA" String[] args args public static Boolean isMonth(int i){
    	return (1 <= i) && (i <= 12);
	} isMonth {
    	return (1 <= i) && (i <= 12);
	} return (1 <= i) && (i <= 12); (1 <= i) && (i <= 12) (1 <= i) 1 i (i <= 12) i 12 int i i public class Main {
    public static void main(String[] args) {

		Scanner s = new Scanner((System.in));
		int n = s.nextInt();
		int fh = n / 100;
		int sh = n % 100;

		System.out.println(isMonth(fh) ? (isMonth(sh) ? "AMBIGUOUS " : "MMYY") : (isMonth(sh) ? "YYMM" : "NA"));

    }

    public static Boolean isMonth(int i){
    	return (1 <= i) && (i <= 12);
	}


} public class Main {
    public static void main(String[] args) {

		Scanner s = new Scanner((System.in));
		int n = s.nextInt();
		int fh = n / 100;
		int sh = n % 100;

		System.out.println(isMonth(fh) ? (isMonth(sh) ? "AMBIGUOUS " : "MMYY") : (isMonth(sh) ? "YYMM" : "NA"));

    }

    public static Boolean isMonth(int i){
    	return (1 <= i) && (i <= 12);
	}


} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {

		Scanner s = new Scanner((System.in));
		int n = s.nextInt();
		int fh = n / 100;
		int sh = n % 100;

		System.out.println(isMonth(fh) ? (isMonth(sh) ? "AMBIGUOUS " : "MMYY") : (isMonth(sh) ? "YYMM" : "NA"));

    }

    public static Boolean isMonth(int i){
    	return (1 <= i) && (i <= 12);
	}


}
