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