import java.util.*;
public class Main {
    public static void main(String[] args) {
        int val;
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
            boolean yymm = false;
            boolean mmyy = false;
            int a = Integer.valueOf(s);

            // yymm
            if (a % 100 <= 12 && 0 < a %100){
                yymm = true;
            }
            if (a / 100 <= 12 && 0 < a / 100){
                mmyy = true;
            }


            if (yymm && mmyy) {
                System.out.println("AMBIGUOUS");
            } else if (yymm) {
                System.out.println("YYMM");
            } else if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        int val;
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
            boolean yymm = false;
            boolean mmyy = false;
            int a = Integer.valueOf(s);

            // yymm
            if (a % 100 <= 12 && 0 < a %100){
                yymm = true;
            }
            if (a / 100 <= 12 && 0 < a / 100){
                mmyy = true;
            }


            if (yymm && mmyy) {
                System.out.println("AMBIGUOUS");
            } else if (yymm) {
                System.out.println("YYMM");
            } else if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            }
    }
} Main public static void main(String[] args) {
        int val;
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
            boolean yymm = false;
            boolean mmyy = false;
            int a = Integer.valueOf(s);

            // yymm
            if (a % 100 <= 12 && 0 < a %100){
                yymm = true;
            }
            if (a / 100 <= 12 && 0 < a / 100){
                mmyy = true;
            }


            if (yymm && mmyy) {
                System.out.println("AMBIGUOUS");
            } else if (yymm) {
                System.out.println("YYMM");
            } else if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            }
    } main {
        int val;
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
            boolean yymm = false;
            boolean mmyy = false;
            int a = Integer.valueOf(s);

            // yymm
            if (a % 100 <= 12 && 0 < a %100){
                yymm = true;
            }
            if (a / 100 <= 12 && 0 < a / 100){
                mmyy = true;
            }


            if (yymm && mmyy) {
                System.out.println("AMBIGUOUS");
            } else if (yymm) {
                System.out.println("YYMM");
            } else if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            }
    } int val; val Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc boolean yymm = false; yymm false boolean mmyy = false; mmyy false int a = Integer.valueOf(s); a Integer.valueOf(s) Integer.valueOf Integer s if (a % 100 <= 12 && 0 < a %100){
                yymm = true;
            } a % 100 <= 12 && 0 < a %100 a % 100 <= 12 a % 100 a 100 12 0 < a %100 0 a %100 a 100 {
                yymm = true;
            } yymm = true yymm true if (a / 100 <= 12 && 0 < a / 100){
                mmyy = true;
            } a / 100 <= 12 && 0 < a / 100 a / 100 <= 12 a / 100 a 100 12 0 < a / 100 0 a / 100 a 100 {
                mmyy = true;
            } mmyy = true mmyy true if (yymm && mmyy) {
                System.out.println("AMBIGUOUS");
            } else if (yymm) {
                System.out.println("YYMM");
            } else if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            } yymm && mmyy yymm mmyy {
                System.out.println("AMBIGUOUS");
            } System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" if (yymm) {
                System.out.println("YYMM");
            } else if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            } yymm {
                System.out.println("YYMM");
            } System.out.println("YYMM") System.out.println System.out System System.out "YYMM" if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            } mmyy {
                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 {
    public static void main(String[] args) {
        int val;
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
            boolean yymm = false;
            boolean mmyy = false;
            int a = Integer.valueOf(s);

            // yymm
            if (a % 100 <= 12 && 0 < a %100){
                yymm = true;
            }
            if (a / 100 <= 12 && 0 < a / 100){
                mmyy = true;
            }


            if (yymm && mmyy) {
                System.out.println("AMBIGUOUS");
            } else if (yymm) {
                System.out.println("YYMM");
            } else if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            }
    }
} public class Main {
    public static void main(String[] args) {
        int val;
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
            boolean yymm = false;
            boolean mmyy = false;
            int a = Integer.valueOf(s);

            // yymm
            if (a % 100 <= 12 && 0 < a %100){
                yymm = true;
            }
            if (a / 100 <= 12 && 0 < a / 100){
                mmyy = true;
            }


            if (yymm && mmyy) {
                System.out.println("AMBIGUOUS");
            } else if (yymm) {
                System.out.println("YYMM");
            } else if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            }
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        int val;
        Scanner sc = new Scanner(System.in);

        String s = sc.next();
            boolean yymm = false;
            boolean mmyy = false;
            int a = Integer.valueOf(s);

            // yymm
            if (a % 100 <= 12 && 0 < a %100){
                yymm = true;
            }
            if (a / 100 <= 12 && 0 < a / 100){
                mmyy = true;
            }


            if (yymm && mmyy) {
                System.out.println("AMBIGUOUS");
            } else if (yymm) {
                System.out.println("YYMM");
            } else if (mmyy) {
                System.out.println("MMYY");
            } else  {
                System.out.println("NA");
            }
    }
}