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=list(input())
s=list(map(int,s))

a=s[0]*10+s[1]
b=s[2]*10+s[3]

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

Submission status: Wrong Answer

Solution code:
s=list(input())
s=list(map(int,s))

a=s[0]*10+s[1]
b=s[2]*10+s[3]

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

Submission status: Wrong Answer

Solution code:
s=list(input())
s=list(map(int,s))

a=s[0]*10+s[1]
b=s[2]*10+s[3]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())
s=list(map(int,s))

if (s[0]==0 and s[1]==0) or (s[2]==0 and s[3]==0) or (s[0]*10+s[1]>=13 and s[2]*10+s[1]>=13):
  print("NA")
elif (s[0]==0 or (s[0]==1 and (s[1]==0 or s[1]==1 or s[1]==2))) and (s[2]==0 or (s[2]==1 or (s[3]==0 or s[3]==1 or s[3]==2))):
  print("AMBIGUOUS")
elif s[2]==0 or (s[2]==1 or (s[3]==0 or s[3]==1 or s[3]==2)):
  print("YYMM")
else:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
s=list(input())
s=list(map(int,s))

if (s[0]==0 and s[1]==0) or (s[2]==0 and s[3]==0):
  print("NA")
elif (s[0]==0 or (s[0]==1 and (s[1]==0 or s[1]==1 or s[1]==2))) and (s[2]==0 or (s[2]==1 or (s[3]==0 or s[3]==1 or s[3]==2))):
  print("AMBIGUOUS")
elif s[2]==0 or (s[2]==1 or (s[3]==0 or s[3]==1 or s[3]==2)):
  print("YYMM")
else:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
s=list(input())
s=list(map(int,s))

if (s[0]==0 and s[1]==0) or (s[2]==0 and s[3]==0):
  print("NA")
elif (s[0]==0 or (s[0]==1 and (s[1]==0 or s[1]==1 or s[1]==2))) and (s[2]==0 or (s[2]==1 or (s[3]==0 or s[3]==1 or s[3]==2))):
  print("AMBIGUOUS")
elif (s[2]==0 or (s[2]==1 or (s[3]==0 or s[3]==1 or s[3]==2))):
  print("YYMM")
else:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
s = str(input())
num = ['01','02','03','04','05','06','07','08','09','10','11','12']
if s[:2] == '00' or s[2:] == '00':
    print("NA")
elif s[:2] in num and s[2:] in num:
    print("AMBIGUOUS")
elif s[:2] in num:
    print("MMYY")
elif s[2:] in num:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = str(input())
print(s[:2],s[2:])
num = ['01','02','03','04','05','06','07','08','09','10','11','12']
if s[:2] == '00' or s[2:] == '00':
    print("NA")
elif s[:2] in num and s[2:] in num:
    print("AMBIGUOUS")
elif s[:2] in num:
    print("MMYY")
elif s[2:] in num:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = str(input())
num = ['01','02','03','04','05','06','07','08','09','10','11','12']
if s[:2] == '00' or s[2:] == '00':
    print("NA")
elif s[:2] in num and s[2:] in num:
    print("AMBIGUOUS")
elif s[:2] in num:
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
S = list(input())

a = int("".join(S[0:2]))
b = int("".join(S[2:4]))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import exit
S = input()

if int(S[0:2]) == 0 or int(S[2:]) == 0:
    print("NA")
    exit(0)


if int(S[0:2]) >= 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()
S1, S2 = S[0:2], S[2:5]
if int(S1) > 12 and (int(S2) >= 1 and int(S2) <= 12):
	print('YYMM')
elif (int(S1) >= 1 and int(S1) <=12) and int(S2) > 12:
	print('MMYY')
elif (int(S1) >= 1 and int(S1) <=12) and (int(S2) >= 1 and int(S2) <=12):
	print('AMBIGUOUS')
else:
	print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
S1, S2 = S[0:2], S[2:5]
if int(S1) > 12:
	print('YYMM')
elif int(S2) > 12:
	print('MMYY')
else:
	print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
sform = int(S[:2])
slatt = int(S[2:])

