import java.util.*;

public class Main {
    static long mod = 1000000007;

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

        if (a <= 12 && b <= 12 && a > 0 && b > 0) {
            System.out.println("AMBIGUOUS");
        } else if (b <= 12 && b > 0) {
            System.out.println("YYMM");
        } else if (a <= 12 && a > 0) {
            System.out.println("MMYY");
        } else {
            System.out.println("NA");
        }
    }
} import java.util.*; util.* java public class Main {
    static long mod = 1000000007;

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

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

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

        if (a <= 12 && b <= 12 && a > 0 && b > 0) {
            System.out.println("AMBIGUOUS");
        } else if (b <= 12 && b > 0) {
            System.out.println("YYMM");
        } else if (a <= 12 && a > 0) {
            System.out.println("MMYY");
        } 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 int a = s / 100; a s / 100 s 100 int b = s % 100; b s % 100 s 100 if (a <= 12 && b <= 12 && a > 0 && b > 0) {
            System.out.println("AMBIGUOUS");
        } else if (b <= 12 && b > 0) {
            System.out.println("YYMM");
        } else if (a <= 12 && a > 0) {
            System.out.println("MMYY");
        } else {
            System.out.println("NA");
        } a <= 12 && b <= 12 && a > 0 && b > 0 a > 0 a <= 12 && b <= 12 && a > 0 && b > 0 a <= 12 a 12 b <= 12 b 12 a > 0 a 0 b > 0 b 0 {
            System.out.println("AMBIGUOUS");
        } System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" if (b <= 12 && b > 0) {
            System.out.println("YYMM");
        } else if (a <= 12 && a > 0) {
            System.out.println("MMYY");
        } else {
            System.out.println("NA");
        } b <= 12 && b > 0 b <= 12 b 12 b > 0 b 0 {
            System.out.println("YYMM");
        } System.out.println("YYMM") System.out.println System.out System System.out "YYMM" if (a <= 12 && a > 0) {
            System.out.println("MMYY");
        } else {
            System.out.println("NA");
        } a <= 12 && a > 0 a <= 12 a 12 a > 0 a 0 {
            System.out.println("MMYY");
        } System.out.println("MMYY") System.out.println System.out System System.out "MMYY" {
            System.out.println("NA");
        } System.out.println("NA") System.out.println System.out System System.out "NA" String[] args args public class Main {
    static long mod = 1000000007;

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

        if (a <= 12 && b <= 12 && a > 0 && b > 0) {
            System.out.println("AMBIGUOUS");
        } else if (b <= 12 && b > 0) {
            System.out.println("YYMM");
        } else if (a <= 12 && a > 0) {
            System.out.println("MMYY");
        } else {
            System.out.println("NA");
        }
    }
} public class Main {
    static long mod = 1000000007;

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

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

public class Main {
    static long mod = 1000000007;

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

        if (a <= 12 && b <= 12 && a > 0 && b > 0) {
            System.out.println("AMBIGUOUS");
        } else if (b <= 12 && b > 0) {
            System.out.println("YYMM");
        } else if (a <= 12 && a > 0) {
            System.out.println("MMYY");
        } else {
            System.out.println("NA");
        }
    }
}
