Problem:


Score : 200 points

Problem Statement

You have a digit sequence S of length 4. You are wondering which of the following formats S is in:

YYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order

MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order

If S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.

Constraints

S is a digit sequence of length 4.

Input

Input is given from Standard Input in the following format:

S

Output

Print the specified string: YYMM, MMYY, AMBIGUOUS or NA.

Sample Input 1

1905

Sample Output 1

YYMM

May XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.

Sample Input 2

0112

Sample Output 2

AMBIGUOUS

Both December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.

Sample Input 3

1700

Sample Output 3

NA

Neither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.



Sample input:
1905


Sample output:
YYMM

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[0:2])
b=int(s[2:])
if 1<=a<=99 and 1<=b<=31:
    if 1<=a<=12 and 1<=b<=12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif 1<=b<=99 and 1<=a<=31:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
if 1 <=int(s[0:2]) <= 12 and 1<= int(s[2:4]) <= 12:
    print("AMBIGUOUS")
elif (int(s[0:2]) == 0 or 13 <=int(s[0:2]) <= 99) and 1<= int(s[2:4]) <= 12:
    print("YYMM")
elif (int(s[2:4]) == 0 or 13 <=int(s[0:2]) <= 99) and 1<= int(s[0:2]) <= 12:
    print("MMYY")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
if 1 <=int(s[0:2]) <= 12 and 1<= int(s[2:4]) <= 12:
    print("AMBIGUOUS")
elif 13 <=int(s[0:2]) <= 99 and 1<= int(s[2:4]) <= 12:
    print("YYMM")
elif 13 <=int(s[2:4]) <= 99 and 1<= int(s[0:2]) <= 12:
    print("MMYY")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
if 0 <=int(s[0:2]) <= 12 and 1<= int(s[2:4]) <= 12:
    print("AMBIGUOUS")
elif 13 <=int(s[0:2]) <= 99 and 1<= int(s[2:4]) <= 12:
    print("YYMM")
elif 13 <=int(s[2:4]) <= 99 and 1<= int(s[0:2]) <= 12:
    print("MMYY")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2])
b = int(s[2:])
if a>0 and a<=12 and b>0 and b<=12:
    print('AMBIGUOUS')
elif a == 0 or a > 12 and b>0 and b<=12:
    print('YYMM')
elif b == 0 or b > 12 and a>0 and a<=12:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2])
b = int(s[2:])
if a>0 and a<=12 and b>0 and b<=12:
    print('AMBIGUOUS')
elif a > 12 and b>0 and b<=12:
    print('YYMM')
elif b > 12 and a>0 and a<=12:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    a = S[0:2]
    b = S[2:4]

    if (int(a) >= 13 and int(b) >= 13) or (a == "00" and b == "00"):
        ans = "NA"
    elif (int(a) >= 13 and b == "00") or (int(b) >= 13 and a == "00"):
        ans = "NA"
    elif int(a) >= 13:
        ans = "YYMM"
    elif int(b) >= 13:
        ans = "MMYY"
    else:
        ans = "AMBIGUOUS"
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    a = S[0:2]
    b = S[2:4]
    if (int(a) >= 13 and int(b) >= 13) or (int(a) >= 13 and b == "00") or (int(b) >= 13 and a == "00"):
        ans = "NA"
    elif int(a) >= 13:
        ans = "YYMM"
    elif int(b) >= 13:
        ans = "MMYY"
    else:
        ans = "AMBIGUOUS"
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    a = S[0:2]
    b = S[2:4]
    if (a == "00" or b == "00") or (int(a) >= 13 and int(b) >= 13):
        ans = "NA"
    elif int(a) >= 13:
        ans = "YYMM"
    elif int(b) >= 13:
        ans = "MMYY"
    else:
        ans = "AMBIGUOUS"
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0:2])
b = int(s[2:4])
if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")
elif (a == 0 or a > 12) and 0 < b <= 12:
    print("YYMM")
