qyliang/CodeNanoFix huggingface dataset:
Buggy code:
s=input()
ans=''
if 0<int(s[:2])<=12 and 0<int(s[2:])<=12:
  ans='AMBIGUOUS'
elif int(s[:2])>12 or int(s[:2])==0 and 0<int(s[2:])<=12:
  ans='YYMM'
elif 0<int(s[:2])<=12 and int(s[2:])>12 or int(s[2:])==0:
  ans='MMYY'
else:
  ans='NA'
print(ans)

Fixed code:
s=input()
ans=''
if 0<int(s[:2])<=12 and 0<int(s[2:])<=12:
  ans='AMBIGUOUS'
elif 0<int(s[2:])<=12:
  if int(s[:2])>12 or int(s[:2])==0:
    ans='YYMM'
elif 0<int(s[:2])<=12:
  if int(s[2:])>12 or int(s[2:])==0:
    ans='MMYY'
else:
  ans='NA'
print(ans)
Buggy code:
S = input()
s_1 = S[:2]
s_2 = S[2:]

if 0 < s_1 < 13 and 0 < s_2 < 13:
  print("AMBIGUOUS")
elif 0 < s_1 < 13:
  print("MMYY")
elif 0 < s_2 < 13:
  print("YYMM")
else:
  print("NA")

Fixed code:
S = input()
s_1 = int(S[:2])
s_2 = int(S[2:])

if 0 < s_1 < 13 and 0 < s_2 < 13:
  print("AMBIGUOUS")
elif 0 < s_1 < 13:
  print("MMYY")
elif 0 < s_2 < 13:
  print("YYMM")
else:
  print("NA")
Buggy code:
s = input()
sl = list(map(int, [s[0:2],s[2:]]))
f,l = sl[0], sl[1]
if (f ==0 and (l ==0 or l >12)) or (l ==0 and (f==0 or f>12)) :
    print('NA')
elif  f < 13 and l <13:
    print('AMBIGOOUS')
elif f >12 and l <13:
    print('YYMM')
elif f<13 and l>12:
    print('MMYY')
else :
    print('NA')

Fixed code:
s = input()
sl = list(map(int, [s[0:2],s[2:]]))
f,l = sl[0], sl[1]
if (f ==0 and (l ==0 or l >12)) or (l ==0 and (f==0 or f>12)) :
    print('NA')
elif (f>12 and l<13) or f==0:
    print('YYMM')
elif (f<13 and l>12) or l==0:
    print('MMYY')
elif f < 13 and l <13:
    print('AMBIGUOUS')
else:
  print('NA')
Buggy code:
S = input()
year_list = ["01","02","03","04","04","05","06","07","08","09","10","11","12"]

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

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

if S[0:2] in month_list:
    if S[2:4] in month_list:
        print("AMBIGUOUS")
    else:
        print("MMYY")

else:
    if S[2:4] in month_list:
        print("YYMM")
    else:
        print("NA")
Buggy code:
s = input()
f, b = int(s[:2]), int(s[2:])
if ((0 < f and f <= 12) and (b > 12 or b == 0)): print("MMYY")
elif ((0 < b and b <= 12) and (f > 12 or f == 0)): print("YYMM")
if (f == 0 and b == 0 or (f > 12 and b > 12)): print("NA")
else: print("AMBIGUOUS")


Fixed code:
s = input()
f, b = int(s[:2]), int(s[2:])
if ((0 < f and f <= 12) and (b > 12 or b == 0)): print("MMYY")
elif ((0 < b and b <= 12) and (f > 12 or f == 0)): print("YYMM")
elif (f == 0 or b == 0 or (f > 12 and b > 12)): print("NA")
else: print("AMBIGUOUS")
Buggy code:
s = list(input())
def month(i):
  if "1" <= i <='12':
    return True
  else:
    return False
a = month("".join(s[0:2]))
b = month("".join(s[2:4]))
if a and b:
  print('AMBIGUOUS')
elif not a and b:
  print('YYMM')
elif a and not b:
  print('MMYY')
else:
  print('NA')
  
  
  

Fixed code:
s = list(input())
def month(i):
  if 1 <= int(i) <=12:
    return True
  else:
    return False
a = month("".join(s[0:2]))
b = month("".join(s[2:4]))
if a and b:
  print('AMBIGUOUS')
elif not a and b:
  print('YYMM')
elif a and not b:
  print('MMYY')
else:
  print('NA')
Buggy code:
S = input()
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")

Fixed code:
S = input()
if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12:
  print("AMBIGUOUS")
elif 1 <= int(S[:2]) <= 12:
  print("MMYY")
