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()

s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
print(s1, s2)
L=[]

for i in range(1, 13):
    L.append(i)


if s1 not in L and s2 not in L:
    print('NA')
elif s1 in L and s2 not in L:
    print('MMYY')
elif s1 not in L and s2 in L:
    print('YYMM')
else:
    print('AMBIGUOUS')


s = input()

s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
#print(s1, s2)
L=[]

for i in range(1, 13):
    L.append(i)


if s1 not in L and s2 not in L:
    print('NA')
elif s1 in L and s2 not in L:
    print('MMYY')
elif s1 not in L and s2 in L:
    print('YYMM')
else:
    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()
a = int(S[0:2])
b = int(S[2:4])
LIST = [False,False]

print(a,b)
if 1 <= b <= 12 and a > 0:#YYMM
    LIST[0] = True 
if 1 <= a <= 12 and b > 0:#MMYY
    LIST[1] = True 

if LIST[0] and LIST[1]:
    print("AMBIGUOUS")
elif LIST[0] and not LIST[1]:
    print("YYMM")
elif not LIST[0] and LIST[1]:
    print("MMYY")
else:
    print("NA")

S = input()
a = int(S[0:2])
b = int(S[2:4])
LIST = [False,False]

print(a,b)
if 1 <= b <= 12 and a >= 0:#YYMM
    LIST[0] = True 
if 1 <= a <= 12 and b >= 0:#MMYY
    LIST[1] = True 

if LIST[0] and LIST[1]:
    print("AMBIGUOUS")
elif LIST[0] and not LIST[1]:
    print("YYMM")
elif not LIST[0] and LIST[1]:
    print("MMYY")
else:
    print("NA")











S = input()
a = int(S[0:2])
b = int(S[2:4])
LIST = [False,False]

if 1 <= b <= 12 and a >= 0:#YYMM
    LIST[0] = True 
if 1 <= a <= 12 and b >= 0:#MMYY
    LIST[1] = True 

if LIST[0] and LIST[1]:
    print("AMBIGUOUS")
elif LIST[0] and not LIST[1]:
    print("YYMM")
elif not LIST[0] and LIST[1]:
    print("MMYY")
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):
s=input()
strdata=list(s)
data=list(map(int,strdata))
FF=10*data[0]+data[1]
LL=10*data[2]+data[3]
if 12<FF and LL<13 and 0<LL and FF<19:
    print("YYMM\n")
elif 12<LL and FF<13 and 0<FF:
    print("MMYY\n")
elif FF<13 and LL<13 and 0<FF and 0<LL:
    print("AMBIGUOUS\n")
else:
    print("NA\n")


s=input()
strdata=list(s)
data=list(map(int,strdata))
FF=10*data[0]+data[1]
LL=10*data[2]+data[3]
if 12<FF and LL<13 and 0<LL and FF<19:
    print("YYMM")
elif 12<LL and FF<13 and 0<FF:
    print("MMYY")
elif FF<13 and LL<13 and 0<FF and 0<LL:
    print("AMBIGUOUS")
else:
    print("NA")


s=input()
strdata=list(s)
data=list(map(int,strdata))
FF=10*data[0]+data[1]
LL=10*data[2]+data[3]
if FF==0 and 0<LL and LL<13:
    print("YYMM")
elif LL==0 and 0<FF and FF<13:
    print("MMYY")
elif 12<FF and LL<13 and 0<LL:
    print("YYMM")
elif 12<LL and FF<13 and 0<FF:
    print("MMYY")
elif FF<13 and LL<13 and 0<FF and 0<LL:
    print("AMBIGUOUS")
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):
s = input()
a = int(s[:2]) > 13 or int(s[:2])=0
b = int(s[2:]) > 13 or int(s[2:])=0
if a and b:
  print("NA")
elif not a and not b:
  print("AMBIGUOUS")
elif not a and b:
  print("MMYY")
else:
  print("YYMM")
      

s = input()
a = int(s[:2])
b = int(s[2:])
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: 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 = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen <= 12 and go <= 12:
  print("AMBIGUOUS")
