import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int F = S / 100;
        int B = S % 100;
        System.out.println((F>=1&F<=12) ? (B>=1&B<=12) ? "AMBIGUOUS":"MMYY":(B>=1&B<=12) ? "YYMM":"NA");
        sc.close();
    }
} 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 F = S / 100;
        int B = S % 100;
        System.out.println((F>=1&F<=12) ? (B>=1&B<=12) ? "AMBIGUOUS":"MMYY":(B>=1&B<=12) ? "YYMM":"NA");
        sc.close();
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int F = S / 100;
        int B = S % 100;
        System.out.println((F>=1&F<=12) ? (B>=1&B<=12) ? "AMBIGUOUS":"MMYY":(B>=1&B<=12) ? "YYMM":"NA");
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int F = S / 100;
        int B = S % 100;
        System.out.println((F>=1&F<=12) ? (B>=1&B<=12) ? "AMBIGUOUS":"MMYY":(B>=1&B<=12) ? "YYMM":"NA");
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int S = sc.nextInt(); S sc.nextInt() sc.nextInt sc int F = S / 100; F S / 100 S 100 int B = S % 100; B S % 100 S 100 System.out.println((F>=1&F<=12) ? (B>=1&B<=12) ? "AMBIGUOUS":"MMYY":(B>=1&B<=12) ? "YYMM":"NA") System.out.println System.out System System.out (F>=1&F<=12) ? (B>=1&B<=12) ? "AMBIGUOUS":"MMYY":(B>=1&B<=12) ? "YYMM":"NA" (F>=1&F<=12) F>=1 F 1 F<=12 F 12 (B>=1&B<=12) ? "AMBIGUOUS":"MMYY" (B>=1&B<=12) B>=1 B 1 B<=12 B 12 "AMBIGUOUS" "MMYY" (B>=1&B<=12) ? "YYMM":"NA" (B>=1&B<=12) B>=1 B 1 B<=12 B 12 "YYMM" "NA" sc.close() sc.close sc String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int F = S / 100;
        int B = S % 100;
        System.out.println((F>=1&F<=12) ? (B>=1&B<=12) ? "AMBIGUOUS":"MMYY":(B>=1&B<=12) ? "YYMM":"NA");
        sc.close();
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        int F = S / 100;
        int B = S % 100;
        System.out.println((F>=1&F<=12) ? (B>=1&B<=12) ? "AMBIGUOUS":"MMYY":(B>=1&B<=12) ? "YYMM":"NA");
        sc.close();
    }
} 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 F = S / 100;
        int B = S % 100;
        System.out.println((F>=1&F<=12) ? (B>=1&B<=12) ? "AMBIGUOUS":"MMYY":(B>=1&B<=12) ? "YYMM":"NA");
        sc.close();
    }
}