elif 1 <= int(S[2:]) <= 12:
  print("YYMM")
else:
  print("NA")
Buggy code:

s = input()

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

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

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

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

print(out_print)

Fixed code:
s = input()

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

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

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

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

elif int(n1) > 12 and int(n2) <= 12:
    out_print = 'YYMM'
    if int(n2) == 0:
        out_print = 'NA'
print(out_print)
Buggy code:
s = input()
upper_input = int(s[:2])
lower_input = int(s[2:])

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

Fixed code:
s = input()
upper_input = int(s[:2])
lower_input = int(s[2:])

if upper_input >= 1 and upper_input<= 12:
  if lower_input >= 1 and lower_input <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if lower_input >= 1 and lower_input <= 12:
    print('YYMM')
  else:
    print('NA')
Buggy code:
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")

Fixed code:
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")
Buggy code:
S = list(input())

S1 = int(S[0]+S[1])
S2 = int(S[2]+S[3])
#print(S1,S2)
if((S1 == 0 and S2 == 0) or (S1 > 12 and S2 > 12)):
    print('NA')
elif(S1 == 0 or S2 ==0):
    if(S1 < 13 and S1 > 0):
        print('MMYY')
    elif(S2 < 13 and S2 > 0):
        print('YYMM')
elif(S1 < 13 and S2 < 13):
    print('AMBIGUOUS')
elif(S1 < 13 and S1 > 0):
    print('MMYY')
elif(S2 < 13 and S2 > 0):
    print('YYMM')


Fixed code:
S = list(input())

S1 = int(S[0]+S[1])
S2 = int(S[2]+S[3])

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

Fixed code:
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')
Buggy code:
S = input()
a = int(S[:2])
b = int(S[2:])

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

Fixed code:
S = input()
a = int(S[:2])
b = int(S[2:])

if 1 <= a and a <= 12 and 1 <= b and b <= 12:
    print("AMBIGUOUS")
elif 1 <= a and a <= 12 and (b > 12 or b < 1):
    print("MMYY")
elif (a > 12 or a < 1) and 1 <= b and b <= 12:
    print("YYMM")
else:
    print("NA")
Buggy code:
judge_num = input()
 
bef = int(judge_num[:2])
aft = int(judge_num[2:])
 
if(bef <= 12 and aft <= 12):
  print("AMBIGUOUS")
elif(bef <= 12):
  print("MMYY")
elif(aft <= 12):
  print("YYMM")
else:
  print("NA")

Fixed code:
judge_num = input()
 
bef = int(judge_num[:2])
aft = int(judge_num[2:])
 
if(bef <= 12 and aft <= 12 and bef >= 1 and aft >= 1):
  print("AMBIGUOUS")
elif(bef <= 12 and bef >= 1):
  print("MMYY")
elif(aft <= 12 and aft >= 1):
  print("YYMM")
else:
  print("NA")
Buggy code:
S = input()
if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12:
    print("AMBIGUOUS")
elif int(S[:2]) > 12:
    print("YYMM")
elif int(S[2:]) > 12:
    print("MMYY")
else:
    print("NA")

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

head = int(s[:2])
tail = int(s[2:])

if 0 < head <= 12 and 0 < tail <= 12:
  print("AMBIGUOUS")

elif 0 < head <= 12:
  print("MMYY")
elif 0 < tail <= 12:
  print("YYMM")
elif :
  print("NA")


Fixed code:
s = input()

head = int(s[:2])
tail = int(s[2:])

if 0 < head <= 12 and 0 < tail <= 12:
  print("AMBIGUOUS")

elif 0 < head <= 12:
  print("MMYY")

elif 0 < tail <= 12:
  print("YYMM")

else :
  print("NA")
Buggy code:
s = input()
ym = [s[i*2:i*2+2] for i in range(2)]

if int(ym[0]) < 13 and int(ym[1]) < 13:
  print("AMBIGUOUS")
elif int(ym[1]) < 13:
  print("YYMM")
elif int(ym[0]) < 13:
  print("MMYY")
else:
  print("NA")

Fixed code:
s = input()
ym = [s[i*2:i*2+2] for i in range(2)]

if 0 < int(ym[0]) and 0 < int(ym[1]) and int(ym[0]) < 13 and int(ym[1]) < 13:
  print("AMBIGUOUS")
elif 0 < int(ym[1]) and int(ym[1]) < 13:
  print("YYMM")
elif 0 < int(ym[0]) and int(ym[0]) < 13:
  print("MMYY")
else:
  print("NA")
Buggy code:
S = int(input())
A = S // 100
B = S % 100
MMA = False
MMB = False
if 1 <= A and A <= 12:
  MMA = True
