TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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`.

Submission attempts (in order):
S=input()
if 1<=int(S[:2])<=12 and 13<=int(S[2:]) or int(S[2:])==0:
    print("MMYY")
elif 1<=int(S[2:])<=12 and 13<=int(S[:2]) or int(S[:2])==0:
    print("YYMM")
elif 1<=int(S[2:])<=12 and 1<=int(S[:2])<=12:
    print("AMBIGUOUS")2
elif 13<=int(S[2:]) or int(S[2:])==0 and 13<=int(S[:2]) or int(S[:])==0:
    print("NA")

S=input()
if 1<=int(S[:2])<=12 and (13<=int(S[2:]) or int(S[2:]))==0:
    print("MMYY")
elif 1<=int(S[2:])<=12 and (13<=int(S[:2]) or int(S[:2]))==0:
    print("YYMM")
elif 1<=int(S[2:])<=12 and 1<=int(S[:2])<=12:
    print("AMBIGUOUS")
elif (13<=int(S[2:]) or int(S[2:]))==0 and (13<=int(S[:2]) or int(S[:])==0):
    print("NA")

S=input()
if 1<=int(S[:2])<=12 and (13<=int(S[2:]) or int(S[2:])==0):
    print("MMYY")
elif 1<=int(S[2:])<=12 and (13<=int(S[:2]) or int(S[:2])==0):
    print("YYMM")
elif 1<=int(S[2:])<=12 and 1<=int(S[:2])<=12:
    print("AMBIGUOUS")
elif (13<=int(S[2:]) or int(S[2:])==0) and (13<=int(S[:2]) or int(S[:])==0):
    print("NA")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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')

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
left = int(s[:2])
right = int(s[2:])

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

s = input()
left = int(s[:2])
right = int(s[2:])
 
if 1 <= left and left <=12 and 1 <= right and right <= 12:
	print("AMBIGUOUS")
elif 1 <= left and left <= 12:
	print("MMYY")
elif 1 <= rihgt and right <= 12:
	print("YYMM")
else:
	print("NA")

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()

E1 = int(S[:2])
E2 = int(S[2:])

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










S = input()

E1 = int(S[:2])
E2 = int(S[2:])

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










Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
import sys
rr = lambda: sys.stdin.readline().strip()
ri = lambda: int(rr())
rs = lambda: [int(_) for _ in rr().split()]

S = rr()

if not 1 <= int(S[:1]) <= 12:
    if not 1 <= int(S[2:]) <= 12:
        print('NA')
    else:
        print('YYMM')
elif not 1 <= int(S[2:]) <= 12:
	if not 1 <= int(S[1:]) <= 12:
        print('NA')
    else:
        print('MMYY')
else:
    print('AMBIGUOUS')

import sys
rr = lambda: sys.stdin.readline().strip()
ri = lambda: int(rr())
rs = lambda: [int(_) for _ in rr().split()]

S = rr()

if not 1 <= int(S[:1]) <= 12:
    if not 1 <= int(S[2:]) <= 12:
        print('NA')
    else:
        print('YYMM')
elif not 1 <= int(S[2:]) <= 12:
	if not 1 <= int(S[2:]) <= 12:
        print('NA')
    else:
        print('MMYY')
else:
    print('AMBIGUOUS')

import sys
rr = lambda: sys.stdin.readline().strip()
ri = lambda: int(rr())
rs = lambda: [int(_) for _ in rr().split()]

S = rr()

if not 1 <= int(S[:2]) <= 12:
    if not 1 <= int(S[2:]) <= 12:
        print('NA')
    else:
        print('YYMM')
elif not 1 <= int(S[2:]) <= 12:
	print('MMYY')
else:
    print('AMBIGUOUS')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = int(input())
x = 0
a = S//100
b = S%100
if a>=1 and a<=12:
    x+=1
if b>=1 and a<=12:
    x+=1
if x = 0:
    print("NA")
elif x = 2:
    print("AMBIGUOUS")
if x = 1:
    if a>=1 and a<=12:
        print("MMYY")
    else:
        print("YYMM")

S = int(input())
x = 0
a = S//100
b = S%100
if a>=1 and a<=12:
    x+=1
if b>=1 and b<=12:
    x+=1
if x == 0:
    print("NA")
elif x == 2:
    print("AMBIGUOUS")
if x == 1:
    if a>=1 and a<=12:
        print("MMYY")
    else:
        print("YYMM")

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
=input()
L=["01","02","03","04","05","06","07","08","09","10","11","12"]

if S[:2] in L:
    if S[2:] in L:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if S[2:] in L:
        print("YYMM")
    else:
        print("NA")

S=input()
L=["01","02","03","04","05","06","07","08","09","10","11","12"]

if S[:2] in L:
    if S[2:] in L:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if S[2:] in L:
        print("YYMM")
    else:
        print("NA")

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
DAY = input()
YY = int(DAY[:2])
MM = int(DAY[2:])
#print(YY,MM)

if YY < 1 or MM < 1:
  print("NA")

elif YY <= 12 and MM <= 12:
  print("AMBIGIOUS")
  
else:
  if YY < MM:
  	print("YYMM")
  else:
    print("MMYY")

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s=str(input())
a=int(s[:2])
b=int(s[2:])
if a==0 or a>=13:
    astr='YY'
else:
    astr='MM'

if b==0 or a>=13:
    bstr='YY'
else:
    bstr='MM'

ans=astr+bstr
 
if ans=='YYYY':
    print('NA')
elif ans=='MMMM':
    print('AMBIGUOUS')
else:
    print(ans)




s=str(input())
a=int(s[:2])
b=int(s[2:])
if a==0 or a>=13:
    astr='YY'
else:
    astr='MM'

if b==0 or a>=13:
    bstr='YY'
else:
    bstr='MM'

ans=astr+bstr
 
if ans=='YYYY':
    print('NA')
elif ans=='MMMM':
    print('AMBIGUOS')
else:
    print(ans)


s=str(input())
a=int(s[:2])
b=int(s[2:])
if a==0 or a>=13:
    astr='YY'
else:
    astr='MM'

if b==0 or b>=13:
    bstr='YY'
else:
    bstr='MM'

ans=astr+bstr


if ans=='YYYY':
    print('NA')
elif ans=='MMMM':
    print('AMBIGUOUS')
else:
    print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
if ((int(S[:2]) == 0) and (int(S[2:4])) == 0):
    print("{}".format("NA"))
elif (int(S[:2]) == 0) and (12< int(S[2:4])):
    print("{}".format("NA"))
elif(12< (int(S[:2])) and (int(S[2:4]) == 0)):
    print("{}".format("NA"))
elif (12 < int(S[:2])) and (12 < int(S[2:4])):
      print("{}".format("NA"))
elif(int(S[:2]) == 0) and (int(S[2:4]) < 13):
    print("{}".format("YYMM"))
elif(int(S[:2]) < 13) and (int(S[2:4]) == 0):
    print("{}".format("MMYY"))
elif (0<(int(S[:2]) <13) and (0< int(S[2:4]) < 13)):
    print("{}".format("AMBIGUOUS"))
elif(int(S[:2]) < 13):
     print("{}".format("MMYY"))
elif(0 <int(S[2]) <13):
     print("{}".format("YYMM"))
elif((int(S[:2]) > 12) and (int(S[2:4]) > 12)):
    print("{}".format("NA"))

S = input()
if ((int(S[:2]) == 0) and (int(S[2:4])) == 0):
    print("{}".format("NA"))
elif (int(S[:2]) == 0) and (12< int(S[2:4])):
    print("{}".format("NA"))
elif(12< (int(S[:2])) and (int(S[2:4]) == 0)):
    print("{}".format("NA"))
elif (12 < int(S[:2])) and (12 < int(S[2:4])):
      print("{}".format("NA"))
elif(int(S[:2]) == 0) and (int(S[2:4]) < 13):
    print("{}".format("YYMM"))
elif(int(S[:2]) < 13) and (int(S[2:4]) == 0):
    print("{}".format("MMYY"))
elif (0<(int(S[:2]) <13) and (0< int(S[2:4]) < 13)):
    print("{}".format("AMBIGUOUS"))
elif(int(S[:2]) < 13):
     print("{}".format("MMYY"))
else:
     print("{}".format("YYMM"))

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
def solve():
    s = input()
    sl = list(str(s))
    st = int("".join(sl[:2]))
    end = int("".join(sl[3:4]))
    if st > 0 and st <= 12 and end > 0 and end <= 12:
        print('AMBIGUOUS')
    elif st > 0 and st <= 12 and (end == 0  or end > 12):
        print('YYMM')
    elif (st == 0 or st > 12) and end > 0 and end <= 12:
        print('MMYY')
    else:
        print('NA')

if __name__ == '__main__':
    solve()

def solve():
    s = input()
    if len(str(s)) != 4:
        raise Exception('Error')
    if not (s.isdecimal()):
        print('NA')
    else:
        sl = list(s)
        st = int("".join(sl[:2]))
        end = int("".join(sl[2:4]))
        if st > 0 and st <= 12 and end > 0 and end <= 12:
            print('AMBIGUOUS')
        elif st > 0 and st <= 12 and (end == 0  or end > 12):
            print('MMYY')
        elif (st == 0 or st > 12) and end > 0 and end <= 12:
            print('YYMM')
        else:
            print('NA')

if __name__ == '__main__':
    solve()


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S=list(input())
BE=[int(S[0]),int(S[1])]
AF=[int(S[2]),int(S[3])]
b_flag=0
a_flag=0
if BE[0] == 0 and BE[1]>=1:
    b_flag=1
if BE[0] == 1 and BE[0] <=2:
    b_flag=1
if AF[0] == 0:
    a_flag=1
if AF[0] == 1 and AF[1] <=2:
    a_flag=1
if a_flag ==1 and b_flag==1:
    print('AMBIGUOUS')
elif a_flag ==1:
    print('YYMM')
elif b_flag==1:
    print('MMYY')
else:
    print('NA')


S=input()
bf=int(S[:2])
af=int(S[2:])
if 1 <= bf <= 12 and 1<= af <=12:
  print("AMBIGUOUS")
elif (bf>12 and af==0) or (af>12 and bf==0) or  (af==0 and bf==0) or (af>12 and bf>12):
  print('NA')
elif bf>12 or bf==0:
  print('YYMM')
else:
  print('MMYY')

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S=int(input())

a=S/100
b=S%100

if(a>12 and b>12):
    print("NA")

elif(a==0 and b==0):
    print("NA")

elif((a>12 or a=0) and 1<=b<=12):
        print("YYMM")

elif(1<=a<=12 and (b>12 or b=0)):
        print("MMYY")

elif(1<=a<=12 and 1<=b<=12):
        print('AMBIGUOU')

else:
    print("NA")


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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):

S = input()

MAE = int(S[:2])
USIRO = int(S[2:])

MMYY_Flag = False
YYMM_Flag = False


if 1 <= MAE and 12 >= MAE:
    MMYY_Flag = True

if 1 <= USIRO and 12 >= USIRO:
    YYMM_Flag = True


if MMYY_Flag and YYMM_Flag:
    print ("AMBIGUOUS")

elif MMYY_Flag:
    print ("MMYY")
1700

elif YYMM_Flag:
    print ("YYMM")

else:
    print ("NA")



S = input()

MAE = int(S[:2])
USIRO = int(S[2:])

MMYY_Flag = False
YYMM_Flag = False


if 1 <= MAE and 12 >= MAE:
    MMYY_Flag = True

if 1 <= USIRO and 12 >= USIRO:
    YYMM_Flag = True


if MMYY_Flag and YYMM_Flag:
    print ("AMBIGUOUS")

elif MMYY_Flag:
    print ("MMYY")

elif YYMM_Flag:
    print ("YYMM")

else:
    print ("NA")


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
date = input()
firstvalid = isMonth(date[0:2])
secondvalid = isMonth(date[2:])

if firstvalid && secondvalid:
  print('AMBIGUOUS')
elif firstvalid:
  print('MMYY')
elif secondvalid:
  print('YYMM')
else:
  print('NA')
  


def isMonth(x):
  return 1 <= int(x) <= 12


def isMonth(x):
  y = int(x)
  return (1 <= y and y <= 12)

date = input()
firstvalid = isMonth(date[0:2])
secondvalid = isMonth(date[2:])
 
if firstvalid and secondvalid:
  print('AMBIGUOUS')
elif firstvalid:
  print('MMYY')
elif secondvalid:
  print('YYMM')
else:
  print('NA')

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = str(input())
w = list(map(int, input().split()))
f = "".join(w[0:2])
b = "".join(w[2:4])
if 1 <= int(f) <= 12 and  1 <= int(b) <= 12:
    print("AMBIGUOUS")
elif 1 <= int(b) <= 12 and not  1 <= int(f) <= 12:
    print("YYMM")
elif 1 <= int(f) <= 12 and not  1 <= int(b) <= 12:
    print("MMYY")
else:
    print("NA")

s = int(input())
f = s // 100
b = s % 100
if 1 <= f <= 12 and  1 <= b <= 12:
    print("AMBIGUOUS")
elif 1 <= b <= 12 and not  1 <= f <= 12:
    print("YYMM")
elif 1 <= f <= 12 and not  1 <= b <= 12:
    print("MMYY")
else:
    print("NA")


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
import sys

s = input()
s = s[:4]
a = s[:2]
b = s[2:]

if (int(a) > 12 and int(b) > 12) or  int(b) == 0  or int(a) == 0:
	
	print("NA")
	sys.exit()
	
if 0 <  int(a) <= 12 and 0 <  int(b) <= 12:

	
if int(a) > 12 and 0 < int(b) <= 12:

	print("YYMM")
	sys.exit()

if 0 < int(a) <= 12 and int(b) > 12:

	print("MMYY")
	sys.exit()

print("AMBIGUOUS")




import sys

s = input()
s = s[:4]
a = s[:2]
b = s[2:]

	
if 0 <  int(a) <= 12 and 0 <  int(b) <= 12:

	print("AMBIGUOUS")
	sys.exit()


elif int(a) >= 0 and 0 < int(b) <= 12:

	print("YYMM")
	sys.exit()

elif 0 < int(a) <= 12 and int(b) >= 0:

	print("MMYY")
	sys.exit()

print("NA")




Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
ans=0
if b<32 and b!=00:
    ans+=1
if a<32 and a!=00:
    ans+=2
if ans==3:
    print("AMBIGUOUS")
elif ans==2:
    print("MMYY")
elif ans==1:
    print("YYMM")
else:
    print("NA")


s=input()
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
ans=0
if b<32:
    ans+=1
if a<32:
    ans+=2
if ans==3:
    print("AMBIGUOUS")
elif ans==2:
    print("MMYY")
elif ans==1:
    print("YYMM")
else:
    print("NA")

s=input()
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
ans=0
if b<32 and a!=00 and b!=00:
    ans+=1
if a<32 and a!=00 and b!=00:
    ans+=2
if ans==3:
    print("AMBIGUOUS")
elif ans==2:
    print("MMYY")
elif ans==1:
    print("YYMM")
else:
    print("NA")

s=input()
a=int("".join(s[0:2]))
b=int("".join(s[2:4]))
ans=0
if b<13 and b!=00:
    ans+=1
if a<13 and a!=00:
    ans+=2
if ans==3:
    print("AMBIGUOUS")
elif ans==2:
    print("MMYY")
elif ans==1:
    print("YYMM")
else:
    print("NA")

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S=input()
mae=S[:2]
ato=S[2:]
mon_list=("01","02","03","04","05","06","07","08","09","10","11","12")
test=0
if mae in mon_list:
  test=test+1
if ato in mon_list:
  test=test+3

if test==0:
  print("NA")
if test==1:
  print("YYMM")
if test==3:
  print("MMYY")
if test==4:
  print("AMBIGUOUS")

S=input()
mae=S[:2]
ato=S[2:]
mon_list=("01","02","03","04","05","06","07","08","09","10","11","12")
test=0
if mae in mon_list:
  test=test+1
if ato in mon_list:
  test=test+3

if test==0:
  print("NA")
if test==1:
  print("MMYY")
if test==3:
  print("YYMM")
if test==4:
  print("AMBIGUOUS")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
print("{} {}".format(s[0:2],s[2:4]))
s1 = int(s[0:2])
s2 = int(s[2:4])

s1m = False
s1y = False
s2m = False
s2y = False
if s1 <= 12 and s1 >= 1:
  s1y = True
  s1m = True
elif s1 > 12 or s1 == 0:
  s1y = True
  
if s2 <= 12 and s2 >= 1:
  s2y = True
  s2m = True
elif s2 > 12  or s2 == 0:
  s2y = True

if s1y and s2y and s1m and s2m:
  print("AMBIGUOUS")
elif s1y and s2m :
  print("YYMM")
elif s2y and s1m :
  print("MMYY")
else :
  print("NA")
  

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

s1m = False
s1y = False
s2m = False
s2y = False
if s1 <= 12 and s1 >= 1:
  s1y = True
  s1m = True
elif s1 > 12 or s1 == 0:
  s1y = True
  
if s2 <= 12 and s2 >= 1:
  s2y = True
  s2m = True
elif s2 > 12  or s2 == 0:
  s2y = True

if s1y and s2y and s1m and s2m:
  print("AMBIGUOUS")
elif s1y and s2m :
  print("YYMM")
elif s2y and s1m :
  print("MMYY")
else :
  print("NA")
  

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
order = input()
forw = int(order[:2])
back = int(order[2:])
flg_f = 0
flg_b = 0

if forw<=12 and forw != 0:
  flg_m = 1
if back<=12 and back != 0:
  flg_b = 1

if flg_m + flg_b == 2:
  print('AMBIGUOUS')
elif flg_m == 1:
  print('MMYY')
elif flg_b == 1:
  print('YYMM')
else:
  print('NA')

order = input()
forw = int(order[:2])
back = int(order[2:])
flg_f = 0
flg_b = 0
 
if forw<=12 and forw != 0:
  flg_f = 1
if back<=12 and back != 0:
  flg_b = 1

if flg_f + flg_b == 2:
  print('AMBIGUOUS')
elif flg_f == 1:
  print('MMYY')
elif flg_b == 1:
  print('YYMM')
else:
  print('NA')

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
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")

S = input()
YYMM = 0
MMYY = 0
start = S[0:2]
end = S[2:4]
tmp1 = int(start)
tmp2 = int(end)
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")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = list(input())

left = int(''.join(S[0:2]))
right = int(''.join(S[2:4]))
print(left)
print(right)

if (left > 0 and left < 13) and (right > 0 and right < 13):
  print('AMBIGUOUS')
elif left >= 0 and (right > 0 and right < 13):
  print('YYMM')
elif (left > 0 and left < 13) and right >= 0:
  print('MMYY')
else:
  print('NA')
  

S = list(input())

left = int(''.join(S[0:2]))
right = int(''.join(S[2:4]))

if (left > 0 and left < 13) and (right > 0 and right < 13):
  print('AMBIGUOUS')
elif left >= 0 and (right > 0 and right < 13):
  print('YYMM')
elif (left > 0 and left < 13) and right >= 0:
  print('MMYY')
else:
  print('NA')
  

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])

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


s = input()
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])

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


s = input()
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])

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


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = str(input())
F = int(S[0:2])
T = int(S[2:4])

def Greaterthan12(x):
    if x > 12:
        return 0
    else:
        return 1
        
Fjudge = BorS(F)
Tjudge = BorS(T)
if Fjudge == 0:
    if Tjudge == 0:
        print("NA")
    else:
        print("YYMM")
else:
    if Tjudge == 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")

S = str(input())
F = int(S[0:2])
T = int(S[2:4])

def Greaterthan12(x):
    if x > 12:
        return 0
    else:
        if x == 0:
            return 0
        else:
            return 1
        
Fjudge = Greaterthan12(F)
Tjudge = Greaterthan12(T)
if Fjudge == 0:
    if Tjudge == 0:
        print("NA")
    else:
        print("YYMM")
else:
    if Tjudge == 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
first = int(S[:2])
last = int(S[2:])
print(first, last)

is_month_first = False
is_month_last = False

if first <= 12 and first > 0:
    is_month_first = True
if last <= 12 and last > 0:
    is_month_last = True

if is_month_first and is_month_last:
    print("AMBIGUOUS")
elif not is_month_first and not is_month_last:
    print("NA")
else:
    if is_month_first:
        print("MMYY")
    else:
        print("YYMM")

S = input()
first = int(S[:2])
last = int(S[2:])

is_month_first = False
is_month_last = False

if first <= 12 and first > 0:
    is_month_first = True
if last <= 12 and last > 0:
    is_month_last = True

if is_month_first and is_month_last:
    print("AMBIGUOUS")
elif not is_month_first and not is_month_last:
    print("NA")
else:
    if is_month_first:
        print("MMYY")
    else:
        print("YYMM")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
S1 = int(s[:2])
S2 = int(s[2:])

if 1<=s1<=12 and 1<=s2<=12:
  print("AMBIGUOUS")
elif 0<=s1<=99 and 1<=s2<=12:
  print("YYMM")
elif 1<=s1<=12 and 0<=s2<=99:
  print("MMYY")
else:
  print("NA")

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

if 1 <= S1 <= 12 and 1 <= S2 <= 12:
  print("AMBIGUOUS")
elif 0 <= S1 <= 99 and 1 <= S2 <= 12:
  print("YYMM")
elif 1 <= S1 <= 12 and 0 <= S2 <= 99:
  print("MMYY")
else:
  print("NA")

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()
l=s[0]+s[1]
m=s[2]+s[3]
month=['01','02','03','04','05','06','07','08','09','10','11','12']
if month.count(l)==1 and month.count(m)==1:
    print('AMBIGOUS')
elif month.count(l)==1 and month.count(m)==0:
    print('MMYY')
elif month.count(m)==1 and month.count(m)==0:
    print('YYMM')
else:
    print('NA')

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
# -*- coding: utf-8 -*-



def Mcheck(n):
    if(0<n<13):
        return 0
    else:
        return 1
    
def Ycheck(n):
    if(n==0):
        return 1
    else:
        return 0


S=input()
f=int(S[0])*10+int(S[1])
s=int(S[2])*10+int(S[3])

if(Mcheck(f)==0):
    if(Mcheck(s)==0):
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if(Mcheck(f)==0):
        print("YYMM")
    else:
        print("NA")


def Mcheck(n):
    if(0<n<13):
        return 0
    else:
        return 1
    

S=input()
f=int(S[0])*10+int(S[1])
s=int(S[2])*10+int(S[3])

if(Mcheck(f)==0):
    if(Mcheck(s)==0):
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if(Mcheck(s)==0):
        print("YYMM")
    else:
        print("NA")
        

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
f = int(S[0]+S[1])
b = int(S[2]+S[3])

def judge(int):
    if 1 <= int <= 12
        return 0
    else:
        return 1
ref = [judge(f), judge(b)]

if ref == [1, 1]:
    print("NA")
elif ref == [0, 1]:
    print("MMYY")
elif ref == [1, 0]:
    print("YYMM")
else:
    print("AMBIGUOUS")


S = input()
f = int(S[0]+S[1])
b = int(S[2]+S[3])

def judge(int):
    if 1 <= int <= 12:
        return 0
    else:
        return 1
ref = [judge(f), judge(b)]

if ref == [1, 1]:
    print("NA")
elif ref == [0, 1]:
    print("MMYY")
elif ref == [1, 0]:
    print("YYMM")
else:
    print("AMBIGUOUS")


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
ans = [0, 0]
if check(S[0], S[1]):
    ans[0] += 1
if check(S[2], S[3]):
    ans[1] += 1

if ans == [0, 0]:
    print("NA")
elif ans == [0, 1]:
    print("YYMM")
elif ans == [1, 0]:
    print("MMYY")
elif ans == [1, 1]:
    print("AMBIGIOUS")

def check(M_1, M_2):
    M_1 = int(M_1)
    M_2 = int(M_2)
    MM = M_1 * 10 + M_2
    if 1 <= MM <= 12:
        return True
    else:
        return False


S = input()
ans = [0, 0]
if check(S[0], S[1]):
    ans[0] += 1
if check(S[2], S[3]):
    ans[1] += 1

if ans == [0, 0]:
    print("NA")
elif ans == [0, 1]:
    print("YYMM")
elif ans == [1, 0]:
    print("MMYY")
elif ans == [1, 1]:
    print("AMBIGUOUS")


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("MMYY")
  else:
    if(0<a//100<13):
      print("YYMM")
    else:
      print("NA")

a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
    if(0<a//100<13):
      print("YYMM")
    else:
      print("NA")


a=int(input())
if(0<a%100<13):
  if(0<a//100<13):
    print("AMBIGUOUS")
  else:
    print("YYMM")
else:
    if(0<a//100<13):
      print("MMYY")
    else:
      print("NA")


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
def ismonth(month):
    return 0 < month < 13


S = input()

former = int(S[:2])
latter = int(S[2:])

if not (ismonth(former) and ismonth(latter)):
    ans = "NA"

elif ismonth(former) and ismonth(latter):
    ans = "AMBIGUOUS"

elif ismonth(former):
    ans = "MMYY"

elif ismonth(latter):
    ans = "YYMM"

print(ans)

from datetime import datetime

S = input()
former = int(S[:2])
latter = int(S[2:])
YYMM = False
MMYY = False

try:
    datetime(former + 2000, latter, 1)
    YYMM = True
except:
    pass

try:
    datetime(latter + 2000, former, 1)
    MMYY = True
except:
    pass

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


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
f = int(s[0:2])
l = int(s[2:4])

state = {"yymm": False, "mmyy": False}

if 0<= f <= 99:
    if 1<= l <= 12:
        state["yymm"] = True

if 0<= l <= 99:
    if 1<= f <= 12:
        state["mmyy"] = True

if state["yymm"] == True and state["mmyy"] == True:
    print("AMBIGUOUS")
elif state["yymm"] == True and state["mmyy"] == False:
    print("yymm")
elif state["yymm"] == False and state["mmyy"] == True:
    print("mmyy")
else:
    print("NA")

N = list(input())
m = list(map(int,N))
a = 10*m[0] + m[1]
b = 10*m[2] + m[3]
 
if 1<=a<=12 and 1<=b<=12:
  print("AMBIGUOUS")
elif 1<=a<=12:
  print("MMYY")
elif 1<=b<=12:
  print("YYMM")
else:
  print("NA")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
string = input()

moji_list = []
for i in range(4):
    moji_list[i] = string[i]

ue = ''
sita = ''
for j in range(2):
    ue += moji_list[i]
    sita += moji_list[i+2]

int_ue = int(ue)
int_sita = int(sita)

sw_ue = 0
sw_sita = 0
if 1<=int_ue and int_ue<=12:
    sw_ue += 1

if 1<=int_sita and int_sita<=12:
    sw_sita += 1

if sw_ue == 1 and sw_sita == 1:
    print('AMBIGUOUS')
elif sw_ue == 1 and sw_sita == 0:
    print('MMYY')
elif sw_ue == 0 and sw_sita == 1:
    print('YYMM')
elif sw_ue == 0 and sw_sita == 0:
    print('NA')

string = input()

moji_list = [0 for _ in range(4)]
for i in range(4):
    moji_list[i] = string[i]

ue = ''
sita = ''
for j in range(2):
    ue += moji_list[j]
    sita += moji_list[j+2]

int_ue = int(ue)
int_sita = int(sita)

sw_ue = 0
sw_sita = 0
if 1<=int_ue and int_ue<=12:
    sw_ue += 1

if 1<=int_sita and int_sita<=12:
    sw_sita += 1

if sw_ue == 1 and sw_sita == 1:
    print('AMBIGUOUS')
elif sw_ue == 1 and sw_sita == 0:
    print('MMYY')
elif sw_ue == 0 and sw_sita == 1:
    print('YYMM')
elif sw_ue == 0 and sw_sita == 0:
    print('NA')

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
n=input():
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12):
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")

n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12):
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")

n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12) or (int(f)>12 and l=="00") or (int(l)>12 and f=="00") :
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 or l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")

Verdicts: Runtime Error

Runtime Error

Accepted