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()
if 13 <= int(s[0:3:]) :
    if 1 <= int(s[2::]) <= 12:
        print('YYMM')
    else:
        print('NA')
elif 1 <= int(s[0:3:]) <= 12:
    if  13 <= int(s[2::]) or int(s[2::]) == 0 :
        print('MMYY')
    else:
        print('AMBIGUOUS')
elif int(s[0:3:]) == 0:
    if 1 <= int(s[2::]) <= 12:
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
if 13 <= int(s[0:3:]) :
  if 1 <= int(s[2::]) <= 12:
    print('YYMM')
  else:
    print('NA')
elif 1 <= int(s[0:3:]) <= 12:
  if  13 <= int(s[2::]) or int(s[2::]) == 0 :
    print('MMYY')
  else:
    print('AMBGIOUS')
elif int(s[0:3:]) == 0:
  if 1 <= int(s[2::]) <= 12:
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
s_1 = int(s[:2])
s_2 = int(s[2:])
if 0<s_1<=12 and s_2>12:
    print("MMYY")
elif s_1>12 and 0<s_2<=12:
    print("YYMM")
elif s_1<=12 and s_2<=12 and min(s_1,s_2)>0:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if 1 <= s1 <= 12 and 1 <= s2 <= 12:
    print("AMBIGUOUS")

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

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

else:
    print("NA")

Submission status: Wrong Answer

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

if 1 <= s1 <= 12 and 1 <= s2 <= 12:
    print("AMBIGUOUS")

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

elif s2 > 12 and s1 != 0:
    print("MMYY")

else:
    print("NA")

Submission status: Wrong Answer

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

if 1 <= s1 <= 12 and 1 <= s2 <= 12:
    print("AMBIGUOUS")

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

elif s2 >= 12 and s1 != 0:
    print("MMYY")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
a = input()

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

Submission status: Wrong Answer

Solution code:
a = input()

if 1 <= int(a[:2]) <= 12 and 1 <= int(a[2:]) <= 12:
    print("AMBIGUOUS")
elif 1 <= int(a[:2]) <= 12 or 1 <= int(a[2:]) <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import re
s = input()
f = s[:2]
l = s[2:]
year_flg = 0
month_flg = 0
if int(l) == 0:
    print('NA')
    exit()
if re.match('^(0\d|1(0|1|2))$', l):
    if int(l) != 0:
        year_flg = 1
if re.match('^(0\d|1(0|1|2))$', f):
    if int(f) != 0:
        month_flg = 1
if year_flg == 1:
    if month_flg == 1:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif month_flg == 1:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import re
s = input()
f = s[:2]
l = s[2:]
year_flg = 0
month_flg = 0
if int(l) == 0:
    print('NA')
    exit()
if re.match('^(0\d|1(0|1|2))$', l):
    year_flg = 1
if re.match('^(0\d|1(0|1|2))$', f):
    month_flg = 1
if year_flg == 1:
    if month_flg == 1:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif month_flg == 1:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import re
s = input()
f = s[:2]
l = s[2:]
year_flg = 0
month_flg = 0
if int(l) == 0:
    print('NA')
    exit()
if re.match('^(0\d|1(0|1|2))$', l):
    year_flg = 1
if re.match('^(0\d|1(0|1|2))$', f):
    if int(f) != 0:
        if re.match('^((0|1|2)\d|3(0|1))$', l):
            month_flg = 1
if year_flg == 1:
    if month_flg == 1:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif month_flg == 1:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import re
s = input()
f = s[:2]
l = s[2:]
year_flg = 0
month_flg = 0
if int(l) == 0:
    print('NA')
    exit()
if re.match('^(0\d|1(0|1|2))$', l):
    year_flg = 1
if re.match('^(0\d|1(0|1|2))$', f):
    if int(f) != 0:
        if int(f) in [4, 6, 9, 11]:
            if re.match('^((0|1|2)\d|30)$', l):
                month_flg = 1
        elif int(f == 2):
            if re.match('^(0|1|2)\d$', l):
                month_flg = 1
        else:
            if re.match('^((0|1|2)\d|3(0|1))$', l):
                month_flg = 1
if year_flg == 1:
    if month_flg == 1:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif month_flg == 1:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import re