if 1 <= B and B <= 12:
  MMB = True

if MMA and MMB:
  print(AMBIGUOUS)
elif MMA and not(MMB):
  print('MMYY')
elif not(MMA) and MMB:
  print('YYMM')
else:
  print('NA')

Fixed code:
S = int(input())
A = S // 100
B = S % 100
MMA = False
MMB = False
if 1 <= A and A <= 12:
  MMA = True
if 1 <= B and B <= 12:
  MMB = True

if MMA and MMB:
  print('AMBIGUOUS')
elif MMA and not(MMB):
  print('MMYY')
elif not(MMA) and MMB:
  print('YYMM')
else:
  print('NA')
Buggy code:
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')

Fixed code:
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')
Buggy code:
s = input()

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

Fixed code:
s = input()

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

first = int(N/100)
second = N - first*100

f_YY = False
s_YY = False
f_MM = False
s_MM = False

if 0 <= first and first <= 99:
    f_YY = True
if 0 <= second and second <= 99:
    s_YY = True
    
if 1 <= first and first <= 12:
    f_MM = True
if 1 <= second and second <= 12:
    s_MM = True
        
print(f_YY,s_YY,f_MM,s_MM)
    
if (f_YY == True and s_MM == True) and\
    (f_MM == True and s_YY == True):
    print('AMBIGUOUS')
elif f_YY == True and s_MM == True:
    print('YYMM')
elif f_MM == True and s_YY == True:
    print('YYMM')
else:
    print('NA')

Fixed code:
N = int(input())

first = int(N/100)
second = N - first*100

f_YY = False
s_YY = False
f_MM = False
s_MM = False

if 0 <= first and first <= 99:
    f_YY = True
if 0 <= second and second <= 99:
    s_YY = True
if 1 <= first and first <= 12:
    f_MM = True
if 1 <= second and second <= 12:
    s_MM = True
    
if (f_YY == True and s_MM == True) and\
    (f_MM == True and s_YY == True):
    print('AMBIGUOUS')
elif f_YY == True and s_MM == True:
    print('YYMM')
elif f_MM == True and s_YY == True:
    print('MMYY')
else:
    print('NA')
Buggy code:
S = int(input())

before = S % 100
after = S //100

if after == 0 or before == 0:
  print("NA")
elif after >=31 or before >= 31:
  print("NA")
if before <= 12 and after <= 12:
  print("AMBIGUOUS")
elif before <= 12 and after > 12 and after <= 31:
  print("YYMM")
elif before > 12 and before <= 31 and after <= 12:
  print("MMYY")
else:
  print("NA")


Fixed code:
S = int(input())

after = S % 100
before = S //100

if after >31 and before > 31:
  print("NA")
else:
  if before <= 12 and before >0:
    if after <= 12 and after >0:
      print("AMBIGUOUS")
    else:
      print("MMYY")
  else:
    if after <= 12 and after > 0:
      print("YYMM")
    else:
      print("NA")
Buggy code:
S = str(input())
S1 = list(S)
S2 = (10*int(S[0])+int(S[1]),10*int(S[2])+int(S[3]))
if S2[0] <= 12 and S2[1] <= 12:
    print('AMBIGUOUS')
elif S2[0] <= 12 and S2[1] > 12:
    print('MMYY')
elif S2[0] > 12 and S2[1] <= 12:
    print('YYMM')
else:
    print('NA')

Fixed code:
S = str(input())
S1 = list(S)
S2 = (10*int(S[0])+int(S[1]),10*int(S[2])+int(S[3]))
if 0 < S2[0] <= 12:
    if 0 < S2[1] <= 12:
        print('AMBIGUOUS')
    elif S2[1] == 0 or S2[1] > 12:
        print('MMYY')
elif S2[0] == 0 or S2[0] > 12:
    if 0 < S2[1] <= 12:
        print('YYMM')
    elif S2[1] == 0 or S2[1] > 12:
        print('NA')
Buggy code:
A=input()
B=int(A[:2])
C=int(A[2:4])
if B<=12 and C<=12:
  print("AMBIGUOUS")
elif 12>=B>=1:
  print("YYMM")
elif 12>=C>=1:
  print("MMYY")
else:
  print("NA")

Fixed code:
A=input()
B=int(A[:2])
C=int(A[2:4])
  
if(1<=B<=12):
    if(1<=C<=12):
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif(1<=C<=12):
    print('YYMM')    
else:
    print('NA')
Buggy code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

s = input()

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

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


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

s = input()

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