elif (b == 0 or b > 12) and 0 < a <= 12:
    print("MMYY")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0:2])
b = int(s[2:4])
if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")
elif (a > 12 and (b > 12 or b == 0)) or (b > 12 and (a > 12 or a == 0)):
    print("NA")
elif a > 12:
    print("YYMM")
elif b > 12:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0:2])
b = int(s[2:4])
if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")
elif (a > 12 and b > 12) or a == 0 or b == 0:
    print("NA")
elif a > 12:
    print("YYMM")
elif b > 12:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0:2])
b = int(s[2:4])
if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")
elif (a > 12 and b > 12) or a == 0 or b == 0:
    print("NA")
elif a > 12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0:2])
b = int(s[2:4])
if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")
elif a > 12 and b > 12 or a == 0 or b == 0:
    print("NA")
elif a > 12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
S = list(input())
before = int(S[0] + S[1])
after = int(S[2] + S[3])

if before == 0 or before > 12:
    if after >= 1 and after <= 12:
        print('YYMM')
    else:
        print('NA')
else:
    if after >= 1 and after <= 12:
        print('AMBIGUOS')
    else:
        print('MMYY')

Submission status: Wrong Answer

Solution code:
s=int(input())
a=s//100
b=s-a
if a<13 and b<13 and a>0 and b>0:
    print("AMBIGUOUS")
elif a<13 and a>0:
    print("MMYY")
elif b<13 and b>0:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
AA = int(S[:2]) 
BB = int(S[2:])
if (1 <= AA <= 12) and (1 <= BB <= 12):
    print('AMBIGUOUS')
elif (13 <= AA) and (1 <= BB <= 12):
    print('YYMM')
elif (1 <= AA <= 12) and (13 <= BB):
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

if int(S[:2]) > 12 and int(S[2:]) == 0:
    print("NA")
elif int(S[2:]) > 12 and int(S[:2]) == 0:
    porint("NA")
elif int(S[2:]) > 12 and int(S[:2]) > 12:
    print("NA")
elif int(S[:2]) == int(S[2:]) == 0:
    print("NA")
elif int(S[:2]) > 12:
    print("YYMM")
elif int(S[2:]) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()

if int(S[:2]) > 12 and int(S[2:]) == 0:
    print("NA")
elif int(S[2:]) > 12 and int(S[:2]) == 0:
    porint("NA")
elif int(S[:2]) > 12:
    print("YYMM")
elif int(S[2:]) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
left = S[:2]
right = S[2:]

if "01" <= left <= "12" and "01" <= right <= "12":
    print("AMBIGUOUS")
elif "01" <= left <= "12":
    if "01" <= right <= "99":
        print("MMYY")
    else:
        print("NA")
elif "01" <= right <= "12":
    if "01" <= left <= "99":
        print("YYMM")
    else:
        print("NA")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[:2])
s2=int(s[2:])

if s1<=12 & s1>=1:
  if s2<=12 & s2>=1:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if s2<=12 & s2>=1:
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

Solution code:
#B
s = input()
print(int(s[0:2]), int(s[2:4]))
if 1 <= int(s[0:2]) <= 12 and 1 <= int(s[2:4]) <= 12:
    print('AMBIGUOUS')
elif 1 <= int(s[0:2]) <= 12:
    print('MMYY')