s = input()
f = s[:2]
l = s[2:]
year_flg = 0
month_flg = 0
if int(l) == 0:
    print('NA')
    exit()
if re.match('^(0\d|1(0|1|2))$', l):
    year_flg = 1
if re.match('^(0\d|1(0|1|2))$', f):
    if int(f) in [4, 6, 9, 11]:
        if re.match('^((0|1|2)\d|30)$', l):
            month_flg = 1
    elif int(f == 2):
        if re.match('^(0|1|2)\d$', l):
            month_flg = 1
    else:
        if re.match('^((0|1|2)\d|3(0|1))$', l):
            month_flg = 1
if year_flg == 1:
    if month_flg == 1:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif month_flg == 1:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import re
s = input()
f = s[:2]
l = s[2:]
year_flg = 0
month_flg = 0
if int(l) == 0:
    print('NA')
    exit()
if re.match('^(0\d|1(0|1|2))$', l):
    year_flg = 1
if re.match('^(0\d|1(0|1|2))$', f):
    if int(f) in [4, 6, 9, 11]:
        if re.match('^((0|1|2)\d|30)$', l):
            month_flg = 1
    elif int(f == 2):
        if re.match('^(0|1|2)\d$', l):
            month_flg = 1
    else:
        if re.match('^((0|1|2)\d|3(0|1))$', l):
            month_flg = 1
if year_flg == 1:
    if month_flg == 1:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif month_flg == 1:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
s = list(map(int, input()))
l = int(str(s[0]) + str(s[1]))
u = int(str(s[2]) + str(s[3]))

if (12 < l or l == 0) and 12 >= u:
    print("YYMM")
elif (12 < u or u == 0) and 12 >= l:
    print("MMYY")
elif (12 >= u and 12 >= l) or (u != 0 and l != 0):
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = list(map(int, input()))
l = int(str(s[0]) + str(s[1]))
u = int(str(s[2]) + str(s[3]))

if 12 < l and 12 >= u:
    print("YYMM")
elif 12 < u and 12 >= l:
    print("MMYY")
elif 12 >= u and 12 >= l:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = list(map(int, input()))
l = int(str(s[0]) + str(s[1]))
u = int(str(s[2]) + str(s[3]))
if (l > 12 and u > 12) or (l > 12 and u == 0) or (u > 12 and l == 0) or (u == 0 and l == 0):
    print("NA")
elif 12 < l and 12 >= u:
    print("YYMM")
elif 12 < u and 12 >= l:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = list(map(int, input()))
l = int(str(s[0]) + str(s[1]))
u = int(str(s[2]) + str(s[3]))
if (l > 12 and u > 12) or (l > 12 and u == 0) or (u > 12 and l == 0):
    print("NA")
elif 12 < l and 12 >= u:
    print("YYMM")
elif 12 < u and 12 >= l:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = list(map(int, input()))
l = int(str(s[0]) + str(s[1]))
u = int(str(s[2]) + str(s[3]))
if (31 < l or 31 < u) or (12 < u and l == 0) or (12 < l and u == 0) or ((12 < u and u <= 31) and (12 < l and 31 <= l)):
    print("NA")
elif 12 < l and 12 >= u:
    print("YYMM")
elif 12 < u and 12 >= l:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = list(map(int, input()))
l = int(str(s[0]) + str(s[1]))
u = int(str(s[2]) + str(s[3]))
if (31 < l or 31 < u) or (12 < u and l == 0) or (12 < l and u == 0):
    print("NA")
elif 12 < l and 12 >= u:
    print("YYMM")
elif 12 < u and 12 >= l:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
L = int(S[:2])
R = int(S[2:])

if 0 < L <= 12:
    if 0 < R <= 12:
        print("AMBIGUOUS")
    elif 0 < R:
        print("MMYY")
    else:
        print("NA")

elif 0 < L:
    if 0 < R <= 12:
        print("YYMM")
    else:
        print("NA")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
a= int(input())
b = a//100
c = a%100
if(b>12 and c>12):
    print("NA")
elif(b>12):
    print("YYMM")
elif(c>12):
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
x=int(s[:2])
y=int(s[2:])
if 1<=x and x<=12:
    if 1<=y and y<=12:
        print('AMBIGUPUS')
    else:
        print('MMYY')
elif 1<=y and y<=12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())

