import java.util.*;

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

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        int s=sc.nextInt();
        if(s/100<=12 && s%100<=12 && s/100>0 && s%100>0)
            System.out.println("AMBIGUOUS");
        else if(s/100<=12 && s/100>0)
            System.out.println("MMYY");
        else if(s%100<=12 && s%100>0)
            System.out.println("YYMM");
        else
            System.out.println("NA");
    }
}