if temp1 >= 1 and temp1 <= 12:
    if (temp2 < 1 or temp2 > 12):
        print("MMYY")
    else:
        print("AMBIGUOUS")
else:
    if (temp2 >= 1 and temp2 <= 12):
        print("YYMM")
    else:
        print("NA")
Buggy code:
s=input();print['NA','MMYY','YYMM','AMBIGUOUS'][(99<s<1300)-(0<s%100<13)*2]

Fixed code:
s=int(input());print(['NA','MMYY','YYMM','AMBIGUOUS'][(99<s<1300)-(0<s%100<13)*2])
Buggy code:
def main():
    s = input()
    mm1 = False
    mm2 = False

    if 0 < int(s[:2]) < 13:
        mm1 = True
    if 0 < int(s[-2:]) < 13:
        mm2 = True
    
    if mm1 == True and mm2 == True:
        print("AMBIGUOUS")
        return 
    if mm1 == False and mm2 == False:
        print("NA")
        return
    if mm1 == True and mm2 == False:
        print("MMYY")
        return
    if mm1 == True and mm2 == True:
        print("YYMM")
        return
    print("NA")

if __name__ == '__main__':
    main()

Fixed code:
def main():
    s = input()
    mm1 = False
    mm2 = False

    if 0 < int(s[:2]) < 13:
        mm1 = True
    if 0 < int(s[-2:]) < 13:
        mm2 = True
    
    if mm1 == True and mm2 == True:
        print("AMBIGUOUS")
        return 
    if mm1 == False and mm2 == False:
        print("NA")
        return
    if mm1 == True and mm2 == False:
        print("MMYY")
        return
    if mm1 == False and mm2 == True:
        print("YYMM")
        return
    print("NA")

if __name__ == '__main__':
    main()
Buggy code:
S = input()
f = int(S[:2])
s = int(S[2:])

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


Fixed code:
S = input()
f = int(S[:2])
s = int(S[2:])

if 1 <= f <= 12 and 1 <= s <= 12:
    print("AMBIGUOUS")
elif 1 <= f <= 12:
    print("MMYY")
elif 1 <= s <= 12:
    print("YYMM")
else:
    print("NA")
Buggy code:
S = input()
S1 = int(S[:1])
S2 = int(S[2:])

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

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

if (1 <= S1 <= 12) and (1 <= S2 <= 12):
	print('AMBIGUOUS')
elif (1 <= S1 <= 12):
	print('MMYY')
elif (1 <= S2 <= 12):
	print('YYMM')
else:
	print('NA')
Buggy code:
a = list(input())

A = a[0]+a[1]
B = a[2]+a[3]

if A == "00" or int(A) > 12:
  if B == "00" or int(B) > 12:
    print("NA")
  else:
    print("YYMM")
else:
  if B == "00" or int(B) > 12:
    print("MMYY")
  else:
    print("AMBIGOUS")
    

Fixed code:
a = list(input())
 
A = a[0]+a[1]
B = a[2]+a[3]
 
if A == "00" or int(A) > 12:
  if B == "00" or int(B) > 12:
    print("NA")
  else:
    print("YYMM")
else:
  if B == "00" or int(B) > 12:
    print("MMYY")
  else:
    print("AMBIGUOUS")
Buggy code:
S = input()
l,r = int(S[:2]),int(S[2:])
if 1 <= l <= 12 and 1 <= r <= 12:
	print("AMBICIOUS")
elif 1<=r<=12:
	print("YYMM")
elif 1<=l<=12:
	print("MMYY")
else:
	print("NA")

Fixed code:
S = input()
l,r = int(S[:2]),int(S[2:])
if 1 <= l <= 12 and 1 <= r <= 12:
	print("AMBIGUOUS")
elif 1<=r<=12:
	print("YYMM")
elif 1<=l<=12:
	print("MMYY")
else:
	print("NA")
Buggy code:
s = list(input())
head = int(s[0] + s[1])
tail = int(s[2] + s[3])
 
if 0 < tail < 13:
    print('YYMM')
elif 0 < head < 13:
    print('MMYY')
elif (0 < head < 13) and (0 < tail < 13):
    print('AMBIGUOUS')
else:
    print('NA')

Fixed code:
s = list(input())
head = int(s[0] + s[1])
tail = int(s[2] + s[3])

if (head == 0 or 12 < head < 100) and (0 < tail < 13):
    print('YYMM')
elif (0 < head < 13) and (tail == 0 or 12 < tail < 100):
    print('MMYY')
elif (0 < head < 13) and (0 < tail < 13):
    print('AMBIGUOUS')
else:
    print('NA')
Buggy code:
S = input()
b = 0 < int(S[0:2]) < 12
a = 0 < int(S[2:]) < 12

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