if sform <= 12:
    if slatt <= 12 and slatt >= 1:
        print('AMBIGUOUS')
    else:
        print('MMYY')

else:
    if slatt <= 12 and slatt >= 1:
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
v=0
for i in range(4):
    v = v*10+int(s[i])
v1 = v//100
v2 = v%100
if 12>=v1>=1 and 12>=v2>=1:
    print("AMBIGUOUS")
elif (v1>13 or v1==0) and 12>=v2>=1:
    print("YYMM")
elif (v2>13 or v2==0) and 12>=v1>=1:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()

first_two=int(''.join(s[:2]))
last_two=int(''.join(s[2:]))

if 1<=first_two<=12 and 1<=last_two<=12:
  print('AMBIGUOUS')
elif 1<=last_two<=12:
  print('YYMM')
elif 13<=last_two and 1<=first_two<=12:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s=input()

first_two=int(''.join(s[:2]))
last_two=int(''.join(s[2:]))

if 13<=first_two and 1<=last_two<=12:
  print('YYMM')
elif 13<=last_two and 1<=first_two<=12:
  print('MMYY')
elif 1<=first_two<=12 and 1<=last_two<=12:
  print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s=input()

first_two=int(''.join(s[:2]))
last_two=int(''.join(s[2:]))

if 13<=first_two and 1<=last_two<=12:
  print('YYMM')
if 13<=last_two and 1<=first_two<=12:
  print('MMYY')
if 1<=first_two<=12 and 1<=last_two<=12:
  print('AMBIGUOUS')
if first_two>12 and last_two>12:
  print('NA')

Submission status: Wrong Answer

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

F = False
L = False

if l[0] <= 12:
  F = True
if l[1] <= 12:
  L = True

if F == True and L == True:
  print('AMBIGUOUS')

elif F == True:
  print('MMYY')

elif L == True:
  print('YYMM')

else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
newlist = []
ym_flag = True
my_flag = True

for i in range(len(s)):
  newlist.append(int(s[i]))
  
if newlist[0] > 2:
  my_flag = False
else:
  if newlist[0] == 1 and newlist[1] > 3:
    my_flag = False
  else:
    if newlist[0] == 0 and s[1] == 0:
      my_flag = False
if newlist[2] > 2:
  ym_flag = False
else:
  if newlist[2] == 1 and newlist[3] > 3:
    ym_flag = False
  else:
    if newlist[2] == 0 and s[3] == 0:
      ym_flag = False

if ym_flag == True and newlist[2] == 0 and newlist[3] == 0:
  ym_flag = False
if my_flag == True and newlist[0] == 0 and newlist[1] == 0:
  my_flag = False
if ym_flag == True and int(str(newlist[0]) + str(newlist[1])) > 13:
  ym_flag = False
if my_flag == True and int(str(newlist[2]) + str(newlist[3])) > 13:
  my_flag = False

if ym_flag == True and my_flag == True:
  print('AMBIGUOUS')
elif ym_flag == False and my_flag == False:
  print('NA')
else:
  if ym_flag == True:
    print('YYMM')
  else:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
s = input()
newlist = []
ym_flag = True
my_flag = True

for i in range(len(s)):
  newlist.append(int(s[i]))
  
if newlist[0] > 2:
  my_flag = False
else:
  if newlist[0] == 1 and newlist[1] > 3:
    my_flag = False
  else:
    if newlist[0] == 0 and s[1] == 0:
      my_flag = False
if newlist[2] > 2:
  ym_flag = False
else:
  if newlist[2] == 1 and newlist[3] > 3:
    ym_flag = False
  else:
    if newlist[2] == 0 and s[3] == 0:
      ym_flag = False

if ym_flag == True and newlist[2] == 0 and newlist[3] == 0:
  ym_flag = False
if my_flag == True and newlist[0] == 0 and newlist[1] == 0:
  my_flag = False

if ym_flag == True and my_flag == True:
  print('AMBIGUOUS')
elif ym_flag == False and my_flag == False:
  print('NA')
else:
  if ym_flag == True:
    print('YYMM')
  else:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