elif 1 <= int(s[2:4]) <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=list(input())
a=int("".join(s[:2]))
b=int("".join(s[2:]))
print("NA" if a == 0 or b == 0 else 
      "NA" if a >= 13 and b >= 13 else 
      "YYMM" if a > 12 else 
      "MMYY" if b > 12 else 
      "AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s=list(input())
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
print("NA" if a==0 or b==0 else 
      "NA" if a >= 13 and b >= 13 else 
      "YYMM" if a > 12 else 
      "MMYY" if b > 12 else 
      "AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = list(input())
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
print("NA" if a==0 or b==0 else "NA" if a > 12 and b > 12 else "YYMM" if a > 12 else "MMYY" if b > 12 else "AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = list(input())
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
print("NA" if a==0 or b==0 else 
      "NA" if a > 12 and b > 12 else 
      "YYMM" if a > 12 else 
      "MMYY" if b > 12 else 
      "AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = list(input())
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
print("NA" if a==0 or b==0 else 
      "NA2" if a > 12 and b > 12 else 
      "YYMM" if a > 12 else 
      "MMYY" if b > 12 else 
      "AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
def yymm_or_mmyy(s):

    ans = ""
    flag1 = False
    flag2 = False

    for i in range(1, 13):
        if s[0:2] == str(i).zfill(2):
            flag1 = True
        elif s[2:4] == str(i).zfill(2):
            flag2 = True

    if flag1 and flag2:
        ans = "AMBIGUOUS"
    elif flag1:
        ans = "MMYY"
    elif flag2:
        ans = "YYMM"
    else:
        ans = "NA"

    return ans

def main():
    s = str(input())
    print(yymm_or_mmyy(s))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = list(input())
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
print("NA" if a==0 or b==0 else "NA" if a and b > 12 else "YYMM" if a > 12 else "MMYY" if b > 12 else "AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = list(input())

head = int("".join(S[:2]))
tale = int("".join(S[2:]))

if 1 <= head <= 12:
    print("AMBIGUOUS")
elif 1 <= tale <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())

head = int("".join(S[:2]))
tale = int("".join(S[2:]))

if 0 == head or head > 12:
    # YYMM
    if 0 == tale or tale > 12:
        print("NA")
    else:
        print("YYMM")

elif 0 == tale or tale > 12:
    print("AMBIGUOUS")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
N = list(input())
if 1 <= int(N[0]+N[1]) <=12 and 1 <= int(N[2]+N[3]) <= 12:
  print('AMBIGUOUS')
elif 1 <= int(N[0]+N[1]) <=12 and 12<int(N[2]+N[3])<1:
  print('MMYY')
elif 12<int(N[0]+N[1])<1 and 1 <= int(N[2]+N[3]) <=12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
N = list(input())
if 1 <= int(N[0]+N[1]) <=12 and 1 <= int(N[2]+N[3]) <=12:
  print('AMBIGUOUS')
elif 1 <= int(N[0]+N[1]) <=12 and 13 <= int(N[2]+N[3]):
  print('MMYY')
elif 13 <= int(N[0]+N[1]) and 1 <= int(N[2]+N[3]) <=12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
l = s[0]+s[1]
r = s[2]+s[3]
mm = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
zero = ['00']
if l == zero or r == zero:
    print('NA')
elif mm.count(l) == 1 and mm.count(r) == 1:
    print('AMBIGIUOUS')
elif mm.count(l) == 1 and mm.count(r) != 1:
    print('MMYY')
elif mm.count(l) != 1 and mm.count(r) == 1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
l = s[0]+s[1]
r = s[2]+s[3]
mm = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
if mm.count(l) == 1 and mm.count(r) == 1:
    print('AMBIGIUOUS')
elif mm.count(l) == 1 and mm.count(r) != 1:
    print('MMYY')
elif mm.count(l) != 1 and mm.count(r) == 1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
head = int(s[0])*10 + int(s[1])
back = int(s[2])*10 + int(s[3])
if(1 <= head and head <= 12 and 1 <= back and back <= 12):
    print('AMBIGUOUS')
elif(1 <= head and 1 <= back and back <= 12):
    print('YYMM')
elif 1 <= back and 1 <= head and head <= 12:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

a = int(s[:2])
b = int(s[2:])

if 0 < a and a <= 12 and 0 < b and b <= 12:
  print("AMBIGUOUS")
elif a > 12 and 0 < b and b <= 12:
  print("YYMM")
elif 0 < a and a <= 12 and b > 12:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

a = int(s[:2])
b = int(s[2:])
if 0 < a <= 12 and 0 < b <= 12:
  print("AMBIGUOUS")
elif a > 12 and 0 < b <= 12:
  print("YYMM")
elif 0 < a <= 12 and b > 12:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

a = int(s[:2])
b = int(s[2:])
if 0 < a <= 12 and 0 < b <= 12:
  print("AMBIGUOUS")
elif a > 12 or a != 0 and b > 12 or b == 0:
  print("NA")
elif a > 12 and 0 < b <= 12:
  print("YYMM")
elif 0 < a <= 12 and b > 12:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
n=input()

m=n[0]+n[1]

o=n[2]+n[3]

x=int(m)
y=int(o)

if x>0 and x<13 and y>0 and y<13:
    print("AMBIGUOUS")

elif (x<13 and x>0) and (y>12):
    print("MMYY")
elif (x>12) and (y<13 and y>0):
    print("YYMM")

elif x==0 or y==0:
    print("NA")

Submission status: Wrong Answer

Solution code:
n=input()

m=n[0]+n[1]

o=n[2]+n[3]

x=int(m)
y=int(o)

if x>0 and x<13 and y>0 and y<13:
    print("AMBIGUOUS")

elif (x<13 and x>0) and (y>12 or y==0):
    print("MMYY")
elif (x>12 or x==0) and (y<13 and y>0):
    print("YYMM")

elif x==0 or y==0:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
A = int(S[0:2])
B = int(S[2:])

if (A<=12 and B>=13 and A>0):#A is between 0-12 and B is not month (=year)
    strFormat = "MMYY"
elif (A>=13 and B<=12 and B>0):#B is between 0-12 and B is not month(=year)
    strFormat = "YYMM"
elif (A<=12 and B<=12 and A>0 and B>0):#both are between 1-12
    strFormat = "AMBIGUOUS"
else:
    strFormat = "NA"

print(strFormat)

Submission status: Wrong Answer

Solution code:
s = input()

if '00' in s:
    print('NA')
elif int(s[:2]) <= 12 and int(s[2:]) <= 12:
    print('AMBIGUOUS')
elif int(s[2:]) < 13:
    print('YYMM')
elif int(s[:2]) < 13:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

if '00' in s:
    print('NA')
elif int(s[:2]) <= 12 and int(s[2:]) <= 12:
    print('AMBIGUOUS')
elif int(s[2:]) > 13:
    print('MMYY')
elif int(s[:2]) > 13:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

if int(s[:2]) <= 12 and int(s[2:]) <= 12:
    print('AMBIGUOUS')
elif int(s[2:]) > 13 and s[:2] != '00':
    print('MMYY')
elif int(s[:2]) > 13 and s[2:] != '00':
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = str (input())
bflag = True
lflag = True
if not(s[0] + s[1] in ['01','02','03','04','05','06','07','08','09','10','11','12']):
    bflag = False
if not(s[2] + s[3] in ['01','02','03','04','05','06','07','08','09','10','11','12']):
    lflag = False
if bflag:
    if lflag:
        print('ANBIGUOUS')
    else:
        print('MMYY')
else:
    if lflag:
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s = [int(s[:2]),int(s[2:])]

l = ['', '']
for i in range(2):
    if (s[i] == 0):
        print('NA')
        break
    elif (1 <= s[i] <= 12):
        l[i] = 'MM'
    else:
        l[i] = 'YY'
else:
    if (l.count('MM') == 2):
        print('AMBIGUOUS')
    elif (l.count('MM') == 1):
        print(l[0]+l[1]) 
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s = [int(s[:2]),int(s[2:])]

l = ['', '']
for i in range(2):
    if (s[i] == 0):
        print('NA')
        break
    elif (1 <= s[i] <= 12):
        l[i] = 'MM'
    else:
        l[i] = 'YY'
else:
    if (l.count('MM') == 2):
        print('AMBIGUOUS')
    else:
        print(l[0]+l[1])

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[:2])
b=int(s[2:])
if 1<=a<=12 and 1<=b<=12:
	print("AMBIGUOUS")
elif 1<=a<=12 and 12<b:
	print("MMYY")
elif 12<a and 1<=b<=12:
	print("YYMM")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[:2])
b=int(s[2:])
if (a==0 or b==0) or (a>12 and b>12):
	print("NA")
elif a<13 and b<13:
	print("AMBIGUOUS")
elif a<13:
	print("MMYY")
elif b<13:
	print("YYMM")

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[:2])
b=int(s[2:])
if a>0 and a<13:
	if b>0 and b<13:
		print("AMBIGUOUS")
	elif b!=0:
		print("MMYY")
	else:
		print("NA")
elif a!=0:
	if b>0 and b<13:
		print("YYMM")
	else:
		print("NA")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[:2])
b=int(s[2:])
if a>0 and a<13:
	if b>0 and b<13:
		print("AMBIGUOUS")
	elif b!=0:
		print("MMYY")
	else:
		print("NA")
elif a!=0:
	if b>0 and b<13:
		print("YYMM")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
YY = int(S[0:2])
MM = int(S[2: ])

if YY <= 12 and MM <= 12 and MM > 0:
  print("AMBIGUOUS")
elif YY <= 12 and YY > 0 and MM >= 13:
  print("MMYY")
elif YY >= 13 and MM <= 12 and MM > 0:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
YY = int(S[0:2])
MM = int(S[2: ])

if YY <= 12 and MM <= 12 and MM > 0:
  print("AMBIGUOUS")
elif YY <= 12 and MM >= 13:
  print("MMYY")
elif YY >= 13 and MM <= 12 and MM > 0:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
n = input()
a = int(n[:2])
b = int(n[2:])

if 0 < a <= 12 and  b > 12:
    print('MMYY')
elif a > 12 and 0 < b <= 12:
    print('YYMM')
elif 0 < a <= 12 and 0 < b <= 12:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import sys
import math
from collections import Counter
import itertools
#from functools import reduce

# 入力を整数に変換して受け取る
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'

# リストを改行区切りで出力する
p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")

# ###########################################

S=SR()
ym=0
my=0
if int(S[:2]) > 0 and  int(S[2:]) >0 and int(S[2:]) <13:
    ym=1
if int(S[2:]) > 0 and  int(S[:2]) >0 and int(S[:2]) <13:
    my=1

if ym==1 and my==1:
    print('AMBIGUOUS')
elif ym==1 and my==0:
    print('YYMM')
elif ym==0 and my==1:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
mae=s[0]+s[1]
ato=s[2]+s[3]
if int(mae)<=12 and int(ato)<=12:
  print("AMBIGUOUS")
elif int(mae)<=12:
  print("MMYY")
elif int(ato)<=12:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
S = [int(s) for s in S]
yymm = 0
mmyy = 0

if (S[0] == 0 and 1 <= S[1] <= 9) or (1 <= S[0] and 0 <= S[1] <= 9):
    if (S[2] == 0 and 1 <= S[3] <= 9) or (1 == S[2] and 0 <= S[3] <= 2):
        yymm = 1
if (S[0] == 0 and 1 <= S[1] <= 9) or (1 == S[0] and 0 <= S[1] <= 2):
    if (S[2] == 0 and 1 <= S[3] <= 9) or (1 <= S[2] and 0 <= S[3] <= 9):
        mmyy = 1

if yymm == mmyy == 1:
    print("AMBIGUOUS")
elif yymm == mmyy:
    print("NA")
elif yymm == 1:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
S = input()
S = [int(s) for s in S]
yymm = 0
mmyy = 0

if (S[0] == 0 and 1 <= S[1] <= 9) or (1 <= S[0] and 0 <= S[1] <= 9):
    if (S[2] == 0 and 1 <= S[3] <= 9) or (1 <= S[2] and 0 <= S[3] <= 2):
        yymm = 1
if (S[0] == 0 and 1 <= S[1] <= 9) or (1 <= S[0] and 0 <= S[1] <= 2):
    if (S[2] == 0 and 1 <= S[3] <= 9) or (1 <= S[2] and 0 <= S[3] <= 9):
        mmyy = 1

if yymm == mmyy == 1:
    print("AMBIGUOUS")
elif yymm == mmyy:
    print("NA")
elif yymm == 1:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
a,b,c,d=input()
x=int(a+b)
y=int(c+d)
if 0<=x<=12 and 1<=y<=12:
  print('AMBIGUOUS')
elif 1<=x<=12 and 0<=y<=12:
  print('AMBIGUOUS')
elif 0<=x<=99 and 1<=y<=12:
  print('YYMM')
elif 1<=x<=12 and 0<=y<=99:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2])
b = int(s[3:])