elif zen > 12 and go > 12:
  print("NA")
elif zen <= 12 and go > 12:
  print("YYMM")
elif zen > 12 and go <= 12:
  print("MMYY")

n = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen and zen <= 12 and go and go <= 12:
  print("AMBIGUOUS")
elif zen and zen <= 12:
  print("MMYY")
elif go and go <= 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 = input()
if S[:2] == "00":
  if S[2:] > 12:
  	print("NA")
  else:
    print("YYMM")
elif S[2:] == "00":
  if S[:2] > 12:
  	print("NA")
  else:
    print("MMYY")
elif int(S[:2]) > 12 and S[2:] > 12:
  print("NA")
elif int(S[:2]) < 13 and S[2:] < 13:
  print("AMBIGUOUS")
elif int(S[:2]) < 13:
  print("MMYY")
else:
  print("YYMM")

S = input()
if S[:2] == "00":
  if int(S[2:]) > 12 or S[2:] == "00":
  	print("NA")
  else:
    print("YYMM")
elif S[2:] == "00":
  if int(S[:2]) > 12:
  	print("NA")
  else:
    print("MMYY")
elif int(S[:2]) > 12 and int(S[2:]) > 12:
  print("NA")
elif int(S[:2]) < 13 and int(S[2:]) < 13:
  print("AMBIGUOUS")
elif int(S[:2]) < 13:
  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):
S = list(input())
f1 = 1
f2 = 1
A = int(''.join(S[:2]))
B = int(''.join(S[2:]))
print(A,B)
if A >= 13 or A == 0:
    f1 = 0
if B >= 13 or B == 0:
    f2 = 0
if f1 == 1 and f2 == 1:
    print('AMBIGUOUS')
elif f1 == 1 and f2 == 0:
    print('MMYY')
elif f1 == 0 and f2 == 1:
    print('YYMM')
else:
    print('NA')

S = list(input())
f1 = 1
f2 = 1
A = int(''.join(S[:2]))
B = int(''.join(S[2:]))
if A >= 13 or A == 0:
    f1 = 0
if B >= 13 or B == 0:
    f2 = 0
if f1 == 1 and f2 == 1:
    print('AMBIGUOUS')
elif f1 == 1 and f2 == 0:
    print('MMYY')
elif f1 == 0 and f2 == 1:
    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[0])*10 + int(s[1])
b = int(s[2])*10 + int(s[3])
if (0 < a <= 12 and 0 < b) or (0 < a and 0 < b <= 12):
    print("AMBIGUOUS")
elif 0 < a <= 12:
    print("MMYY")
elif 0 < b <= 12:
    print("YYMM")
else:
    print("NA")

s = str(input())
a = int(s[0])*10 + int(s[1])
b = int(s[2])*10 + int(s[3])
if (0 < a <= 12 and 0 <= b) and (0 <= a and 0 < b <= 12):
    print("AMBIGUOUS")
elif 0 < a <= 12:
    print("MMYY")
elif 0 < 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):
n=input()
ym=0
my=0
if n[0]=="0":
  if int(n[1])!=0:
    my=1
  else:
    my=-1
elif n[0]=="1":
  if int(n[1])==1 or int(n[1])==2:
    my=1
  else:
    my=-1
else:
  my=-1
if n[2]=="0":
  if int(n[3])!=0:
    ym=1
  else:
    ym=-1
elif n[2]=="1":
  if int(n[3])==1 or int(n[3])==2:
    ym=1
  else:
    ym=-1
else:
  ym=-1
if my and ym:
  print("AMBIGUOUS")
elif my:
  print("MMYY")
elif ym:
  print("YYMM")
else:
  print("NA")

    

n=input()
ym=0
my=0
if n[0]=="0":
  if int(n[1])!=0:
    my=1
  else:
    my=0
elif n[0]=="1":
  if int(n[1])==1 or int(n[1])==2:
    my=1
  else:
    my=0
else:
  my=0