Fixed code:
S = input()
b = 0 < int(S[0:2]) <= 12
a = 0 < int(S[2:]) <= 12

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

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

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

ue2keta = S // 100
shita2keta = S % 100

if (0 < ue2keta < 13) & (shita2keta == 0) | (shita2keta > 12):
    print("MMYY")
elif (0 < shita2keta < 13) & (ue2keta == 0) | (ue2keta > 12):
    print("YYMM")
elif (0 < ue2keta < 13) & (0 < shita2keta < 13):
    print("AMBIGUOUS")
else:
    print("NA")



Fixed code:
S = int(input())

ue2keta = S // 100
shita2keta = S % 100

if (0 < ue2keta < 13) & ((shita2keta == 0) | (shita2keta > 12)):
    print("MMYY")
elif (0 < shita2keta < 13) & ((ue2keta == 0) | (ue2keta > 12)):
    print("YYMM")
elif (0 < ue2keta < 13) & (0 < shita2keta < 13):
    print("AMBIGUOUS")
else:
    print("NA")
Buggy code:
s=input()
YY=[]
MM=["01","02","03","04","05","06","07","08","09","10","11","12"]

for i in range(13,100):
    YY.append(str(i))

if s[:2] in YY and s[2:] in MM:
    print("YYMM")
elif s[:2] in MM and s[2:] in YY:
    print("MMYY")

elif s[:2] in MM and s[2:] in MM:
    print("AMBIGUOUS")
elif s[:2] in YY and s[2:] in YY:
    print("NA")


Fixed code:
s=input()
YY=["00"]
MM=["01","02","03","04","05","06","07","08","09","10","11","12"]

for i in range(13,100):
    YY.append(str(i))

if s[:2] in YY and s[2:] in MM:
    print("YYMM")
elif s[:2] in MM and s[2:] in YY:
    print("MMYY")
elif s[:2] in MM and s[2:] in MM:
    print("AMBIGUOUS")
else:
    print("NA")
Buggy code:

n=int(input())
n_1=n//100
n_2=n%100

if  1<=n_1<=12 :
            print('MMYY')
elif 1<=n_1<=12 and 1<=n_2<=12:
            print('AMBIGUOUS')
elif 1<=n_2<=12:
            print('YYMM')
else:
            print('NA')


Fixed code:

n=int(input())
n_1=n//100
n_2=n%100

if  1<=n_1<=12 and not(1<=n_2<=12):
            print('MMYY')
elif 1<=n_1<=12 and 1<=n_2<=12:
            print('AMBIGUOUS')
elif 1<=n_2<=12 and not(1<=n_1<=12):
            print('YYMM')
else:
            print('NA')
Buggy code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

S = int(input())

# YYMM: XX00~XX12
# MMYY: 00YY~12YY
yymm = 0
mmyy = 0

if S % 100 <= 12:
    yymm = 1
if S // 100 <= 12:
    mmyy = 1

if yymm == 1 and mmyy == 1:
    print('AMBIGUOUS')
elif yymm == 1 and mmyy != 1:
    print('YYMM')
elif yymm != 1 and mmyy == 1:
    print('MMYY')
else:
    print('NA')

Fixed code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-

S = int(input())

# YYMM: XX01~XX12
# MMYY: 01YY~12YY
yymm = 0
mmyy = 0

if S % 100 <= 12 and S % 100 != 0:
    yymm = 1
if S // 100 <= 12 and S // 100 != 0:
    mmyy = 1

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

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

left=int(S[:2])
right=int(S[2:])

YYMM=True
MMYY=True
AMBIGUOUS=True
NA=True


if leftL<=0 or left>12:
  MMYY=False
  AMBIGUOUS=False
else:
  NA=False
  
if right<=0 or right>12:
  YYMM=False
  AMBIGUOUS=False
else:
  NA=False

if YYMM==True:
  if MMYY==True:
    print("AMBIGOUS")
  else:
    print("YYMM")
else:
  if MMYY==True:
    print("MMYY")
  else:
    print("NA")

Fixed code:
S=input()

left=int(S[:2])
right=int(S[2:])

YYMM=True
MMYY=True
AMBIGUOUS=True
NA=True


if left<=0 or left>12:
  MMYY=False
  AMBIGUOUS=False
else:
  NA=False
  
if right<=0 or right>12:
  YYMM=False
  AMBIGUOUS=False
else:
  NA=False


if YYMM==True:
  if MMYY==True:
    print("AMBIGUOUS")
  else:
    print("YYMM")
else:
  if MMYY==True:
    print("MMYY")
  else:
    print("NA")