if 0 < a <= 12:
    if 0 < b <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 0 < b <= 12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
a,b,c,d=map(int,input())
x=int(a+b)
y=int(c+d)
if 0<=x<=12 and 0<=b<=12:
  if x==y==0:
    print('NA')
  else:
    print('AMBIGUOUS')
elif 0<=x<=99 and 1<=y<=12:
  print('YYMM')
elif 1<=x<=12 and 0<=y<=99:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = [0]*2
if int(s[:2]) > 12:
    if int(s[3:]) == 0:
        print("NA")
    elif 0 < int(s[3:]) <= 12:
        print("YYMM")
    else:
        print("NA")
elif 0 < int(s[:2]) <= 12:
    if int(s[3:]) == 0:
        print("MMYY")
    elif 0 < int(s[3:]) <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if int(s[3:]) == 0:
        print("NA")
    elif 0 < int(s[3:]) <= 12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

mae = int(S[:3])
ato = int(S[3:])

if 1 <= mae <= 12 and 1 <= ato <= 12:
  print("AMBIGUOUS")
elif 1 <= ato <= 12:
  print("YYMM")
elif 1 <= mae <= 12:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = str(input())

S1 = S[0:2]
S2 = S[2:4]

if 1 <= int(S1) <= 12:
    if 1 <= int(S2) <= 12:
        print('AMBIGOUS')
        exit()
    else:
        print('MMYY')
        exit()

