import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int i = s % 100;
        int k = s / 100;
        if (1 <= i && i <= 12 && 1 <= k && k <= 12)
            System.out.println("AMBIGUOUS");
        else if (1 <= i && i <= 12)
            System.out.println("YYMM");
        else if (1 <= k && k <= 12)
            System.out.println("MMYY");
        else
            System.out.println("NA");
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int i = s % 100;
        int k = s / 100;
        if (1 <= i && i <= 12 && 1 <= k && k <= 12)
            System.out.println("AMBIGUOUS");
        else if (1 <= i && i <= 12)
            System.out.println("YYMM");
        else if (1 <= k && k <= 12)
            System.out.println("MMYY");
        else
            System.out.println("NA");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int i = s % 100;
        int k = s / 100;
        if (1 <= i && i <= 12 && 1 <= k && k <= 12)
            System.out.println("AMBIGUOUS");
        else if (1 <= i && i <= 12)
            System.out.println("YYMM");
        else if (1 <= k && k <= 12)
            System.out.println("MMYY");
        else
            System.out.println("NA");
    } main {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int i = s % 100;
        int k = s / 100;
        if (1 <= i && i <= 12 && 1 <= k && k <= 12)
            System.out.println("AMBIGUOUS");
        else if (1 <= i && i <= 12)
            System.out.println("YYMM");
        else if (1 <= k && k <= 12)
            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 i = s % 100; i s % 100 s 100 int k = s / 100; k s / 100 s 100 if (1 <= i && i <= 12 && 1 <= k && k <= 12)
            System.out.println("AMBIGUOUS");
        else if (1 <= i && i <= 12)
            System.out.println("YYMM");
        else if (1 <= k && k <= 12)
            System.out.println("MMYY");
        else
            System.out.println("NA"); 1 <= i && i <= 12 && 1 <= k && k <= 12 1 <= k 1 <= i && i <= 12 && 1 <= k && k <= 12 1 <= i 1 i i <= 12 i 12 1 <= k 1 k k <= 12 k 12 System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" if (1 <= i && i <= 12)
            System.out.println("YYMM");
        else if (1 <= k && k <= 12)
            System.out.println("MMYY");
        else
            System.out.println("NA"); 1 <= i && i <= 12 1 <= i 1 i i <= 12 i 12 System.out.println("YYMM") System.out.println System.out System System.out "YYMM" if (1 <= k && k <= 12)
            System.out.println("MMYY");
        else
            System.out.println("NA"); 1 <= k && k <= 12 1 <= k 1 k k <= 12 k 12 System.out.println("MMYY") System.out.println System.out System System.out "MMYY" 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 s = sc.nextInt();
        int i = s % 100;
        int k = s / 100;
        if (1 <= i && i <= 12 && 1 <= k && k <= 12)
            System.out.println("AMBIGUOUS");
        else if (1 <= i && i <= 12)
            System.out.println("YYMM");
        else if (1 <= k && k <= 12)
            System.out.println("MMYY");
        else
            System.out.println("NA");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int i = s % 100;
        int k = s / 100;
        if (1 <= i && i <= 12 && 1 <= k && k <= 12)
            System.out.println("AMBIGUOUS");
        else if (1 <= i && i <= 12)
            System.out.println("YYMM");
        else if (1 <= k && k <= 12)
            System.out.println("MMYY");
        else
            System.out.println("NA");
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int s = sc.nextInt();
        int i = s % 100;
        int k = s / 100;
        if (1 <= i && i <= 12 && 1 <= k && k <= 12)
            System.out.println("AMBIGUOUS");
        else if (1 <= i && i <= 12)
            System.out.println("YYMM");
        else if (1 <= k && k <= 12)
            System.out.println("MMYY");
        else
            System.out.println("NA");
    }
}