s0=int(S[0])
s1=int(S[1])
s2=int(S[2])
s3=int(S[3])

firsthalf = s0*10+s1
latterhalf = s2*10+s3

if (firsthalf>12 or firsthalf==0) and latterhalf>12 or latterhalf==0:
    print("NA")
elif firsthalf<=12 and latterhalf>12 or latterhalf==0:
    print("MMYY")
elif firsthalf>12 or firsthalf==0 and latterhalf<=12:
    print("YYMM")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()

yymm = 0
mmyy = 0

kami2 = int(S[0]) * 10 + int(S[1])
simo2 = int(S[2]) * 10 + int(S[3])


if simo2 > 0 and simo2 <= 12:
    yymm=1
elif kami2 <= 12 and kami2 >0:
    mmyy=1


if yymm:

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

Submission status: Wrong Answer

Solution code:
S = input()

yymm = 0
mmyy = 0

kami2 = int(S[0]) * 10 + int(S[1])
simo2 = int(S[2]) * 10 + int(S[3])


if simo2 > 0 and simo2 <= 12:
    yymm=1
elif kami2 <= 12 and kami2 >0:
    mmyy=1


if yymm:

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

Submission status: Wrong Answer

Solution code:
S_mojiretsu = input() 

mm_list = []
for i in range(1, 10):
    mm_list.append('0{}'.format(i))
mm_list += ['10', '11', '12']

mae2moji = S_mojiretsu[:2]
usiro2moji = S_mojiretsu[2:]

flg = 0
if mae2moji == '00':
    None
elif usiro2moji == '00':
    None
else:
    if usiro2moji in mm_list:
        flg += 1
    if mae2moji in mm_list:
        flg += 2

if flg == 0:
    print('NA')
elif flg == 1:
    print('YYMM')
elif flg == 2:
    print('MMYY')
else:
    print('AMBIGUOUS')

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 (b ==00 or b>=13):
	print("MMYY")