if 1 <= int(S2) <= 12:
    if 1 <= int(S1) <= 12:
        print('AMBIGOUS')
        exit()
    else:
        print('YYMM')
        exit()

print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())

S1 = S[0:2]
S2 = S[2:4]

if 1 <= int(S1) <= 12:
    if 1 <= int(S2) <= 12:
        print('AMBIGOUS')
        exit()
    else:
        print('MMYY')
        exit()
elif 1 <= int(S2) <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

s1 = int(s[0:2])
s2 = int(s[2:4])

if s1 == 0 or s2 ==0:
  print("NA")
  
elif s1>12 and s2>12:
  print("NA")

elif s1>12 and s2<=12:
  print("YYMM")

elif s1<=12 and s2>12:
  print("MMYY")
  
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
if s1 == s2 == 0:
    print('NA')
elif s1 <= 12 and s2 <= 12 and s1 >= 1 and s2 >= 1:
    print('AMBIGUOUS')
elif s1 <= 12 and s1 >= 0:
    print('MMYY')
elif s2 <= 12 and s2 >= 0:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
if s1 == s2 == 0:
    print('NA')
elif s1 <= 12 and s2 <= 12:
    print('AMBIGUOUS')
elif s1 <= 12:
    print('MMYY')
elif s2 <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
if s1 == s2 == 0:
    print('NA')