s=str(input())
a="Y"
b="Y"
if 0<int(s[0:2])<13:
    print("#")
    a="MY"
if 0<int(s[2:5])<13:
    b="MY"

if a==b=="Y":
    ans="NA"
elif a=="Y" and b=="MY":
    ans="YYMM"
elif a=="MY" and b=="Y":
    ans="MMYY"
else:
    ans="AMBIGUOUS"
print(ans)

Submission status: Wrong Answer

Solution code:
s=str(input())
a="Y"
b="Y"
if 0<int(s[0:2])<13:
    a="MY"
if 0<int(s[3:5])<13:
    b="MY"

if a==b=="Y":
    ans="NA"
elif a=="Y" and b=="MY":
    ans="YYMM"
elif a=="MY" and b=="Y":
    ans="MMYY"
else:
    ans="AMBIGUOUS"
print(ans)

Submission status: Wrong Answer

Solution code:
def solve():
    s = input()
    a = int(s[:2])
    if a == 0 or a > 12:
        x = "YY"
    else:
        x = "MM"
    b = int(s[2:])
    if b == 0 or b > 12:
        y = "YY"
    else:
        y = "MM"
    if x + y == "YYYY":
        print("NA")
    elif x + y == "MMMM":
        print("AMBIGUOUS")
    else:
        print(x + y)


#solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
if (int(s[:2]) > 12)&(int(s[2:]) <= 12)&("00" not in s):
    print("YYMM")
    
elif (int(s[:2]) <= 12)&(int(s[2:]) > 12)&("00" not in s):
    print("MMYY")

elif (int(s[:2]) <= 12)&(int(s[2:]) <= 12)&("00" not in s):
    print("AMBIGUOUS")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

f = S[:3]
s = S[3:]

if 1<=int(f)<=12:
    if 1<=int(s)<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1<=int(s)<=12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
a, b = int(s[:2]), int(s[2:])
yymm, mmyy = 0, 0

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

Submission status: Wrong Answer

Solution code:
S = input()

front = int(S[:2])
rear = int(S[2:])

if (front > 12 and rear > 12) or (front > 12 and rear == 0) or (rear > 12 and front == 0) or (front == 0 and rear == 0):
    print("NA")
    exit()
elif 0 < rear <= 12 and front > 12:
    print("YYMM")
    exit()
elif 0 < front <= 12 and rear > 12:
    print("MMYY")
elif 0 < front <= 12 and 0 < rear <= 12:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
YYMM = 0
MMYY = 0
start = S[0:2]
end = S[2:4]
tmp1 = int(start)
tmp2 = int(end)
print(tmp1,tmp2)
if(tmp2 <= 12 and tmp2 != 0):
    YYMM = 1
if(tmp1 <= 12 and tmp1 != 0):
    MMYY = 1
if(YYMM == 1 and MMYY == 1):
    print("AMBIGUOUS")
elif(YYMM == 1):
    print("YYMM")
elif(MMYY == 1):
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
YYMM = 0
MMYY = 0
start = S[0:2]
end = S[2:4]
tmp1 = int(start)
tmp2 = int(end)
if(tmp1 != 0 and tmp2 <= 12 and tmp2 != 0):
    YYMM = 1
if(tmp2 != 0 and tmp1 <= 12 and tmp1 != 0):
    MMYY = 1
if(YYMM == 1 and MMYY == 1):
    print("AMBIGUOUS")
elif(YYMM == 1):
    print("YYMM")
elif(MMYY == 1):
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
mae = int(s[:2])
ato = int(s[3:])

flag1 = 0
flag2 = 0
if 0<mae and mae<=12:
    flag1 = 1
if 0<ato and ato<=12:
    flag2 = 1

if flag1 == 1 and flag2 == 1:
    print('AMBIGUOUS')
elif flag1 == 1:
    print('MMYY')
elif flag2 == 1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
mae = int(s[:2])
ato = int(s[3:])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()

s_a = int(s[0:2])
s_b = int(s[2:4])

if s_a >= 1 and s_a <=12 and s_b >= 1 and s_b <=12:
  ans = "AMBIGUOUS"
