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