import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        int s1 = s / 100;
        int s2 = s % 100;

        boolean isMonth1 = isMonth(s1);
        boolean isMonth2 = isMonth(s2);

        String result;
        if (isMonth1) {
            result = isMonth2 ? "AMBIGUOUS" : "MMYY";
        } else if (isMonth2) {
            result = "YYMM";
        } else {
            result = "NA";
        }
        System.out.println(result);
    }

    private static boolean isMonth(int num) {
        return 1 <= num && num <= 12;
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        int s1 = s / 100;
        int s2 = s % 100;

        boolean isMonth1 = isMonth(s1);
        boolean isMonth2 = isMonth(s2);

        String result;
        if (isMonth1) {
            result = isMonth2 ? "AMBIGUOUS" : "MMYY";
        } else if (isMonth2) {
            result = "YYMM";
        } else {
            result = "NA";
        }
        System.out.println(result);
    }

    private static boolean isMonth(int num) {
        return 1 <= num && num <= 12;
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        int s1 = s / 100;
        int s2 = s % 100;

        boolean isMonth1 = isMonth(s1);
        boolean isMonth2 = isMonth(s2);

        String result;
        if (isMonth1) {
            result = isMonth2 ? "AMBIGUOUS" : "MMYY";
        } else if (isMonth2) {
            result = "YYMM";
        } else {
            result = "NA";
        }
        System.out.println(result);
    } main {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        int s1 = s / 100;
        int s2 = s % 100;

        boolean isMonth1 = isMonth(s1);
        boolean isMonth2 = isMonth(s2);

        String result;
        if (isMonth1) {
            result = isMonth2 ? "AMBIGUOUS" : "MMYY";
        } else if (isMonth2) {
            result = "YYMM";
        } else {
            result = "NA";
        }
        System.out.println(result);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int s = scanner.nextInt(); s scanner.nextInt() scanner.nextInt scanner int s1 = s / 100; s1 s / 100 s 100 int s2 = s % 100; s2 s % 100 s 100 boolean isMonth1 = isMonth(s1); isMonth1 isMonth(s1) isMonth s1 boolean isMonth2 = isMonth(s2); isMonth2 isMonth(s2) isMonth s2 String result; result if (isMonth1) {
            result = isMonth2 ? "AMBIGUOUS" : "MMYY";
        } else if (isMonth2) {
            result = "YYMM";
        } else {
            result = "NA";
        } isMonth1 {
            result = isMonth2 ? "AMBIGUOUS" : "MMYY";
        } result = isMonth2 ? "AMBIGUOUS" : "MMYY" result isMonth2 ? "AMBIGUOUS" : "MMYY" isMonth2 "AMBIGUOUS" "MMYY" if (isMonth2) {
            result = "YYMM";
        } else {
            result = "NA";
        } isMonth2 {
            result = "YYMM";
        } result = "YYMM" result "YYMM" {
            result = "NA";
        } result = "NA" result "NA" System.out.println(result) System.out.println System.out System System.out result String[] args args private static boolean isMonth(int num) {
        return 1 <= num && num <= 12;
    } isMonth {
        return 1 <= num && num <= 12;
    } return 1 <= num && num <= 12; 1 <= num && num <= 12 1 <= num 1 num num <= 12 num 12 int num num public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        int s1 = s / 100;
        int s2 = s % 100;

        boolean isMonth1 = isMonth(s1);
        boolean isMonth2 = isMonth(s2);

        String result;
        if (isMonth1) {
            result = isMonth2 ? "AMBIGUOUS" : "MMYY";
        } else if (isMonth2) {
            result = "YYMM";
        } else {
            result = "NA";
        }
        System.out.println(result);
    }

    private static boolean isMonth(int num) {
        return 1 <= num && num <= 12;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        int s1 = s / 100;
        int s2 = s % 100;

        boolean isMonth1 = isMonth(s1);
        boolean isMonth2 = isMonth(s2);

        String result;
        if (isMonth1) {
            result = isMonth2 ? "AMBIGUOUS" : "MMYY";
        } else if (isMonth2) {
            result = "YYMM";
        } else {
            result = "NA";
        }
        System.out.println(result);
    }

    private static boolean isMonth(int num) {
        return 1 <= num && num <= 12;
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int s = scanner.nextInt();
        int s1 = s / 100;
        int s2 = s % 100;

        boolean isMonth1 = isMonth(s1);
        boolean isMonth2 = isMonth(s2);

        String result;
        if (isMonth1) {
            result = isMonth2 ? "AMBIGUOUS" : "MMYY";
        } else if (isMonth2) {
            result = "YYMM";
        } else {
            result = "NA";
        }
        System.out.println(result);
    }

    private static boolean isMonth(int num) {
        return 1 <= num && num <= 12;
    }
}