import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int part1 = n / 100;
        int part2 = n % 100;

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

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

        if (part1 <= 12 && part2 <=12 && part1 > 0 && part2 > 0) System.out.println("AMBIGUOUS");
        else if ((part1 > 12 || part1 == 0) && part2 <=12 && part2 > 0) System.out.println("YYMM");
        else if ((part2 > 12 || part2 == 0) && part1 <=12 && part1 > 0)   System.out.println("MMYY");
        else if (part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0) System.out.println("NA");
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int part1 = n / 100;
        int part2 = n % 100;

        if (part1 <= 12 && part2 <=12 && part1 > 0 && part2 > 0) System.out.println("AMBIGUOUS");
        else if ((part1 > 12 || part1 == 0) && part2 <=12 && part2 > 0) System.out.println("YYMM");
        else if ((part2 > 12 || part2 == 0) && part1 <=12 && part1 > 0)   System.out.println("MMYY");
        else if (part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0) 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 part1 = n / 100; part1 n / 100 n 100 int part2 = n % 100; part2 n % 100 n 100 if (part1 <= 12 && part2 <=12 && part1 > 0 && part2 > 0) System.out.println("AMBIGUOUS");
        else if ((part1 > 12 || part1 == 0) && part2 <=12 && part2 > 0) System.out.println("YYMM");
        else if ((part2 > 12 || part2 == 0) && part1 <=12 && part1 > 0)   System.out.println("MMYY");
        else if (part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0) System.out.println("NA"); part1 <= 12 && part2 <=12 && part1 > 0 && part2 > 0 part1 > 0 part1 <= 12 && part2 <=12 && part1 > 0 && part2 > 0 part1 <= 12 part1 12 part2 <=12 part2 12 part1 > 0 part1 0 part2 > 0 part2 0 System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" if ((part1 > 12 || part1 == 0) && part2 <=12 && part2 > 0) System.out.println("YYMM");
        else if ((part2 > 12 || part2 == 0) && part1 <=12 && part1 > 0)   System.out.println("MMYY");
        else if (part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0) System.out.println("NA"); (part1 > 12 || part1 == 0) && part2 <=12 && part2 > 0 (part1 > 12 || part1 == 0) && part2 <=12 && part2 > 0 (part1 > 12 || part1 == 0) part1 > 12 part1 12 part1 == 0 part1 0 part2 <=12 part2 12 part2 > 0 part2 0 System.out.println("YYMM") System.out.println System.out System System.out "YYMM" if ((part2 > 12 || part2 == 0) && part1 <=12 && part1 > 0)   System.out.println("MMYY");
        else if (part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0) System.out.println("NA"); (part2 > 12 || part2 == 0) && part1 <=12 && part1 > 0 (part2 > 12 || part2 == 0) && part1 <=12 && part1 > 0 (part2 > 12 || part2 == 0) part2 > 12 part2 12 part2 == 0 part2 0 part1 <=12 part1 12 part1 > 0 part1 0 System.out.println("MMYY") System.out.println System.out System System.out "MMYY" if (part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0) System.out.println("NA"); part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0 part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0 part1 > 12 && part2 > 12 part1 > 12 part1 12 part2 > 12 part2 12 part1 == 0 part1 0 part2 == 0 part2 0 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 part1 = n / 100;
        int part2 = n % 100;

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

        if (part1 <= 12 && part2 <=12 && part1 > 0 && part2 > 0) System.out.println("AMBIGUOUS");
        else if ((part1 > 12 || part1 == 0) && part2 <=12 && part2 > 0) System.out.println("YYMM");
        else if ((part2 > 12 || part2 == 0) && part1 <=12 && part1 > 0)   System.out.println("MMYY");
        else if (part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0) System.out.println("NA");
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int part1 = n / 100;
        int part2 = n % 100;

        if (part1 <= 12 && part2 <=12 && part1 > 0 && part2 > 0) System.out.println("AMBIGUOUS");
        else if ((part1 > 12 || part1 == 0) && part2 <=12 && part2 > 0) System.out.println("YYMM");
        else if ((part2 > 12 || part2 == 0) && part1 <=12 && part1 > 0)   System.out.println("MMYY");
        else if (part1 > 12 && part2 > 12 || part1 == 0 || part2 == 0) System.out.println("NA");
    }
}