elif a == 00 and (a>=13 or  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 1<= a <=12 and 1<=b<=12:
	print("AMBIGUOUS")
elif 1<=a<=12 and b ==00 and b>=13:
	print("MMYY")
elif a == 00 and a>=13 and 1<=b<=12:
	print("YYMM")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
#coding:utf-8

import sys

S = int(input())
S1 = int(S/100)
S2 = int(S-100*S1)

if (1 <= S1 <= 12) and (1 <= S2 <= 12):
    print("AMBIGUOUS")
    sys.exit()

if (S1 != 0) and (1 <= S2 <= 12):
    print("YYMM")
    sys.exit()

if (1 <= S1 <= 12) and (S2 != 0):
    print("MMYY")
    sys.exit()

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
A=input()
B=int(A[:2])
C=int(A[2:4])
if 1<=B<=12 and 1<=C<=12:
  print("AMBIGUOUS")
elif 12>=B>=1:
  print("MMYY")
elif B>12 and 12>=C>=1:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
A=input()
B=int(A[:2])
C=int(A[2:4])
if B<=12 and C<=12:
  print("AMBIGUOUS")
elif 12>=B>=1:
  print("YYMM")
elif 12>=C>=1:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A=input()
B=int(A[:2])
C=int(A[2:4])
if B<=12 and C<=12:
  print("AMBIGUOUS")
elif B>12 and C<=12:
  print("YYMM")
elif B<=12 and C>12:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
S_1 = S[:2]
S_2 = S[2:]
if int(S_1)*int(S_2) == 0:
    print("NA")
    exit()
if int(S_1)>=13:
    if int(S_2)>=13:print("NA")
    else:print("YYMM")
else:
    if int(S_2)>=13:print("MMYY")
    else:print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
S_1 = S[:2]
S_2 = S[2:]
if int(S_1)>=13:
    if int(S_2)>=13:print("NA")
    else:print("YYMM")
else:
    if int(S_2)>=13:print("MMYY")
    else:print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
st=input()
fi=int(st[:2])
se=int(st[2:])
if fi!=0 and 1<=se<=12:
  print("YYMM")
elif 1<=fi<=12 and se!=0:
  print("MMYY")
elif 1<=fi<=12 and 1<=se<=12:
  print("AMBIGUOUS")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
st=input()
fi=int(st[:2])
se=int(st[2:])
if fi>12 and 1<=se<=12:
  print("YYMM")
elif 1<=fi<=12 and se>12:
  print("MMYY")
elif 1<=fi<=12 and 1<=se<=12:
  print("AMBIGUOUS")
elif fi==0 or se==0:
  print("NA")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
st=input()
fi=int(st[:2])
se=int(st[2:])
if fi>12 and 1<=se<=12:
  print("YYMM")
elif 1<=fi<=12 and se>12:
  print("MMYY")
elif 1<=fi<=12 and 1<=se<=12:
  print("AMBIGUOUS")
elif fi==0 or se==0:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''

left = s[0:2]
right = s[2:]

if (right == '00' and int(left) > 12) or (left == '00' and int(right) > 12) or (int(left) > 12 and int(right) > 12):
    ans = 'NA'
elif int(right) <= 12 and right != '00':
    ans = 'YYMM'
elif int(left) <= 12 and left != '00':
    ans = 'MMYY'
elif right == '00' and left == '00':
    ans = 'NA'
else:
    ans = 'AMBIGUOUS'
    
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''

left = s[0:2]
right = s[2:]

if right == '00' and int(left) > 12 or left == '00' and int(right) > 12 or right == '00' and left == '00':
    ans = 'NA'
elif int(right) <= 12 and right != '00':
    ans = 'YYMM'
elif int(left) <= 12 and left != '00':
    ans = 'MMYY'
else:
    ans = 'AMBIGUOUS'
    
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''

left = s[0:2]
right = s[2:]

if right == '00' and int(left) > 12 or left == '00' and int(right) > 12:
    ans = 'NA'
elif int(left) > 12:
    ans = 'YYMM'
elif int(right) < 12:
    ans = 'MMYY'
else:
    ans = 'AMBIGUOUS'
    
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
start = s[:2]
end = s[-2:]
if start == '00' or end == '00' or int(end) > 12:
  print('NA')
elif int(start) > 12 and int(end) < 12:
  print('YYMM')
elif int(start) < 12 and int(end) > 12:
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
before = 0
after = 0

if s[0] == '0':
	before = int(s[1])
else:
	before = int(s[0]+s[1])

if s[2] == '0':
	after = int(s[3])
else:
	after = int(s[2]+s[3])

if before == 0 or after == 0:
	print("NA")
elif before <= 12 and after <= 12:
	print("AMBIGUOUS")
elif before <= 12:
	print("MMYY")
elif after <= 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:
    print("NA")
else:
    if (a<=12 and b<=12):        
        print("AMBIGUOUS")
    else: 
        if a >=12:
            print("YYMM")
        else:
            print("MMYY")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = input()
if 0<int(a[:2])<=12:
  if 0<int(a[2:])<=12:
    print("AMBIGIUOUS")
  else:
    print("MMYY")
else:
  if 0<int(a[2:])<=12:
    print("YYMM")
  else:
    print("NA")

Submission status: Wrong Answer

Solution code:
a = input()
if 0<int(a[:2])<=12:
  if int(a[2:])<=12:
    print("AMBIGIUOUS")
  else:
    print("MMYY")
else:
  if int(a[2:])<=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 1<=S1<=12 and 1<=S2<=12:
    print('AMBIGUOUS')

elif 1<=S1<=12 and 12<S2:
    print('MMYY')

elif 12<S1 and 1<=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 1<=S1<=12:
    
    
    if 1<=S2<=12:
        print('AMBIGUOUS')
        
    elif 12<S2:
        print('MMYY')
    
    else:
        print('NA')

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

else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
S1=int(S[0]+S[1])
S2=int(S[2]+S[3])

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

elif 12<S1:
    if 1<=S2<=31:
        print('YYMM')
    else:
        print('NA')

else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
S1=int(S[0]+S[1])
S2=int(S[2]+S[3])

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

elif 12<S1:
    if 1<=S2<=31:
        print('YYMM')
    else:
        print('NA')

else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
S1=int(S[0]+S[1])
S2=int(S[2]+S[3])

if 1<=S1<=12:
    
    if S2==0:
        print("NA")
    
    if 1<=S2<=12:
        print('AMBIGUOUS')
        
    elif 12<=S2<=31:
        print('MMYY')

elif 12<S1<=31 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 1<=S1<=12:
    
    if S2==0:
        print("NA")
    
    if 1<=S2<=12:
        print('AMBIGUOUS')
        
    elif 12<=S2<=31:
        print('YYMM')

elif 12<S1<=31 and S2 !=0 :
    print("MMYY")

else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

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

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

Submission status: Wrong Answer

Solution code:
a = int(input())
b = a//100
c = a%100
d = 0

if 0<b and b<13:
    d += 1

if 0<c and c<13:
    d += 1

if d == 0:
    print("NA")
if d == 1:
    print("YYMM")
if d == 2:
    print("MMYY")

if d == 0:
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(max == 0):
        print('NA')
    elif(max != 0):
        if(min == 0):
            if(max > 12):
                print('NA')
            else:
                print('YYMM')
        else:
            if(max <= 12):
                print('AMBIGUOUS')
            elif(max > 12):
                if(AA >= BB ):
                    print('YYMM')
                else:
                    print('MMYY')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(max == 0):
        print('NA')
    elif(max != 0):
        if(min == 0):
            print('YYMM')
        else:
            if(max <= 12):
                print('AMBIGUOUS')
            elif(max > 12):
                if(AA >= BB ):
                    print('YYMM')
                else:
                    print('MMYY')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(max != 0):
        if(max <= 12):
            print('AMBIGUOUS')
        elif(max > 12):
            if(AA >= BB ):
                print('YYMM')
            else:
                print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(min != 0 and max != 0):
        if(max <= 12):
            print('AMBIGUOUS')
        elif(max > 12):
            if(AA >= BB ):
                print('YYMM')
            else:
                print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(min != 0 and max != 0):
        if(max <= 12):
            print('AMBIGUOUS')
        elif(max > 12):
            if(AA >= BB ):
                print('YYMM')
            else:
                print('MMYY')
    else:
        print('BBBBBBBBBB')
        print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(min != 0 & max != 0):
        if(max <= 12):
            print('AMBIGUOUS')
        elif(max > 12):
            if(AA >= BB ):
                print('YYMM')
            else:
                print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(min != 0 & max != 0):
        if(max <= 12):
            print('ANBIGUOUS')
        elif(max > 12):
            if(AA >= BB ):
                print('YYMM')
            else:
                print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(min != 0):
        if(max <= 12):
            print('ANBIGUOUS')
        elif(max > 12):
            if(AA >= BB ):
                print('YYMM')
            else:
                print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(max <= 12):
        print('ANBIGUOUS')
    elif(max > 12):
        if (min == 0):
            print('NA')
        elif(AA >= BB ):
            print('YYMM')
        else:
            print('MMYY')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

max = max(AA,BB)
min = min(AA,BB)

if(min > 12):
    print('NA')
if(min <= 12):
    if(max <= 12):
        print('ANBIGUOUS')
    elif(max > 12):
        if(AA >= BB):
            print('YYMM')
        else:
            print('MMYY')

Submission status: Wrong Answer

Solution code:
s=list(map(int,input().split()))
a=0
b=0
c=0
d=0
e=0
f=0
a=s[0]-s[0]%1000
d=s[0]%10
c=s[0]%100-d
b=s[0]-a*1000-c-d
b=int(b/10)
a=a*10
e=a+b
f=c+d
if e==0:
  if 1<=f and f<=12:
    print('YYMM')
  else:
    print('NA')
elif 1<=e and e<=12:
  if 1<=f and f<=12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if 1<=f and f<=12:
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())