elif s1 <= 12:
    if s2 <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif s2 <= 12:
    if s1 <= 12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
if s1 == s2 == 0:
    print('NA')
elif s1 <= 12:
    if s2 <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif s2 <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
if s1 <= 12:
    if s2 <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif s2 <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
first = int(s[:2])
second =int(s[2:])

if (first > 0 and first < 13) and (second > 0 and second < 13):
    print("AMBIGUOUS")
elif (first > 0 and first < 13) and (second > 12):
    print("MMYY")
elif (first > 12) and (second > 0 and second < 13):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = int(input())

A = S//100
B = S%100

if A >= 13 or A == 0:
    if B >= 13:
        print('NA')
    elif B <13:
        if B != 0:
            print('YYMM') 
        else:
            print('NA')
elif A < 13:
    if B >= 13:
        if A != 0:
            print('MMYY')
        else:
            print('NA')
    elif B < 13:
        if B != 0 and A != 0:
            print('AMBIGUOUS')
        else:
            print('NA')

Submission status: Wrong Answer

Solution code:
S = int(input())

A = S//100
B = S%100

if A >= 13:
    if B >= 13:
        print('NA')
    elif B <13:
        if B != 0:
            print('YYMM') 
        else:
            print('NA')
elif A < 13:
    if B >= 13:
        if A != 0:
            print('MMYY')
        else:
            print('NA')
    elif B < 13:
        if B != 0 and A != 0:
            print('AMBIGUOUS')
        else:
            print('NA')

