import java.util.Scanner;

public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        int first = num / 100;
        int last = num % 100;
        
        // search
        String answer = "NA";
        if(last >= 1 && last <= 12 && first >= 1 && first <= 12){
            answer = "AMBIGUOUS";
        } else if (last >= 1 && last <= 12){
            answer = "YYMM";
        } else if (first >= 1 && first <= 12){
            answer = "MMYY";
        }

        // answer
        System.out.println(answer);


    }
} import java.util.Scanner; Scanner java.util public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        int first = num / 100;
        int last = num % 100;
        
        // search
        String answer = "NA";
        if(last >= 1 && last <= 12 && first >= 1 && first <= 12){
            answer = "AMBIGUOUS";
        } else if (last >= 1 && last <= 12){
            answer = "YYMM";
        } else if (first >= 1 && first <= 12){
            answer = "MMYY";
        }

        // answer
        System.out.println(answer);


    }
} Main public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        int first = num / 100;
        int last = num % 100;
        
        // search
        String answer = "NA";
        if(last >= 1 && last <= 12 && first >= 1 && first <= 12){
            answer = "AMBIGUOUS";
        } else if (last >= 1 && last <= 12){
            answer = "YYMM";
        } else if (first >= 1 && first <= 12){
            answer = "MMYY";
        }

        // answer
        System.out.println(answer);


    } main {
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        int first = num / 100;
        int last = num % 100;
        
        // search
        String answer = "NA";
        if(last >= 1 && last <= 12 && first >= 1 && first <= 12){
            answer = "AMBIGUOUS";
        } else if (last >= 1 && last <= 12){
            answer = "YYMM";
        } else if (first >= 1 && first <= 12){
            answer = "MMYY";
        }

        // answer
        System.out.println(answer);


    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int num = scan.nextInt(); num scan.nextInt() scan.nextInt scan int first = num / 100; first num / 100 num 100 int last = num % 100; last num % 100 num 100 String answer = "NA"; answer "NA" if(last >= 1 && last <= 12 && first >= 1 && first <= 12){
            answer = "AMBIGUOUS";
        } else if (last >= 1 && last <= 12){
            answer = "YYMM";
        } else if (first >= 1 && first <= 12){
            answer = "MMYY";
        } last >= 1 && last <= 12 && first >= 1 && first <= 12 first >= 1 last >= 1 && last <= 12 && first >= 1 && first <= 12 last >= 1 last 1 last <= 12 last 12 first >= 1 first 1 first <= 12 first 12 {
            answer = "AMBIGUOUS";
        } answer = "AMBIGUOUS" answer "AMBIGUOUS" if (last >= 1 && last <= 12){
            answer = "YYMM";
        } else if (first >= 1 && first <= 12){
            answer = "MMYY";
        } last >= 1 && last <= 12 last >= 1 last 1 last <= 12 last 12 {
            answer = "YYMM";
        } answer = "YYMM" answer "YYMM" if (first >= 1 && first <= 12){
            answer = "MMYY";
        } first >= 1 && first <= 12 first >= 1 first 1 first <= 12 first 12 {
            answer = "MMYY";
        } answer = "MMYY" answer "MMYY" System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        int first = num / 100;
        int last = num % 100;
        
        // search
        String answer = "NA";
        if(last >= 1 && last <= 12 && first >= 1 && first <= 12){
            answer = "AMBIGUOUS";
        } else if (last >= 1 && last <= 12){
            answer = "YYMM";
        } else if (first >= 1 && first <= 12){
            answer = "MMYY";
        }

        // answer
        System.out.println(answer);


    }
} public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        int first = num / 100;
        int last = num % 100;
        
        // search
        String answer = "NA";
        if(last >= 1 && last <= 12 && first >= 1 && first <= 12){
            answer = "AMBIGUOUS";
        } else if (last >= 1 && last <= 12){
            answer = "YYMM";
        } else if (first >= 1 && first <= 12){
            answer = "MMYY";
        }

        // answer
        System.out.println(answer);


    }
} Main
import java.util.Scanner;

public class Main{

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        // input
        int num = scan.nextInt();
        int first = num / 100;
        int last = num % 100;
        
        // search
        String answer = "NA";
        if(last >= 1 && last <= 12 && first >= 1 && first <= 12){
            answer = "AMBIGUOUS";
        } else if (last >= 1 && last <= 12){
            answer = "YYMM";
        } else if (first >= 1 && first <= 12){
            answer = "MMYY";
        }

        // answer
        System.out.println(answer);


    }
}