if n[2]=="0":
  if int(n[3])!=0:
    ym=1
  else:
    ym=0
elif n[2]=="1":
  if int(n[3])==1 or int(n[3])==2:
    ym=1
  else:
    ym=0
else:
  ym=0
if my and ym:
  print("AMBIGUOUS")
elif my:
  print("MMYY")
elif ym:
  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):
def m(ss):
    if ss > 0 and ss <= 12:
        return 1
    return 0

s = list(input())
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
print(s1,s2)
if m(s1) and m(s2):
    print("AMBIGUOUS")
elif m(s1) and not(m(s2)):
    print("MMYY")
elif not(m(s1)) and m(s2):
    print("YYMM")
else:
    print("NA")

def m(ss):
    if ss > 0 and ss <= 12:
        return 1
    return 0

s = list(input())
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
#print(s1,s2)
if m(s1) and m(s2):
    print("AMBIGUOUS")
elif m(s1) and not(m(s2)):
    print("MMYY")
elif not(m(s1)) and m(s2):
    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):
a = input()
b=int(a[0:2])
c=int(a[2:4])
if 0<b<=12 & 0<c<=12:
    print('AMBIGUOUS')
elif 0<b<=12 & (c>12 or C ==0) :
    print('MMYY') 
elif (b>12 or b==0) & 0<c<=12:
    print('YYMM')
else:
    print('NA')

a = input()
b=int(a[0:2])
c=int(a[2:4])
if 1<=b<=12 and 1<=c<=12:
    print('AMBIGUOUS')
elif 1<=b<=12 :
    print('MMYY') 
elif 1<=c<=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):
a,b,c,d = input()

li1 = [a,b]
li2 = [c,d]

int1 = int(''.join(li1))
int2 = int(''.join(li2))

if (int1 > 12 and int2 > 12):
    ans = 'NA'
elif (int1 == 0 and int2 == 0):
    ans = 'NA'
elif (int1 > 12 and int2 == 0):
    ans = 'NA'
elif (int1 > 12):
    ans = 'YYMM'
elif (int2 > 12 and int1 == 0):
    ans = 'NA'
elif (int2 > 12):
    ans = 'MMYY'
elif:
    ans = 'AMBIGUOUS'

print(ans)


a,b,c,d = input()

li1 = [a,b]
li2 = [c,d]

int1 = int(''.join(li1))
int2 = int(''.join(li2))

if (int1 in range(1,13)) and (int2 in range(1,13)):
    ans = 'AMBIGUOUS'
elif (int1 in range(1,13)) and (int2 not in range(1,13)):
    ans = 'MMYY'
elif (int2 in range(1,13)) and (int1 not in range(1,13)):
    ans = 'YYMM'
else:
    ans = 'NA'

print(ans)


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()

Z = int(S[0]) + int(S[1])
K = int(S[2]) + int(S[3])


if(1 <= Z <= 12):
    
    if(1 <= K <= 9):
        print("AMBIGUOUS")
    elif(10 <= K <= 12):
        print("AMBIGUOUS")
    else:
        print("MMYY")


else:
    
    if(1 <= K <= 9):
        print("YYMM")
    elif(10 <= K <= 12):
        print("YYMM")
    else:
        print("NA")

S = input()

if(S[0] == 0):
    Z = int(S[1])
else:
    Z = S[0] + S[1]
    X = int(Z)

if(S[2] == 0):
    K = int(S[3])
else:
    K = S[2] + S[3]
    Y = int(K)

if(1 <= X <= 12):
    if(1 <= Y <= 12):
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if(1 <= Y <= 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 = input()

fr_half = int(S[0:2]) 
se_half = int(S[2::])

if se_half > 0 and se_half <= 12:
	if fr_half  > 0 and fr_half <= 12:
		print('AMBIGUOUS')
  	else:
		print('YYMM')
else:
	if fr_half  > 0 and fr_half <= 12:
		print('MMYY')
	else:
		print('NA')

S = input()

fr_half = int(S[0:2]) 
se_half = int(S[2::])

if se_half > 0 and se_half <= 12:
  if fr_half  > 0 and fr_half <= 12:
    print('AMBIGUOUS')
  else:
    print('YYMM')
else:
  if fr_half  > 0 and fr_half <= 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):
