import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int s = sc.nextInt();

        int s1 = s / 100;
        int s2 = s - (s1 * 100);

        if (s1 > 0 && s1 <= 12 && s2 > 0 && s2 <= 12)
            System.out.println("AMBIGUOUS");
        else if (s1 > 0 && s1 <= 12)
            System.out.println("MMYY");
        else if (s2 > 0 && s2 <= 12)
            System.out.println("YYMM");
        else
            System.out.println("NA");
        sc.close();
    }
} import java.util.*; util.* java public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int s = sc.nextInt();

        int s1 = s / 100;
        int s2 = s - (s1 * 100);

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

        int s1 = s / 100;
        int s2 = s - (s1 * 100);

        if (s1 > 0 && s1 <= 12 && s2 > 0 && s2 <= 12)
            System.out.println("AMBIGUOUS");
        else if (s1 > 0 && s1 <= 12)
            System.out.println("MMYY");
        else if (s2 > 0 && s2 <= 12)
            System.out.println("YYMM");
        else
            System.out.println("NA");
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        
        int s = sc.nextInt();

        int s1 = s / 100;
        int s2 = s - (s1 * 100);

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

        int s1 = s / 100;
        int s2 = s - (s1 * 100);

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

        int s1 = s / 100;
        int s2 = s - (s1 * 100);

        if (s1 > 0 && s1 <= 12 && s2 > 0 && s2 <= 12)
            System.out.println("AMBIGUOUS");
        else if (s1 > 0 && s1 <= 12)
            System.out.println("MMYY");
        else if (s2 > 0 && s2 <= 12)
            System.out.println("YYMM");
        else
            System.out.println("NA");
        sc.close();
    }
} Main
import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        
        int s = sc.nextInt();

        int s1 = s / 100;
        int s2 = s - (s1 * 100);

        if (s1 > 0 && s1 <= 12 && s2 > 0 && s2 <= 12)
            System.out.println("AMBIGUOUS");
        else if (s1 > 0 && s1 <= 12)
            System.out.println("MMYY");
        else if (s2 > 0 && s2 <= 12)
            System.out.println("YYMM");
        else
            System.out.println("NA");
        sc.close();
    }
}