a, b = 0, 0

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

Submission status: Wrong Answer

Solution code:
a = input()
mm = int(a[:2])
yy = int(a[2:])

can1 = True
can2 = True

if mm>12:
  can1 = False
if mm<1:
  can1= False

if yy>12:
  can2 = False
if yy<1:
  can2 = False

if can1 and can2:
  print("AMBIGOUS")
elif can2:
  print("YYMM")
elif can1:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
a = input()
mm = int(a[:2])
yy = int(a[2:])

can1 = True
can2 = True

if mm>12:
  can1 = False
if mm<1:
  can1= False

if yy>12:
  can2 = False
if yy<1:
  can2 = False

if can1 and can2:
  print("AMBIGIOUS")
elif can2:
  print("YYMM")
elif can1:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
a = input()
mm = int(a[:2])
yy = int(a[2:])

if mm > 12 and yy>12:
  print("NA")

if mm < 13 and yy>12:
  print("YYMM")

if mm > 12 and yy<13:
  print("MMYY")

if mm < 13 and yy<13:
  print("AMBIGIOUS")

Submission status: Wrong Answer

Solution code:
S = int(input())

word = "NA","YYMM","MMYY","AMBIGUOUS"
S1 = int(S/100)
S2 = int(S%100)
answer = 0
if S1 > 0 and S1 < 13:
  if S2 >= 0 and S2 <= 99:
    answer = answer + 1