S = int(input())
A = S//100
B = S-(A*100)
if B >12:
    if  A > 13:    
        print("YYMM")
    else A <=12:
        print("MMYY")
elif 1<= B <=12:
    if A >13:
        print("YYMM")
    else A <=12:
        print("AMBIGUOUS")
else :
    print("NA")


S = int(input())
A = S//100
B = S-(A*100)
if B ==0 or B >= 13:
    if 1<= A <=12:    
        print("MMYY")
    else:
        print("NA")
elif 1<= B <=12:
    if 1<= A <=12:
        print("AMBIGUOUS")
    elif A >= 13:
        print("YYMM")
    elif A == 0:      
        print("YYMM")
    else:
        print("NA")
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):
X = input()

X1 = 10*int(X[0]) + int(X[1])
X2 = 10*int(X[2]) + int(X[3])

if (1 <= X1 <= 12) and ((X2 > 12) or (X2 == 0)):
    print("MMYY")
elif ((X2 > 12) or (X2 == 0)) and (1 <= X1 <= 12):
    print("YYMM")
elif (1 <= X1 <= 12) and (1 <= X2 <= 12):
    print("AMBIGUOUS")
else:
    print("NA")

X = input()

X1 = 10*int(X[0]) + int(X[1])
X2 = 10*int(X[2]) + int(X[3])

if (1 <= X1 <= 12) and ((X2 > 12) or (X2 == 0)):
    print("MMYY")
elif ((X2 > 12) or (X2 == 0) and (1 <= X1 <= 12):
    print("YYMM")
elif (1 <= X1 <= 12) and (1 <= X2 <= 12):
    print("AMBIGUOUS")
else:
    print("NA")

X = input()

X1 = 10*int(X[0]) + int(X[1])
X2 = 10*int(X[2]) + int(X[3])
if (1 <= X1 <= 12) and ((X2 > 12) or (X2 == 0)):
    print("MMYY")
elif ((X1 > 12) or (X1 == 0)) and (1 <= X2 <= 12):
    print("YYMM")
elif (1 <= X1 <= 12) and (1 <= X2 <= 12):
    print("AMBIGUOUS")
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 = input()

front = s[:2]
back =s[2:]

if (front == "00" or back == "00") or (front > 13 and back >13):
    print("NA")
elif 1 <= int(back) <= 12:
    if 1 <= int() <= 12:
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    print("MMYY")

s = input()

front = int(s[:2])
back = int(s[2:])

if 1 <= front <= 12:
    if 1 <= back <=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1<= back <= 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):
def main():
    s = list(input())
    left = int(s[0] + s[1])
    right = int(s[2] + s[3])

    if 1 <= left and left <= 12:
        if 1 <= right and right <= 12:
            return "AMIGUOUS"
        else:
            return "MMYY"
    else:
        if 1 <= right and right <= 12:
            return "MMYY"
        else:
            return "NA"

print(main())


def main():
    s = list(input())
    left = int(s[0] + s[1])
    right = int(s[2] + s[3])

    if 1 <= left and left <= 12:
        if 1 <= right and right <= 12:
            return "AMBIGUOUS"
        else:
            return "MMYY"
    else:
        if 1 <= right and right <= 12:
            return "YYMM"
        else:
            return "NA"

print(main())


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()

bef = int(S[:2])
aft = int(S[2:])

ansb = ''
ansa = ''
print(bef,aft)

if bef == 0 or aft == 0:
    ans = 'NA'
elif bef > 31:
    if aft > 31:
        ans = 'NA'
    elif aft <= 31:
        ans = 'YYMM'
elif 12 < bef <= 31:
    if aft > 31:
        ans = 'MMYY'
    elif 12 < aft <= 31:
        ans = 'AMBIGUOUS'
    elif aft <= 12:
        ans = 'YYMM'
