
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;
		String out;

		if (isMonth(fh) && isMonth(sh)){
			out = "AMBIGUOUS";
		}else if (isMonth(fh)){
			out = "MMYY";
		}else if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		}

		System.out.println(out);

    }

    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;
		String out;

		if (isMonth(fh) && isMonth(sh)){
			out = "AMBIGUOUS";
		}else if (isMonth(fh)){
			out = "MMYY";
		}else if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		}

		System.out.println(out);

    }

    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;
		String out;

		if (isMonth(fh) && isMonth(sh)){
			out = "AMBIGUOUS";
		}else if (isMonth(fh)){
			out = "MMYY";
		}else if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		}

		System.out.println(out);

    } main {

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

		if (isMonth(fh) && isMonth(sh)){
			out = "AMBIGUOUS";
		}else if (isMonth(fh)){
			out = "MMYY";
		}else if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		}

		System.out.println(out);

    } 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 String out; out if (isMonth(fh) && isMonth(sh)){
			out = "AMBIGUOUS";
		}else if (isMonth(fh)){
			out = "MMYY";
		}else if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		} isMonth(fh) && isMonth(sh) isMonth(fh) isMonth fh isMonth(sh) isMonth sh {
			out = "AMBIGUOUS";
		} out = "AMBIGUOUS" out "AMBIGUOUS" if (isMonth(fh)){
			out = "MMYY";
		}else if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		} isMonth(fh) isMonth fh {
			out = "MMYY";
		} out = "MMYY" out "MMYY" if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		} isMonth(sh) isMonth sh {
			out = "YYMM";
		} out = "YYMM" out "YYMM" {
			out = "NA";
		} out = "NA" out "NA" System.out.println(out) System.out.println System.out System System.out out 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;
		String out;

		if (isMonth(fh) && isMonth(sh)){
			out = "AMBIGUOUS";
		}else if (isMonth(fh)){
			out = "MMYY";
		}else if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		}

		System.out.println(out);

    }

    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;
		String out;

		if (isMonth(fh) && isMonth(sh)){
			out = "AMBIGUOUS";
		}else if (isMonth(fh)){
			out = "MMYY";
		}else if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		}

		System.out.println(out);

    }

    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;
		String out;

		if (isMonth(fh) && isMonth(sh)){
			out = "AMBIGUOUS";
		}else if (isMonth(fh)){
			out = "MMYY";
		}else if (isMonth(sh)){
			out = "YYMM";
		}else{
			out = "NA";
		}

		System.out.println(out);

    }

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


}