Submission status: Wrong Answer

Solution code:
S = int(input())

A = S//100
B = S%100

if A >= 13:
    if B >= 13:
        print('NA')
    elif B <13:
        if B != 0:
            print('YYMM') 
        else:
            print('NA')
elif A < 13:
    if B >= 13:
        if A != 0:
            print('MMYY')
        else:
            print('NA')
    elif B < 13:
        if B != 0:
            print('AMBIGUOUS')
        else:
            print('NA')

Submission status: Wrong Answer

Solution code:
S = int(input())

A = S//100
B = S%100

if A >= 13:
    if B >= 13:
        print('NA')
    elif B <13:
        if B != 0:
            print('YYMM') 
        else:
            print('NA')
elif A < 13:
    if B >= 13:
        if A != 0:
            print('MMYY')
        else:
            print('NA')
    elif B < 13:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = int(input())

A = S//100
B = S%100

if A >= 13:
    if B >= 13:
        print('NA')
    elif B <13:
        print('YYMM') 
elif A < 13:
    if B >= 13:
        print('MMYY')
    elif B < 13:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[0] + s[1])
b = int(s[2] + s[3])
if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")
elif 0 < a <= 12 and b > 12:
    print("MMYY")
elif a > 12 and 0 < b <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
s01 = int(S[0]+S[1])
s23 = int(S[2]+S[3])
if (0 < s01 and s01 <= 12) and (0 < s23 and s23 <= 12):
    print('AMBIGUOUS')

elif (0 < s01 and s01 <= 12) and (s23 > 12 or s23 == 0):
    print('MMYY')

elif (s01 > 12 or s23 == 0) and (0 < s23 and s23 <= 12):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
s01 = int(S[0]+S[1])
s23 = int(S[2]+S[3])
if (0 < s01 and s01 <= 12) and (0 < s23 and s23 <= 12):
    print('AMBIGUOUS')

elif (0 < s01 and s01 <= 12) and s23 > 12:
    print('MMYY')

elif s01 > 12 and (0 < s23 and s23 <= 12):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
if 0 < int(S[0]+S[1]) and int(S[0]+S[1]) <= 12 and 0 < int(S[2]+S[3]) and int(S[2]+S[3]) <= 12:
    print('AMBIGUOUS')

elif 0 < int(S[0]+S[1]) and int(S[0]+S[1]) <= 12 and int(S[2]+S[3]) >12:
    print('MMYY')