elif bef <= 12:
    if aft > 12:
        ans = 'MMYY'
    elif aft <= 12:
        ans = 'AMBIGUOUS'

print(ans)


S = input()

bef = int(S[:2])
aft = int(S[2:])

ansb = ''
ansa = ''

if bef == 0:
    if aft > 31:
        ans = 'NA'
    elif 12 < aft <= 31:
        ans = 'NA'
    elif 0 < aft <= 12:
        ans = 'YYMM'
    elif aft == 0:
        ans = 'NA'
elif bef > 31:
    if aft > 31:
        ans = 'NA'
    elif 12 < aft <= 31:
        ans = 'YYMM'
    elif 0 < aft <= 12:
        ans = 'YYMM'
    elif aft == 0:
        ans = 'NA'
elif 12 < bef <= 31:
    if aft > 31:
        ans = 'MMYY'
    elif 12 < aft <= 31:
        ans = 'AMBIGUOUS'
    elif 0 < aft <= 12:
        ans = 'YYMM'
    elif aft == 0:
        ans = 'NA'
elif bef <= 12:
    if aft > 31:
        ans = 'MMYY'
    elif 12 < aft <= 31:
        ans = 'AMBIGUOUS'
    elif 0 < aft <= 12:
        ans = 'AMBIGUOUS'
    elif aft == 0:
        ans = 'MMYY'
print(ans)

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


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

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

s = int(input())
s_1 = s // 100 
s_2 = s % 100  

if 1 <= s_1 <=12 and 1 <= s_2 <= 12:
    print("AMBIGUOUS")
elif 1 <= s_1 <= 12:
    print("MMYY")
elif 1 <= s_2 <= 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):
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")


a = input()
b = int(a[:2])
c = int(a[2:])
if 1 <= b <= 12 and 1 <= c <= 12:
    print("AMBIGUOUS")
elif 1 <= b <= 12:
    print("MMYY")
elif 1 <= c <= 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):
N,K = map(int, input().split())

S = input()
S_bef = int(S[:2])
S_aft = int(S[-2:])

is_bef_yy = False
is_bef_mm = False
is_aft_yy = False
is_aft_mm = False

if S_bef >= 1 and S_bef <= 12:
    is_bef_mm = True
if S_bef >= 0:
    is_bef_yy = True
if S_aft >= 1 and S_aft <= 12:
    is_aft_mm = True
if S_aft >= 0:
    is_aft_yy = True

if is_bef_yy and is_bef_mm and is_aft_yy and is_aft_mm:
    print('AMBIGUOUS')
elif is_bef_yy and is_aft_mm:
    print('YYMM')
elif is_aft_yy and is_bef_mm:
    print('MMYY')
else:
    print('NA')



S = input()
S_bef = int(S[:2])
S_aft = int(S[-2:])

is_bef_yy = False
is_bef_mm = False
is_aft_yy = False
is_aft_mm = False

if S_bef >= 1 and S_bef <= 12:
    is_bef_mm = True
if S_bef >= 0:
    is_bef_yy = True
if S_aft >= 1 and S_aft <= 12:
    is_aft_mm = True
if S_aft >= 0:
    is_aft_yy = True

if is_bef_yy and is_bef_mm and is_aft_yy and is_aft_mm:
    print('AMBIGUOUS')
elif is_bef_yy and is_aft_mm:
    print('YYMM')
elif is_aft_yy and is_bef_mm:
    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):
a=int(input())
if int(a[0])==0 and a[1]==0:
  print('NA')
elif int(a[2])==0 and a[3]==0:
  print('NA')
elif int(a[0])>=2:
  print ('YYMM')
elif int(a[0])>=1 and a[1]>=3:
  print('YYMM')
elif int(a[2])>=2:
  print ('MMYY')
elif int(a[2])>=1 and a[3]>=3:
  print('MMYY')


a=int(input())
if a[0]==0 and a[1]==0:
  print('NA')
elif a[2]==0 and a[3]==0:
  print('NA')