elif s_a > 12 and s_b >= 1 and s_b <=12:
  ans = "YYMM"
elif s_b > 12 and s_a >= 1 and s_a <=12:
  ans = "MMYY"
else:
  ans = "NA"

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

n1 = s[0:2]
n2 = s[2:4]

if int(n1) > 12 and int(n2) > 12:
    out_print = 'NA'

elif int(n1) <= 12 and int(n2) <= 12:
    out_print = 'AMBIGUOUS'
    if int(n1) == 0:
        out_print = 'YYMM'
    elif int(n2) == 0:
        out_print = 'MMYY'
    elif int(n1)==0 and int(n2)==0:
        out_print = 'NA'
elif int(n1) <= 12 and int(n2) >12:
    out_print = 'MMYY'
    if int(n1) == 0:
        out_print = 'NA'

elif int(n1) > 12 and int(n2) <= 12:
    out_print = 'YYMM'
    if int(n2) == 0:
        out_print = 'NA'
print(out_print)

Submission status: Wrong Answer

Solution code:

s = input()

n1 = s[0:2]
n2 = s[2:4]

if int(n1) > 12 and int(n2) > 12:
    out_print = 'NA'

elif int(n1) <= 12 and int(n2) <= 12:
    out_print = 'AMBIGUOUS'

elif int(n1) <= 12 and int(n2) >12:
    out_print = 'MMYY'
    if int(n1) == 0:
        out_print = 'NA'
elif int(n1) > 12 and int(n2) <= 12:
    out_print = 'YYMM'
    if int(n2) == 0:
        out_print = 'NA'

print(out_print)

Submission status: Wrong Answer

Solution code:

s = input()

n1 = s[0:2]
n2 = s[2:4]

if int(n1) > 12 and int(n2) > 12:
    out_print = 'NA'

elif int(n1) <= 12 and int(n2) <= 12:
    out_print = 'AMBIGUOUS'

elif int(n1) <= 12 and int(n2) >12:
    out_print = 'MMYY'
    if int(n1) == 0:
        out_print = 'NA'
elif int(n1) > 12 and int(n2) <= 12:
    out_print = 'YYMM'
    print(n2)
    if int(n2) == 0:
        out_print = 'NA'

print(out_print)

Submission status: Wrong Answer

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

s = input()

temp1 = int(s[0:2])
temp2 = int(s[2:4])

if temp1 >= 1 and temp1 <= 12:
    if (temp2 < 1 or temp2 > 12):
        print("MMYY")
    else:
        print("AMBIGUOUS")
else:
    if (temp2 >= 1 and temp2 < 12):
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

s = input()

temp1 = int(s[0:2])
temp2 = int(s[2:4])

if temp1 >= 1 and temp1 <= 12:
    if (temp2 < 1 or temp2 > 12):
        print("MMYY")
    else:
        print("AMBIGOUS")
else:
    if (temp2 >= 1 and temp2 < 12):
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
#N = int(input())
#S = str(input())
#A, B = map(int, input().split())
#C = list(map(int, input().split()))

S = str(input())
a = int(S[:2])
b = int(S[2:])
#print(a, b)

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

Submission status: Wrong Answer

Solution code:
NN = input()
AA = int(NN[0:2])
BB = int(NN[2:-1])
count1 = 0
count2 = 0
if AA > 12 or AA == 00:
  count1 +=1
if BB > 12 or BB == 00:
  count2 +=1
if count1 == 0 and count2 == 0:
  print('AMBIGUOUS')
elif count1 ==1 and count2 == 0:
  print('YYMM')
elif count1 ==0 and count2 == 1:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
NN = input()
AA = int(NN[0:2])
BB = int(NN[2:-1])
count1 = 0
count2 = 0
if AA >12 or AA == 00:
  count1 +=1
if BB >12 or BB == 00:
  count2 +=2
if count1 == 0 and count2 == 0:
  print('AMBIGUOUS')
elif count1 ==1 and count2 == 0:
  print('YYMM')