elif int(S[0]+S[1]) > 12 and 0 < int(S[2]+S[3]) and int(S[2]+S[3]) <= 12:
    print('YYMM')

else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
if int(S[0]+S[1]) <= 12 and int(S[2]+S[3]) <= 12:
    print('AMBIGUOUS')

elif 0 < int(S[0]+S[1]) and int(S[0]+S[1]) <= 12 and int(S[2]+S[3]) >12:
    print('MMYY')

elif int(S[0]+S[1]) > 12 and 0 < int(S[2]+S[3]) and int(S[2]+S[3]) <= 12:
    print('YYMM')

else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
f = int(S[:2])
e = int(S[2:])
if 1 <= f <= 12 and e > 12:
    print('MMYY')
elif f > 12 and 1 <= e <= 12:
    print('YYMM')
elif 1 <= f <= 12 and 1 <= e <= 12:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

if int(s[0]+s[1]) == 0 or int(s[2]+s[3])==0:
    print("NA")
elif 13 > int(s[0]+s[1]) >=1 and 13 > int(s[2]+s[3]) >=1:
    print("AMBIGUOUS")

elif 1 <= int(s[0]+s[1]) and 13> int(s[2]+s[3]):
    print("YYMM")

else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
YYMM, MMYY, ova = False, False, False

if(1 <= int(s[:2]) <= 12):
    MMYY = True
if(1 <= int(s[3:]) <= 12):
    YYMM = True

if(MMYY and YYMM):
    ova = True

if(ova):
    print('AMBIGUOUS')
elif(MMYY):
    print("MMYY")
elif(YYMM):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
YYMM, MMYY, ova = False, False, False

if(1 <= int(s[:2]) <= 12 and int(s[3:]) != 0):
    MMYY = True
if(1 <= int(s[3:]) <= 12 and int(s[:2]) != 0):
    YYMM = True

if(MMYY and YYMM):
    ova = True

if(ova):
    print('AMBIGUOUS')
elif(MMYY):
    print("MMYY")
elif(YYMM):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
YYMM, MMYY, ova = False, False, False

if(1 <= int(s[:2]) <= 12 and int(s[3:]) != 0):
    MMYY = True
if(1 <= int(s[3:]) <= 12 and int(s[:2]) != 0):
    YYMM = True

if(MMYY and YYMM):
    ova = True

if(ova):
    print('AMBIGUOUS')
elif(MMYY):
    print("MMYY")
elif(YYMM):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
text=input()
a=int(text)
f=a/100
f=int(f)
l=int(text[2:])
s=0
if( f >0 and f<=12 and l>12):
    print('MMYY')

elif (l>0 and l<=12 and f>12):
    print('YYMM')
    exit
elif( ( f >0 and f<=12 and l>=0) or (l>0 and l<=12 and f>=0)):
    print('AMBIGUOUS')
    exit
elif( f<12 and l<12):
    print('NA')
    exit

Submission status: Wrong Answer

Solution code:
text=input()
a=int(text)
f=a/100
f=int(f)
l=int(text[2:])
s=0
if( f >0 and f<=12 and l>12):
    print('MMYY')
if (l>0 and l<=12 and f>12):
    print('YYMM')
if( ( f >0 and f<=12 and l>=0) or (l>0 and l<=12 and f>=0)):
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
S1 = int(S[:2])
S2 = int(S[2:])

if S1 > 12 and 1<= S2 <= 12:
    print('YYMM')
elif 1<= S1 <= 12 and S2 > 12:
    print('MMYY')
elif 1<= S1 <= 12 and 1<= S2 <= 12:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
S1 = int(S[:2])
S2 = int(S[2:])

if S1 == 0 or S2 == 0:
    print('NA')
elif S1 <= 12 and S2 <= 12:
    print('AMBIGUOUS')
elif S1 > 12 and S2 <= 12:
    print('YYMM')
elif S1 <= 12 and S2 > 12:
    print('MMYY')