elif a[0]>=2:
  print ('YYMM')
elif a[0]>=1 and a[1]>=3:
  print('YYMM')
elif a[2]>=2:
  print ('MMYY')
elif a[2]>=1 and a[3]>=3:
  print('MMYY')


a=int(input())
if a[0]==0 and a[1]==0:
  print('NA')
elif a[2]==0 and a[3]==0:
  print('NA')
elif a[0]>=2:
  print ('YYMM')
elif a[0]>=1 and a[1]>=3:
  print('YYMM')
elif a[2]>=2:
  print ('MMYY')
elif a[2]>=1 and a[3]>=3:
  print('MMYY')


a=input()
if a[0]==0 and a[1]==0:
  print('NA')
elif a[2]==0 and a[3]==0:
  print('NA')
elif a[0]>=2:
  print ('YYMM')
elif a[0]>=1 and a[1]>=3:
  print('YYMM')
elif a[2]>=2:
  print ('MMYY')
elif a[2]>=1 and a[3]>=3:
  print('MMYY')

a=int(input())
if a[0]==0 and a[1]==0:
  print('NA')
elif a[2]==0 and a[3]==0:
  print('NA')
elif a[0]>=2:
  print ('YYMM')
elif a[0]>=1 and a[1]>=3:
  print('YYMM')
elif a[2]>=2:
  print ('MMYY')
elif a[2]>=1 and a[3]>=3:
  print('MMYY')


S=input()
ab=int(S[0]+S[1])
cd=int(S[2]+S[3])
if ab==0:
  if cd==0:#0000
    print('NA')
  elif cd>=1 and cd<=12:
    #0001~0012
    print('YYMM')
  else: #0013~0099
    print('NA')
elif ab>=1 and ab<=12:
  if cd ==0:
    print('MMYY')
  elif cd>=1 and cd<=12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if cd>=1 and cd<=12:
    print('YYMM')
  else:
    print("NA")

Verdicts: Runtime Error

Runtime Error

Runtime Error

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):
a, b, c, d = list(input())
if 0 < 10*a + b <= 12 and 0 < c*10 + d <= 12:
    print('AMBIGUOUS')
elif 10*a + b >= 12 and 0 < c*10 + d <= 12:
    print('YYMM')
elif 0 < 10*a + b <= 12 and c*10 + d >= 12:
    print('MMYY')
else:
    print('NA')

a, b, c, d = list(input())
a = int(a)
b = int(b)
c = int(c)
d = int(d)
if 0 < 10*a + b <= 12 and 0 < c*10 + d <= 12:
    print('AMBIGUOUS')
elif (10*a + b >= 12 or a + b == 0) and 0 < c*10 + d <= 12:
    print('YYMM')
elif 0 < 10*a + b <= 12 and (c*10 + d >= 12 or c + d == 0):
    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 re 
S=input()
def YM(S):
  if re.match("(1[3-9]|[2-9][0-9])(0[1-9]|1[0-2])",S):
    print("YYMM")
  elif re.match("(0[1-9]|1[0-2])(1[3-9]|[2-9][0-9])",S):
    print("MMYY")
  else:
    print("AMBIGUOUS")

print("{}".format(YM(S)))

import re 
S=input()
def YM(S):
  if re.match("(1[3-9]|[2-9][0-9])(0[1-9]|1[0-2])",S):
    print("YYMM")
  elif re.match("(0[1-9]|1[0-2])(1[3-9]|[2-9][0-9])",S):
    print("MMYY")
  else:
    print("AMBIGUOUS")

import re 
S=input()
def YM(S):
  if re.match("(00|1[3-9]|[2-9][0-9])(0[1-9]|1[0-2])",S):
    return "YYMM"
  elif re.match("(0[1-9]|1[0-2])(00|1[3-9]|[2-9][0-9])",S):
    return "MMYY"
  elif re.match("(0[1-9]|1[0-2])(0[1-9]|1[0-2])",S):
    return "AMBIGUOUS"
  else:
    return "NA"
