import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int r = S % 100;
        if (S >= 100 && S < 1300) {
            if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            }
        }
        else{
            if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            else{
                System.out.println("NA");
            }
        }
    }
}
 import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.ArrayList; ArrayList java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int r = S % 100;
        if (S >= 100 && S < 1300) {
            if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            }
        }
        else{
            if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            else{
                System.out.println("NA");
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int r = S % 100;
        if (S >= 100 && S < 1300) {
            if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            }
        }
        else{
            if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            else{
                System.out.println("NA");
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int r = S % 100;
        if (S >= 100 && S < 1300) {
            if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            }
        }
        else{
            if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            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 r = S % 100; r S % 100 S 100 if (S >= 100 && S < 1300) {
            if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            }
        }
        else{
            if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            else{
                System.out.println("NA");
            }
        } S >= 100 && S < 1300 S >= 100 S 100 S < 1300 S 1300 {
            if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            }
        } if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            } r <= 12 & r != 0 r <= 12 r 12 r != 0 r 0 {
                System.out.println("AMBIGUOUS");
            } System.out.println("AMBIGUOUS") System.out.println System.out System System.out "AMBIGUOUS" {
                System.out.println("MMYY");
            } System.out.println("MMYY") System.out.println System.out System System.out "MMYY" {
            if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            else{
                System.out.println("NA");
            }
        } if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            else{
                System.out.println("NA");
            } r <= 12 & r != 0 r <= 12 r 12 r != 0 r 0 {
                System.out.println("YYMM");
            } System.out.println("YYMM") System.out.println System.out System System.out "YYMM" {
                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) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int r = S % 100;
        if (S >= 100 && S < 1300) {
            if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            }
        }
        else{
            if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            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 r = S % 100;
        if (S >= 100 && S < 1300) {
            if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            }
        }
        else{
            if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            else{
                System.out.println("NA");
            }
        }
    }
} Main
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int r = S % 100;
        if (S >= 100 && S < 1300) {
            if (r <= 12 & r != 0) {
                System.out.println("AMBIGUOUS");
            }
            else{
                System.out.println("MMYY");
            }
        }
        else{
            if (r <= 12 & r != 0) {
                System.out.println("YYMM");
            }
            else{
                System.out.println("NA");
            }
        }
    }
}

