import math


def isMM(num):
    if num < 13 and num > 0:
        return True
    else:
        return False


def hantei(number):
    num = math.floor(number/100)
    ber = number % 100
    if isMM(num) is False and isMM(ber) is False:
        return "NA"
    elif isMM(num) is True and isMM(ber) is True:
        return "AMBIGUOUS"
    elif isMM(num) is True and isMM(ber) is False:
        return "MMYY"
    else:
        return "YYMM"


num = int(input())
print(hantei(num)) import math math def isMM(num):
    if num < 13 and num > 0:
        return True
    else:
        return False isMM if num < 13 and num > 0:
        return True
    else:
        return False num < 13 and num > 0 num < 13 num 13 num > 0 num 0 return True True return False False num num def hantei(number):
    num = math.floor(number/100)
    ber = number % 100
    if isMM(num) is False and isMM(ber) is False:
        return "NA"
    elif isMM(num) is True and isMM(ber) is True:
        return "AMBIGUOUS"
    elif isMM(num) is True and isMM(ber) is False:
        return "MMYY"
    else:
        return "YYMM" hantei num = math.floor(number/100) num math.floor(number/100) math.floor math floor number/100 number 100 ber = number % 100 ber number % 100 number 100 if isMM(num) is False and isMM(ber) is False:
        return "NA"
    elif isMM(num) is True and isMM(ber) is True:
        return "AMBIGUOUS"
    elif isMM(num) is True and isMM(ber) is False:
        return "MMYY"
    else:
        return "YYMM" isMM(num) is False and isMM(ber) is False isMM(num) is False isMM(num) isMM num False isMM(ber) is False isMM(ber) isMM ber False return "NA" "NA" elif isMM(num) is True and isMM(ber) is True:
        return "AMBIGUOUS"
     isMM(num) is True and isMM(ber) is True isMM(num) is True isMM(num) isMM num True isMM(ber) is True isMM(ber) isMM ber True return "AMBIGUOUS" "AMBIGUOUS" elif isMM(num) is True and isMM(ber) is False:
        return "MMYY"
     isMM(num) is True and isMM(ber) is False isMM(num) is True isMM(num) isMM num True isMM(ber) is False isMM(ber) isMM ber False return "MMYY" "MMYY" return "YYMM" "YYMM" number number num = int(input()) num int(input()) int input() input print(hantei(num)) print hantei(num) hantei num num = int(input()) int(input()) num def isMM(num):
    if num < 13 and num > 0:
        return True
    else:
        return False def isMM(num):
    if num < 13 and num > 0:
        return True
    else:
        return False isMM def hantei(number):
    num = math.floor(number/100)
    ber = number % 100
    if isMM(num) is False and isMM(ber) is False:
        return "NA"
    elif isMM(num) is True and isMM(ber) is True:
        return "AMBIGUOUS"
    elif isMM(num) is True and isMM(ber) is False:
        return "MMYY"
    else:
        return "YYMM" def hantei(number):
    num = math.floor(number/100)
    ber = number % 100
    if isMM(num) is False and isMM(ber) is False:
        return "NA"
    elif isMM(num) is True and isMM(ber) is True:
        return "AMBIGUOUS"
    elif isMM(num) is True and isMM(ber) is False:
        return "MMYY"
    else:
        return "YYMM" hantei
import math


def isMM(num):
    if num < 13 and num > 0:
        return True
    else:
        return False


def hantei(number):
    num = math.floor(number/100)
    ber = number % 100
    if isMM(num) is False and isMM(ber) is False:
        return "NA"
    elif isMM(num) is True and isMM(ber) is True:
        return "AMBIGUOUS"
    elif isMM(num) is True and isMM(ber) is False:
        return "MMYY"
    else:
        return "YYMM"


num = int(input())
print(hantei(num))