print("{}".format(YM(S)))

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):
A = str(input())
AC = list(A)
AB = int(A[0] + A[1])
AC = int(A[2] + A[3])

if AB > 13:
    if AC == 0:
        print("NA")
    else:
        print("YYMM")
if 1 <= AB <= 12:
    if AC == 0:
        print("NA")
    else:
        print("MMYY")
else:
    print("AMBIGUOUS")

A = str(input())
AC = list(A)
AB = int(A[0] + A[1])
AC = int(A[2] + A[3])

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

N = int(input())

if 199 <= N <= 1299:
    if 9901 <= N <= 9912:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 9901 <= N <= 9912:
    print("YYMM")
else:
    print("NA")

A = str(input())
AC = list(A)
AB = A[0] + A[1]
AC = A[2] + A[3]

if 1 <= AB <= 12:
    if 1 <= AC <= 99:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 1 <= AC <= 12:
     if 1 <= AB <= 99:
        print("AMBIGUOUS")
    else:
        print("YYMM")
elif AB == 0 or AB >= 13:
    if AC == 0 or AC >= 13:
        print("NA")

A = str(input())
AC = list(A)
AB = int(A[0] + A[1])
AC = int(A[2] + A[3])

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

Verdicts: Wrong Answer

Wrong Answer

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=input()
f=int(s[:2])
b=int(s[2:])
print(f,b)
if f>=13:
	if 0<b and b<13:
		print("YYMM")
	else:
		print("NA")
elif 0<f and f<13:
	if 0<b and b<13:
		print("AMBIGUOUS")
	else:
		print("MMYY")
else:
	print("NA")

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

s=input()
f=int(s[:2])
b=int(s[2:])
if f>=13 or f==0:
	if 0<b and b<13:
		print("YYMM")
	else:
		print("NA")
elif 0<f and f<13:
	if 0<b and b<13:
		print("AMBIGUOUS")
	else:
		print("MMYY")
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):