elif count1 ==0 and count2 == 1:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
NN = input()
AA = int(NN[0:2])
BB = int(NN[2:-1])
count1 = 0
count2 = 0
if AA >12:
  count1 +=1
if BB >12:
  count2 +=2
if count1 == 0 and count2 == 0:
  print('AMBIGUOUS')
elif count1 ==1 and count2 == 0:
  print('YYMM')
elif count1 ==0 and count2 == 1:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
high = int(S[0:2])
low = int(S[2:4])

if 1<= high <= 12:
    if 1<= low <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
if high < 1 or high > 12:
    if 1<= low <= 12:
        print("YYMM")
    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

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

month = [False,False]

if(first ==0 or second==0):
    print('NA')
    exit()

if(0 < first and first <= 12):
    month[0] = True

if(0 < second and second <= 12):
    month[1] = True
    
if(month[0] & month[1]):
    print('AMBIGUOUS')
elif(month[0]):
    print('MMYY')
elif(month[1]):
    print('YYMM')
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<=99 and 0<b<=12:
    print('YYMM')
elif 0<b<=12 and a<=99:
    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<=99 and 0<b<=12:
    print('YYMM')
elif 0<b<=12 and 0<a<=99:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

if int(s[2:]) > 12: #下2桁
    if int(s[:2]) == 0: #上2桁
        print('NA')
    elif int(s[:2]) > 12:
        print('NA')
    elif int(s[:2]) <= 12:
        print('MMYY')
elif int(s[2:]) <= 12 and int(s[2:]) > 0:
    if int(s[:2]) == 0:
        print('YYMM')
    elif int(s[:2]) <= 12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1, s2 = s[:2],s[2:]
if s1>'12' and s2>'12':
    print('NA')
elif s1<='12' and s2<='12':
    if s1 == '00' and s2!='00':
        print('YYMM')
    elif s2 == '00' and s1!='00':
        print('MMYY')
    elif s1 =='00' and s2 =='00':
        print('NA')
    else :
        print('AMBIGUOUS')
elif s1<='12' and s2>'12':
    print('NA' if s1 == '00' else 'MMYY1')   
elif s2<='12' and s1>'12':
    print('NA' if s2 == '00' else 'YYMM1')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1, s2 = s[:2],s[2:]
if s1>'12' and s2>'12':
    print('NA')
elif s1<='12' and s2<='12':
    if s1 == '00':
        print('YYMM')
    if s2 == '00':
        print('MMYY')
    else :
        print('AMBIGUOUS')
elif s1<='12' and s2>'12':
    print('NA' if s1 == '00' else 'MMYY')   
