import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner $ = new Scanner(System.in);
		int S = $.nextInt(), Flag = 0;
		int[] s = {S / 100, S % 100};
		for (int i = 0; i < 2; i++){
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		}
		if (Flag == 0){
			System.out.println("NA");
		}
		else if (Flag == 1){
			System.out.println("MMYY");
		}
		else if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		}
		/*
		1905 -> YYMM
		0112 -> AMBIGUOUS
		1700 -> NA
		*/
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) throws Exception {
		Scanner $ = new Scanner(System.in);
		int S = $.nextInt(), Flag = 0;
		int[] s = {S / 100, S % 100};
		for (int i = 0; i < 2; i++){
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		}
		if (Flag == 0){
			System.out.println("NA");
		}
		else if (Flag == 1){
			System.out.println("MMYY");
		}
		else if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		}
		/*
		1905 -> YYMM
		0112 -> AMBIGUOUS
		1700 -> NA
		*/
	}
} Main public static void main(String[] args) throws Exception {
		Scanner $ = new Scanner(System.in);
		int S = $.nextInt(), Flag = 0;
		int[] s = {S / 100, S % 100};
		for (int i = 0; i < 2; i++){
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		}
		if (Flag == 0){
			System.out.println("NA");
		}
		else if (Flag == 1){
			System.out.println("MMYY");
		}
		else if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		}
		/*
		1905 -> YYMM
		0112 -> AMBIGUOUS
		1700 -> NA
		*/
	} main {
		Scanner $ = new Scanner(System.in);
		int S = $.nextInt(), Flag = 0;
		int[] s = {S / 100, S % 100};
		for (int i = 0; i < 2; i++){
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		}
		if (Flag == 0){
			System.out.println("NA");
		}
		else if (Flag == 1){
			System.out.println("MMYY");
		}
		else if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		}
		/*
		1905 -> YYMM
		0112 -> AMBIGUOUS
		1700 -> NA
		*/
	} Scanner $ = new Scanner(System.in); $ new Scanner(System.in) int S = $.nextInt() S $.nextInt() $.nextInt $ Flag = 0; Flag 0 int[] s = {S / 100, S % 100}; s {S / 100, S % 100} S / 100 S 100 S % 100 S 100 for (int i = 0; i < 2; i++){
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		} int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		} {
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		} if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			} s[i] > 0 && s[i] < 13 s[i] > 0 s[i] s i 0 s[i] < 13 s[i] s i 13 {
				Flag += (i + 1);
			} Flag += (i + 1) Flag (i + 1) i 1 if (Flag == 0){
			System.out.println("NA");
		}
		else if (Flag == 1){
			System.out.println("MMYY");
		}
		else if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		} Flag == 0 Flag 0 {
			System.out.println("NA");
		} System.out.println("NA") System.out.println System.out System System.out "NA" if (Flag == 1){
			System.out.println("MMYY");
		}
		else if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		} Flag == 1 Flag 1 {
			System.out.println("MMYY");
		} System.out.println("MMYY") System.out.println System.out System System.out "MMYY" if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		} Flag == 2 Flag 2 {
			System.out.println("YYMM");
		} System.out.println("YYMM") System.out.println System.out System System.out "YYMM" if (Flag == 3){
			System.out.println("AMBIGUOUS");
		} Flag == 3 Flag 3 {
			System.out.println("AMBIGUOUS");
		} System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner $ = new Scanner(System.in);
		int S = $.nextInt(), Flag = 0;
		int[] s = {S / 100, S % 100};
		for (int i = 0; i < 2; i++){
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		}
		if (Flag == 0){
			System.out.println("NA");
		}
		else if (Flag == 1){
			System.out.println("MMYY");
		}
		else if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		}
		/*
		1905 -> YYMM
		0112 -> AMBIGUOUS
		1700 -> NA
		*/
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner $ = new Scanner(System.in);
		int S = $.nextInt(), Flag = 0;
		int[] s = {S / 100, S % 100};
		for (int i = 0; i < 2; i++){
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		}
		if (Flag == 0){
			System.out.println("NA");
		}
		else if (Flag == 1){
			System.out.println("MMYY");
		}
		else if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		}
		/*
		1905 -> YYMM
		0112 -> AMBIGUOUS
		1700 -> NA
		*/
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner $ = new Scanner(System.in);
		int S = $.nextInt(), Flag = 0;
		int[] s = {S / 100, S % 100};
		for (int i = 0; i < 2; i++){
			if (s[i] > 0 && s[i] < 13){
				Flag += (i + 1);
			}
		}
		if (Flag == 0){
			System.out.println("NA");
		}
		else if (Flag == 1){
			System.out.println("MMYY");
		}
		else if (Flag == 2){
			System.out.println("YYMM");
		}
		else if (Flag == 3){
			System.out.println("AMBIGUOUS");
		}
		/*
		1905 -> YYMM
		0112 -> AMBIGUOUS
		1700 -> NA
		*/
	}
}