s = input()
sa = int(s[:2])
sb = int(s[3:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
if sa > 12 and sb > 12:
    print('NA')
    exit()
if sa >= 1 and sa <= 12 and sb > 12:
    print('MMYY')
    exit()
if sa > 12 and sb >= 1 sb <= 12:
    print('YYMM')
    exit()



s = input()
sa = int(s[:2])
sb = int(s[3:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
else
    if sa >= 1 and sa <= 12:
        print('MMYY')
        exit()
    if sb >= 1 and sb <= 12:
        print('YYMM')
        exit()

print('NA')


s = input()
sa = int(s[:2])
sb = int(s[2:])

if sa >= 1 and sa <= 12 and sb >= 1 and  sb <= 12:
    print('AMBIGUOUS')
    exit()
else:
    if sa >= 1 and sa <= 12:
        print('MMYY')
        exit()
    if sb >= 1 and sb <= 12:
        print('YYMM')
        exit()

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 = int,(input())
a = s//100
b = s%100

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

s = int(input())
a = s//100
b = s%100

if 1 <= a <= 12:
  if 1 <= b <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1 <= b <= 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):
s = int(input())

a = int(s/100)
b = s % 100

fa, fb = False, False
if a in range(1, 13):
    fa = True

if b in range(1, 13):
    fb = True

if fa and fb:
    print('AMBIGUOUS')
elif fa and not fb:
    print('MMYY')
elif not fb and fa:
    print('YYMM')
else:
    print('NA')


s = int(input())

a = int(s/100)
b = s % 100

fa, fb = False, False
if a in range(1, 13):
    fa = True

if b in range(1, 13):
    fb = True

if fa and fb:
    print('AMBIGUOUS')
elif fa and not fb:
    print('MMYY')
elif not fb and fa:
    print('YYMM')
else:
    print('NO')


s = int(input())
a = int(s/100)
b = s % 100

fa, fb = False, False
if a in range(1, 13):
    fa = True

if b in range(1, 13):
    fb = True

if fa and fb:
    print('AMBIGUOUS')
elif fa and not fb:
    print('MMYY')
elif not fa and fb:
    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):
S=input()
FF=int(S[0]+S[1])
LL=int(S[2]+S[3])
f=False
l=False
month=list(range(1,13))


if FF in month:
    f=True
if LL in month:
    l=True

if FF and LL:
    print('AMBIGUOUS')
    exit(0)
if FF:
    print('MMYY')
elif LL:
    print('YYMM')
else:
    print('NA')


S=input()
FF=int(S[0]+S[1])
LL=int(S[2]+S[3])

if FF<13 and LL<13 and FF!=00 and LL!=00:
    print('AMBIGUOUS')
    exit(0)
elif  (FF>12 or FF==00) and (LL<13 and LL>0):
    print('YYMM')
    exit(0)
elif  (LL>12 or LL==00) and (FF<13 and FF>0):
    print('MMYY')
    exit(0)
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):
#coding: utf-8
S = input()
year = 19
month = 12
mae, ushiro = S[:2], S[2:]
if 0 < mae <= month and 0 < ushiro <= month:
	print("AMBIGUOUS")
elif 0 < mae <= month and 0 < ushiro <= year:
	print("MMYY")
elif 0 < mae <= year and 0 < ushiro <= month:
	print("YYMM")
else:
	print("NA")

#coding: utf-8
S = input()
year = 99
month = 12
mae = int(S[2:])
ushiro = int(S[2:])

if 0 < mae <= month and 0 < ushiro <= month:
    print("AMBIGUOUS")
elif 0 < mae <= month and month < ushiro <= year:
	print("MMYY")
elif month < mae <= year and 0 < ushiro <= month:
	print("YYMM")
else:
	print("NA")

#coding: utf-8
S = input()
year = 99
month = 12
mae = int(S[2:])
ushiro = int(S[2:])
if 0 < mae <= month and 0 < ushiro <= month:
    print("AMBIGUOUS")
elif 0 < mae <= month and 0 < ushiro <= year:
	print("MMYY")
elif 0 < mae <= year and 0 < ushiro <= month:
	print("YYMM")
else:
	print("NA")

#coding: utf-8
S = input()
year = 99
month = 12
mae, ushiro = int(S[:2]), int(S[2:])
if 0 < mae <= month and 0 < ushiro <= month:
	print("AMBIGUOUS")
elif 0 < mae <= month and 0 <= ushiro <= year:
	print("MMYY")
elif 0 <= mae <= year and 0 < ushiro <= month:
	print("YYMM")
else:
	print("NA")


Verdicts: Runtime Error

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 = int(input())
yymm = S//100
mmyy = S%100
yymm = (1<=y<=12)
mmyy = (1<=x<=12)

ans = "NA"
if yymm and mmyy:
    answer = 'AMBIGUOUS'
elif yymm and not(mmyy):
    answer = 'YYMM'
elif mmyy and not(yymm):
    answer = 'MMYY'

print(ans)  

S = int(input())
x = S//100
y = S%100
yymm = (1<=y<=12)
mmyy = (1<=x<=12)

ans = "NA"
if yymm and mmyy:
    ans = 'AMBIGUOUS'
elif yymm and not(mmyy):
    ans = 'YYMM'
elif mmyy and not(yymm):
    ans = 'MMYY'

print(ans)  

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 = list(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 b>12 and 1<=a<=12:
  print('MMYY')
elif a>12 and b>12:
  print('NA')
elof a<0 and b<0:
  print('NA')

s = input()

s1 = int(s[0])*10 + int(s[1])
s2 = int(s[2])*10 + int(s[3])
#print(s1, s2)
if  (s1>12 or s1==0) and (s2>12 or s2==0):
  print('NA')
elif (s1>12 or s1==0) and 1<=s2<=12:
  print('YYMM')
elif (s2>12 or s2==0) and 1<=s1<=12:
  print('MMYY')
elif 1<=s1<=12 and 1<=s2<=12:
  print('AMBIGUOUS')

Verdicts: Runtime Error

Accepted