elif s2<='12' and s1>'12':
    print('NA' if s2 == '00' else 'YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

if s1>'12' and s2>'12':
    print('NA')
elif s1<='12' and s2>'12':
    print('NA' if s1 == '00' else 'MMYY')   
elif s2<='12' and s1>'12':
    print('NA' if s2 == '00' else 'YYMM')
elif s1<='12' and s2<='12':
    print('NA' if s1 == '00' or s2 == '00' else 'AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

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

if s1>'12' and s2>'12':
    print('N')
elif s1<='12' and s2>'12':
    print('N' if s1 == '00' else 'MMYY')   
elif s2<='12' and s1>'12':
    print('N' if s2 == '00' else 'YYMM')
elif s1<='12' and s2<='12':
    print('N' if s1 == '00' or s2 == '00' else 'Ambi')
else:
    print('N')

Submission status: Wrong Answer

Solution code:
def main():
    S = str(input())
    front = int(S[0:2])
    latter = int(S[2:4])
    if front < 13 and latter < 13 and (front > 0 or latter > 0):
        print('AMBIGUOUS')
    elif front < 13 and latter < 100 and front > 0:
        print('MMYY')
    elif front < 100 and latter < 13 and latter > 0:
        print('YYMM')
    else:
        print('NA')
main()

Submission status: Wrong Answer

Solution code:
def main():
    S = str(input())
    front = int(S[0:2])
    latter = int(S[2:4])
    if front < 13 and latter < 13:
        print('AMBIGUOUS')
    elif front < 13 and latter < 100 and front > 0:
        print('MMYY')
    elif front < 100 and latter < 13 and latter > 0:
        print('YYMM')
    else:
        print('NA')
main()

Submission status: Wrong Answer

Solution code:
# abc126_b.py
# https://atcoder.jp/contests/abc126/tasks/abc126_b

# B - YYMM or MMYY /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 200点

# 問題文
# 長さ 4の数字列 Sが与えられます。あなたは、この数字列が以下のフォーマットのどちらであるか気になっています。
#     YYMM フォーマット: 西暦年の下 2桁と、月を 2 桁で表したもの (例えば 1なら 01) をこの順に並べたもの
#     MMYY フォーマット: 月を 2桁で表したもの (例えば 1 月なら 01) と、西暦年の下 2桁をこの順に並べたもの

# 与えられた数字列のフォーマットとして考えられるものが YYMM フォーマットのみである場合 YYMM を、 
# MMYY フォーマットのみである場合 MMYY を、 
# YYMM フォーマット と MMYY フォーマットのどちらの可能性もある場合 AMBIGUOUS を、 
# どちらの可能性もない場合 NA を出力してください。

# 制約
#     Sは長さ 4の数字列

# 入力
# 入力は以下の形式で標準入力から与えられる。
# S

# 出力
# YYMM, MMYY, AMBIGUOUS, NA のうち正しいものを出力せよ。

# 入力例 1
# 1905

# 出力例 1
# YYMM

# 19年 5 月はありえますが、05 年 19月はありえません。よって、これは YYMM フォーマットです。

# 入力例 2
# 0112

# 出力例 2
# AMBIGUOUS

# 01年 12 月も 12 年 1月もありえます。よって、これはどちらの可能性もあります。

# 入力例 3
# 1700

# 出力例 3
# NA

# 17年 0 月も 00 年 17 月もありえません。よって、これはどちらの可能性もありません。


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[0]
    # N = int(lines[0])
    # N, K = list(map(int, lines[0].split()))
    # values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(Q):
    #     valueses.append(list(map(int, lines[i+1].split())))

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

    if a*b == 0 or (a>12 and b>12):
        return ['NA']
    elif a<13 and b<13:
        return ['AMBIGUOUS']
    elif a<13:
        return ['MMYY']
    else:
        return ['YYMM']

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['1905']
        lines_export = ['YYMM']
    if pattern == 2:
        lines_input = ['0112']
        lines_export = ['AMBIGUOUS']
    if pattern == 3:
        lines_input = ['1700']
        lines_export = ['NA']
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

if 0<a<13:
    if 0<b<13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if -1<b<13:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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

if -1<a<13:
    if -1<b<13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if -1<b<13:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S=input()
x=int(S[:2])
y=int(S[2:])
if x==0:
    print("NA")
elif 0<x<=12:
    if 0<y<=12:
        print("AMBIGUOUS")
    elif y>=13:
        print("MMYY")
    elif y==0:
        print("NA")
elif x>=13:
    if 0<y<=12:
        print("YYMM")
    elif y>=13:
        print("NA")
    elif y==0:
        print("NA")

Submission status: Wrong Answer

Solution code:
S=input()
x=int(S[:2])
y=int(S[2:])
if x*y==0:
    print("NA")
elif 0<x<=12:
    if y<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif x>=13:
    if y<=12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S=input()
x=int(S[:2])
y=int(S[2:])
if x<=12:
    if y<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if y<=12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

if (int(s[0])==0 and 1 <=int(s[1])<=9)  or (int(s[0]) == 1 and 0<=int(s[1])<=2) and (int(s[2])==0 and 1 <=int(s[3])<=9)  or (int(s[2]) == 1 and 0<=int(s[3])<=2) :
  print("AMBIGUOUS")
elif (int(s[0])==0 and 1 <=int(s[1])<=9)  or (int(s[0]) == 1 and 0<=int(s[1])<=2):
  print("MMYY")
elif (int(s[2])==0 and 1 <=int(s[3])<=9)  or (int(s[2]) == 1 and 0<=int(s[3])<=2):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

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