if S2 > 0 and S2 < 13:
  if S1 >= 0 and S1 <= 99:
    answer = answer + 2
print(word[answer])

Submission status: Wrong Answer

Solution code:
n=input()
l,r=int(n[:2]),int(n[2:])
if r>12 and l<=12:
  print("MMYY")
elif r<=12 and l>12:
  print("YYMM")
elif r<=12 and l<=12:
  print("AMBIGUOUS")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
n=input()
l,r=int(n[:2]),int(n[2:])
if r>12 and l<=12:
  print("MMYY")
elif r<=12 and l>12:
  print("YYMM")
else:
  print("AMBIGUOUS")

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 (b==0 or 13<b):
      print('MMYY')
elif (1<=b<=12) and (a==0 or 13<a):
      print('YYMM')
else:
      print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
x0 = int(S[:2])
x1 = int(S[2:])

if 0 < x0 <= 12 and 0 < x1 <= 12:
    print('AMBIGUOUS')
elif 0 < x0 <= 12 and 0 < x1:
    print('MMYY')
elif 0 < x0 and 0 < x1 <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = str(input())

if 0 < int(s[:2]) <= 12:
    if 0 < int(s[2:]) <= 12:
        ans = "AMBIGUOS"
    else :
        ans = "MMYY"
elif 0 < int(s[2:]) <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)

Submission status: Wrong Answer

Solution code:
s = str(input())

if 0 < int(s[:2]) <= 12:
    if 0 < int(s[2:]) <= 12:
        ans = "AMBIGUOS"
    else :
        ans = "MMYY"
elif 0 < int(s[:2]) <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)

Submission status: Wrong Answer

Solution code:
S = list(map(int, input()))
pre =  S[0] * 10 + S[1]
suf =  S[2] * 10 + S[3]
S2 = [pre, suf]
ans = ''

def YorM (x):
    if x == 0:
        return 'YY'
    elif x >= 1 and x <= 12:
        return 'AMB'
    else:
        return 'YY'

S3 = [YorM(i) for i in S2]

if S3[0] == 'YY':
    if S[1] == 'AMB':
        ans = 'YYMM'
    else:
        ans = 'NA'
if S3[0] == 'AMB':
    if S[1] == 'YY':
        ans = 'MMYY'
    else:
        ans = 'AMBIGUOUS'

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
 
mae = int(s[:2])
ato = int(s[2:])
 
if mae <= 12 and mae > 0:
  f_mae = True
else:
  f_mae = False
  
if ato <= 12 and ato > 0:
  f_ato = True
else:
  f_ato = False
 
if f_mae and f_ato:
  print("AMBIGOUS")
elif not f_mae and f_ato:
  print("YYMM")
elif f_mae and not f_ato:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
 
mae = int(s[:2])
ato = int(s[2:])
 
if mae <= 12:
  f_mae = True
else:
  f_mae = False
  
if ato <= 12:
  f_ato = True
else:
  f_ato = False
 
if f_mae and f_ato:
  print("AMBIGOUS")
elif not f_mae and f_ato:
  print(str(mae).zfill(2) + str(ato).zfill(2))
elif f_mae and not f_ato:
  print(str(ato).zfill(2) + str(mae).zfill(2))
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
 
mae = int(s[:2])
ato = int(s[2:])
 
if mae <= 12:
  f_mae = True
else:
  f_mae = False
  
if ato <= 12:
  f_ato = True
else:
  f_ato = False
 
if mae and ato:
  print("AMBIGOUS")
elif not mae and ato:
  print(str(mae).zfill(2) + str(ato).zfill(2))
elif mae and not ato:
  print(str(ato).zfill(2) + str(mae).zfill(2))
else:
  print("NA")