qyliang/CodeNanoFix huggingface dataset:
Buggy code:
S = input()
num1 = int(S[:2])
num2 = int(S[2:])

if 1 <= num1 <= 12 and 1 <=  num2 <= 12:
    ans = "ABMIGUOUS"
elif 1 <= num1 <= 12 and (num2 == 0 or 12 < num2):
    ans = "MMYY"
elif (num1 == 0 or 12 < num1) and 1 <=  num2 <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)


Fixed code:
S = input()
num1 = int(S[:2])
num2 = int(S[2:])

if 1 <= num1 <= 12 and 1 <=  num2 <= 12:
    ans = "AMBIGUOUS"
elif 1 <= num1 <= 12 and (num2 == 0 or 12 < num2):
    ans = "MMYY"
elif (num1 == 0 or 12 < num1) and 1 <=  num2 <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)
Buggy code:
n=str(input())
a=int(n[0]+n[1])
print(a)
b=int(n[2]+n[3])
print(b)
if 1<=a<=12 and 1<=b<=12:
  print('AMBIGUOUS')
elif 1<=a<=12:
  print('YYMM')
elif 1<=b<=12:
  print('MMYY')
else:
  print('NA')

Fixed code:
n=str(input())
a=int(n[0]+n[1])
b=int(n[2]+n[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')
Buggy code:
# your code goes here\
s = input()
op = ''
first = s[0:2]
second = s[2:4]
if (0 < int(first) <= 12):
	op += 'MM'
elif (12 < int(first)):
	op += 'YY'
if (0 < int(second) <= 12):
	op += 'MM'
elif (12 < int(second)):
	op += 'YY'

if (len(s) != 4 or (first == '00' or second == '00')):
	op = 'NA'
elif (op == 'YYYY'):
	op = 'AMBIGUOUS'
print(op)
	

Fixed code:
# your code goes here\
s = input()
op = ''
first = s[0:2]
second = s[2:4]
if (0 < int(first) <= 12):
	op += 'MM'
else:
	op += 'YY'
if (0 < int(second) <= 12):
	op += 'MM'
else:
	op += 'YY'

if (len(s) != 4):
	op = 'NA'
elif (op == 'MMMM'):
	op = 'AMBIGUOUS'
elif (op == 'YYYY'):
	if ((second == '00' and first == '00') or int(second) > 12 or int(first) > 12):
		op = 'NA'
print(op)
Buggy code:
S = input()

s = list(S)
num = []
for k in s:
    num.append(int(k))

num1 = 10*num[0] + num[1]

num2 = 10*num[2] + num[3]

ans1 = False
ans2 = False
if num1 < 13 and num1 >0:
    ans1 = True

if num2 < 13 and num2 >0:
    ans2 = True

if ans1 and ans2:
    print("AMBIGUROUS")
elif ans1 and not ans2:
    print("MMYY")
elif not ans1 and ans2:
    print("YYMM")
else:
    print("NA")


Fixed code:
S = input()

s = list(S)
num = []
for k in s:
    num.append(int(k))

num1 = 10*num[0] + num[1]

num2 = 10*num[2] + num[3]

ans1 = False
ans2 = False
if num1 < 13 and num1 >0:
    ans1 = True

if num2 < 13 and num2 >0:
    ans2 = True

if ans1 and ans2:
    print("AMBIGUOUS")
elif ans1 and not ans2:
    print("MMYY")
elif not ans1 and ans2:
    print("YYMM")
else:
    print("NA")
Buggy code:
s = input()
mae = s[:2]
usiro = s[2:]
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")

Fixed code:
s = str(input())
mae = int(s[:2])
usiro = int(s[2:])
if 0 < mae < 13:
    if 0 <usiro < 13:
        print("AMBIGUOUS")
    else:
         print("MMYY")
elif 0 < usiro < 13:
         print("YYMM")
else:
    print("NA")
Buggy code:
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")

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

f = (0 < int(s[:2]) < 12)
s = (0 < int(s[2:]) < 12)
ans = 'NA'
if f:
    ans = 'YYMM'
elif s:
    ans = 'MMYY'
elif f and s:
    ans = 'AMBIGUOUS'
print(ans)


Fixed code:
s = input()

f = (0 < int(s[:2]) < 13)
s = (0 < int(s[2:]) < 13)
ans = 'NA'
if f and s:
    ans = 'AMBIGUOUS'
elif s:
    ans = 'YYMM'
elif f:
    ans = 'MMYY'
print(ans)
Buggy code:
s=list(input())
ss=s[:2]
sss=s[2:]
x=int("".join(ss))
y=int("".join(sss))
print(x,y)
if 1<=x<=12 and 1<=y<=12:
    print("AMBIGUOUS")
elif 1<=x<=12 :
    print("MMYY")
elif 1<=y<=12:
    print("YYMM")
elif x==0 and y==0:
    print("NA")
elif x>=13 and y==0:
    print("NA")
elif x==0 and y>=13:
    print("NA")
elif x>=13 and y>=13:
    print("NA")

Fixed code:
s=list(input())
ss=s[:2]
sss=s[2:]
x=int("".join(ss))
y=int("".join(sss))

if 1<=x<=12 and 1<=y<=12:
    print("AMBIGUOUS")
elif 1<=x<=12 :
    print("MMYY")
elif 1<=y<=12:
    print("YYMM")
elif x==0 and y==0:
    print("NA")
elif x>=13 and y==0:
    print("NA")
elif x==0 and y>=13:
    print("NA")
elif x>=13 and y>=13:
    print("NA")
Buggy code:
a=input()
s=[(int(a[0])*10)+int(a[1]),(int(a[2])*10)+int(a[3])]

if s[1]==0: and s[0]>=13:
  print("NA")
elif s[0]>=13 and s[1]>=13:
  print("NA")
elif 1<=s[0]<=12 and 1<=s[1]<=12:
  print("AMBIGUOUS")
elif s[0]==0 or  s[0]>=13 and 1<=s[1]<=12:
  print("YYMM")
elif 1<=s[0]<=12 and s[1]==0 or s[1]>=13:
  print("MMYY")

Fixed code:
a=input()
s=[(int(a[0])*10)+int(a[1]),(int(a[2])*10)+int(a[3])]

if s[0]>=13 and s[1]==0:
  print("NA")
elif s[0]==0 and s[1]==0:
  print("NA")
elif s[0]>=13 and s[1]>=13:
  print("NA")
elif 1<=s[0]<=12 and 1<=s[1]<=12:
  print("AMBIGUOUS")
elif s[0]>=13 and 1<=s[1]<=12:  
  print("YYMM")
elif s[0]==0 and 1<=s[1]<=12:
  print("YYMM")
elif 1<=s[0]<=12 and s[1]==0:
  print("MMYY")
elif 1<=s[0]<=12 and s[1]>=13:
  print("MMYY")
Buggy code:
import sys
import numpy as np

def main():
	dp =input()
	mae = int(dp[0])*10 + int(dp[1])
	ushiro = int(dp[2])*10 + int(dp[3])
	if mae <= 12 and  ushiro <= 12:
		print("AMBIGUOUS")
	elif mae <= 12 and  ushiro > 12:
		print("MMYY")
	elif mae > 12 and  ushiro <= 12:
		print("YYMM")
	else:
		print("NA")   
main()

Fixed code:
import sys
import numpy as np

def main():
	dp =input()
	mae = int(dp[0])*10 + int(dp[1])
	ushiro = int(dp[2])*10 + int(dp[3])
	if 1 <= mae <= 12 and  1<=ushiro <= 12:
		print("AMBIGUOUS")
	elif 1 <= mae <= 12 and  (ushiro > 12 or ushiro==0):
		print("MMYY")
	elif (mae > 12 or mae ==0) and  1 <= ushiro <= 12:
		print("YYMM")
	else:
		print("NA")   
main()
Buggy code:
S=input()
a=int(S[0]+S[1])
b=int(S[2]+S[3])
if (a==0 a>12) and 0<b<=12:
    print("YYMM")
elif 0<a<=12 and 0<b<=12:
    print("AMBIGUOUS")
elif 0<a<=12 and b>12:
    print("MMYY")
else:
    print("NA")

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

Fixed code:
S = input()
a, b = int(S[:2]), int(S[2:])
if (a == 0 or 12 < a) and 1 <= b <= 12:
  print('YYMM')
elif 1 <= a <= 12 and (b == 0 or 12 < b):
  print('MMYY')
elif 1 <= a <= 12 and 1 <= b <= 12:
  print('AMBIGUOUS')
else:
  print('NA')
Buggy code:
s=input()
fo=s[0:2]
la=s[2:]
n=int(fo)
m=int(la)
a=n<13
b=m<13
ans='NA'
if a and b:
  ans='AMBIGUOS'
elif a and not b:
  ans='MMYY'
elif not a and b:
  ans='YYMM'
else:
  ans='NA'
print(ans)


Fixed code:
s=input()
fo=s[0:2]
la=s[2:]
n=int(fo)
m=int(la)
a=(n<13) and (n>0)
b=(m<13) and (m>0)
ans='NA'
if a and b:
  ans='AMBIGUOUS'
elif a and not b:
  ans='MMYY'
elif not a and b:
  ans='YYMM'
else:
  ans='NA'
print(ans)
Buggy code:
S=list(input())
X="".join(S[:2])
Y="".join(S[2:])
X=int(X)
Y=int(Y)
if X==0 or 12<X and 1<=Y and Y<=12 :
  print("YYMM")
elif 1<=X and X<=12 and 12<Y or Y==0:
  print("MMYY")
elif 1<=X and X<=12  and 1<=Y and Y<=12 :
  print("AMBIGUOUS")
else :
  print("NA")

Fixed code:
S=list(input())
X="".join(S[:2])
Y="".join(S[2:])
X=int(X)
Y=int(Y)
if (X==0 or 12<X) and 1<=Y and Y<=12 :
  print("YYMM")
elif 1<=X and X<=12 and (12<Y or Y==0):
  print("MMYY")
elif 1<=X and X<=12  and 1<=Y and Y<=12 :
  print("AMBIGUOUS")
else :
  print("NA")
Buggy code:
#126 b
def change(x):
    if 1<=x<=12:
        return 0
    else:
        return 1
ans=["AMBIGOUS","NA","MMYY","YYMM"]#[00,11,01,10]
s=input()
a=change(int(s[:2]))
b=change(int(s[2:]))
if a==b:
    print(ans[a])
else:
    print(ans[a+2])

Fixed code:
#126 b
def change(x):
    if 1<=x<=12:
        return 0
    else:
        return 1
ans=["AMBIGUOUS","NA","MMYY","YYMM"]#[00,11,01,10]
s=input()
a=change(int(s[:2]))
b=change(int(s[2:]))
if a==b:
    print(ans[a])
else:
    print(ans[a+2])
Buggy code:
s=input()
a=int(s[:2])
b=int(s[2:])
def f(a):
    a1,a2=0,0
    if 1<=a<=12:
        a1=1
    if 0<=a<=99:
        a2=1
    return (a1,a2)
a1,a2=f(a)
b1,b2=f(b)
if a1 and a2 and b1 and b2:
    print('AMBIGUAUS')
elif a1 and b2:
    print('MMYY')
elif a2 and b1:
    print('YYMM')
else:
    print('NA')
    


Fixed code:
s=input()
a=int(s[:2])
b=int(s[2:])
def f(a):
    a1,a2=0,0
    if 1<=a<=12:
        a1=1
    if 0<=a<=99:
        a2=1
    return (a1,a2)
a1,a2=f(a)
b1,b2=f(b)
if a1 and a2 and b1 and b2:
    print('AMBIGUOUS')
elif a1 and b2:
    print('MMYY')
elif a2 and b1:
    print('YYMM')
else:
    print('NA')
Buggy code:
S = input()
SL = int(S[0:2])
SR = int(S[2:4])

if SL <= 12:
    if SR<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif SR<=12:
    print("YYMM")
else:
    print("NA")

Fixed code:
S = input()
SL = int(S[0:2])
SR = int(S[2:4])

if 1 <=SL <= 12:
    if 1<= SR<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 1<=SR<=12:
    print("YYMM")
else:
    print("NA")
Buggy code:
S = input()
S01 = int(S[0] + S[1])
S23 = int(S[2] + S[3])
if 1 < S01 < 13 and 1 < S23 < 13:
        print("AMBIGUOUS")
elif 1 < S01 < 13 and (S23 > 14 or S23 == 0):
        print("MMYY")
elif (S01 > 14 or S01 == 0) and 1 < S23 < 13:
        print("YYMM")
else:
        print("NA")

Fixed code:
S = input()
S01 = int(S[0] + S[1])
S23 = int(S[2] + S[3])
if 0 < S01 < 13 and 0 < S23 < 13:
        print("AMBIGUOUS")
elif 0 < S01 < 13 and (S23 > 12 or S23 == 0):
        print("MMYY")
elif (S01 > 12 or S01 == 0) and 0 < S23 < 13:
        print("YYMM")
else:
        print("NA")
Buggy code:
S = list(input())

M = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]

if S[0:2] in M and not(S[2:] in M):
    print("MMYY")
elif not(S[0:2] in M) and S[2:] in M:
    print("YYMM")
elif S[0:2] in M and S[2:] in M:
    print("AMBIGUOUS")
else:
    print("NA")

Fixed code:
S = list(input())

M = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]

if "".join(S[0:2]) in M and not("".join(S[2:]) in M):
    print("MMYY")
elif not("".join(S[0:2]) in M) and "".join(S[2:]) in M:
    print("YYMM")
elif "".join(S[0:2]) in M and "".join(S[2:]) in M:
    print("AMBIGUOUS")
else:
    print("NA")
Buggy code:
s=input()
be=s[:2]
af=s[2:]

if int(af)<=12:
  if af=="00":
    print("NA")
  else:
    print("YYMM")
    
elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
    
elif int(be)<=12 and int(af)<=12:
  print("AMBIGUOUS")
  
else:
  print("NA")

Fixed code:
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!="00":
  print("AMBIGUOUS")

elif int(af)<=12 and af!="00":
    print("YYMM")
    
elif int(be)<=12 and be!="00":
    print("MMYY")
  
else:
  print("NA")
Buggy code:
s = input()
if 0 < int(s[:1]) <= 12 and 0 < int(s[2:]) <= 12:
    print('AMBIGUOUS')
elif 0 < int(s[:1]) <= 12:
    print('MMYY')
elif 0 < int(s[2:]) <= 12:
    print('YYMM')
else:
    print('NA')

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

head = S[:2]
tail = S[2:]


if 12>=int(head)>=1 and 12>=int(tail)>=1:
    print("AMBIGUOUS")
elif 12>=int(head)>=1:
    print("YYMM")
elif 12>=int(tail)>=1:
    print("MMYY")
else:
    print("NA")

Fixed code:
S = input()

head = S[:2]
tail = S[2:]


if 12>=int(head)>=1 and 12>=int(tail)>=1:
    print("AMBIGUOUS")
elif 12>=int(head)>=1:
    print("MMYY")
elif 12>=int(tail)>=1:
    print("YYMM")
else:
    print("NA")
Buggy code:
S = input()

if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12:
    print("AMBIGOUS")
elif int(S[:2]) >= 0 and 1 <= int(S[2:]) <= 12:
    print("YYMM")
elif int(S[2:]) >= 0 and 1 <= 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 int(S[:2]) >= 0 and 1 <= int(S[2:]) <= 12:
    print("YYMM")
elif int(S[2:]) >= 0 and 1 <= int(S[:2]) <= 12:
    print("MMYY")
else:
    print("NA")
Buggy code:
s = input()
a = int(s[:2])
b = int(s[2:])

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

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


if 1 <= a <= 12:
    if 1 <= b <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1 <= b <= 12:
        print("YYMM")
    else:
        print("NA")
Buggy code:
def main():
    s = input()
    print(s[:2], s[2:4])
    if int(s[:2]) > 12 and (int(s[2:4]) >= 1 and int(s[2:4]) <= 12) :
        print("YYMM")
    elif int(s[2:4])>12 and (int(s[:2]) >=1 and int(s[:2]) <=12) :
        print("MMYY")
    elif (int(s[:2]) >= 1 and int(s[:2])) <= 12 and (int(s[2:4]) >=1 and int(s[2:4]) <= 12) :
        print("AMBIGUOUS")
    else:
        print("NA")

if __name__ == "__main__":
    main()


Fixed code:
def main():
    s = input()
    #print(s[:2], s[2:4])
    if (int(s[:2]) > 12 or int(s[:2]) == 0)and (int(s[2:4]) >= 1 and int(s[2:4]) <= 12) :
        print("YYMM")
    elif (int(s[2:4]) > 12 or int(s[2:4]) == 0) and (int(s[:2]) >=1 and int(s[:2]) <=12) :
        print("MMYY")
    elif (int(s[:2]) >= 1 and int(s[:2])) <= 12 and (int(s[2:4]) >=1 and int(s[2:4]) <= 12) :
        print("AMBIGUOUS")
    else:
        print("NA")

if __name__ == "__main__":
    main()
Buggy code:
def is_month( n :int ):
  return ( 1 <= n ) and ( n <= 12 )

def judge( first, second ):
  if (first and second):
    return "AMBIGUOUS"
  elif (first and not(second)):
    return "YYMM"
  elif (not( first ) and second):
    return "MMYY"
  else:
    return "NA"

s = input()
first = is_month( int( s[0:2] ))
second = is_month( int( s[2:4] ))
print( judge( first, second ) )

Fixed code:
def is_month( n :int ):
  return ( 1 <= n ) and ( n <= 12 )

def judge( first, second ):
  if (first and second):
    return "AMBIGUOUS"
  elif (first and not(second)):
    return "MMYY"
  elif (not( first ) and second):
    return "YYMM"
  else:
    return "NA"

s = input()
first = is_month( int( s[0:2] ))
second = is_month( int( s[2:4] ))
print( judge( first, second ) )
Buggy code:
# coding: utf-8
s = input()
s_list=list(s)
s_len=len(s_list)
s_first=int(s_list[0]+s_list[1])
s_second=int(s_list[2]+s_list[3])
if s_first<13 and s_first>0: #MMYY case
    if s_second<13:
        print('AMBIGOUS')
    else:
        print('MMYY')

else: #YYMM case
    if s_second<13 and s_second>0:
        print('YYMM')
    else:
        print('NA')


Fixed code:
# coding: utf-8
s = input()
s_list=list(s)
s_len=len(s_list)
s_first=int(s_list[0]+s_list[1])
s_second=int(s_list[2]+s_list[3])
if s_first<13 and s_first>0: #MMYY case
    if s_second<13 and s_second>0:
        print('AMBIGUOUS')
    else:
        print('MMYY')

else: #YYMM case
    if s_second<13 and s_second>0:
        print('YYMM')
    else:
        print('NA')
Buggy code:
s = list(input())

for i in range(4):
    s[i] = int(s[i])

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


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

Fixed code:
s = list(input())

for i in range(4):
    s[i] = int(s[i])

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


if a >= 13 and b >= 13:
    print("NA")
elif a >= 13 and b <= 12:
    if b > 0:
        print("YYMM")
    else:
        print("NA")
elif a <= 12 and b >= 13:
    if a > 0:
        print("MMYY")
    else:
        print("NA")
else:
    if a == 0 and b == 0:
        print("NA")
    elif a == 0:
        print("YYMM")
    elif b == 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")
Buggy code:
S = str(input())
front = int(S[:2])
back = int(S[2:])
if front > 12 and back > 12:
    print("NA")
elif front > 12 and back <= 12:
    print("YYMM")
elif front <= 12 and back > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Fixed code:
S = str(input())
front = int(S[:2])
back = int(S[2:])
if 0 < front <= 12 and 0 < back <= 12:
    print("AMBIGUOUS")
elif (front > 12 and 0 < back <= 12) or (front == 0 and 0 < back <= 12):
    print("YYMM")
elif (0 < front <= 12 and back > 12) or (0 < front <= 12 and back == 0):
    print("MMYY")
else:
    print("NA")
Buggy code:
S = input()
fore = S[0:2]
back = S[2:4]
yymm_flag = False
mmyy_flag = False
if int(fore) > 12:
  yymm_flag = True
  mmyy_flag = False
  if int(back) > 12:
    yymm_flag = False
  elif int(back) <= 12:
    yymm_flag = True
elif int(fore) <= 12:
  yymm_flag = False
  mmyy_flag = True
  if int(back) > 12:
    mmyy_flag = True
  elif int(back) <= 12:
    yymm_flag = True

if yymm_flag == True and mmyy_flag == False:
  print("YYMM")
elif yymm_flag == False and mmyy_flag == True:
  print("MMYY")
elif yymm_flag == True and mmyy_flag == True:
  print("AMBIGUOUS")
else:
  print("NA")

Fixed code:
S = input()
fore = S[0:2]
back = S[2:4]
yymm_flag = False
mmyy_flag = False
if int(fore) > 12:
  yymm_flag = True
  mmyy_flag = False
  if int(back) > 12:
    yymm_flag = False
  elif int(back) <= 12 and int(back) != 0:
    yymm_flag = True
  elif int(back) == 0:
    yymm_flag = False
    mmyy_flag = False
elif int(fore) <= 12 and int(fore) != 0:
  yymm_flag = False
  mmyy_flag = True
  if int(back) > 12:
    mmyy_flag = True
  elif int(back) <= 12 and int(back) != 0:
    yymm_flag = True
  elif int(back) == 0:
    yymm_flag = False
    mmyy_flag = True
elif int(fore) == 0:
  if int(back) > 12:
    yymm_flag = False
    mmyy_flag = False
  elif int(back) <= 12 and int(back) != 0:
    yymm_flag = True
  elif int(back) == 0:
    yymm_flag = 0
    mmyy_flag = 0
if yymm_flag == True and mmyy_flag == False:
  print("YYMM")
elif yymm_flag == False and mmyy_flag == True:
  print("MMYY")
elif yymm_flag == True and mmyy_flag == True:
  print("AMBIGUOUS")
else:
  print("NA")
Buggy code:
# 2019/05/19
# AtCoder Beginner Contest 126 - B

# Input
s = input()

# Calc
mae = int(s[0] * 10) + int(s[1])
ato = int(s[2] * 10) + int(s[3])

if (mae < 1 or mae > 12) and (ato < 1 or ato > 12):
    ans = "NA"
elif (mae >= 1 and mae <= 12) and (ato >= 1 and ato <= 12):
    ans = "AMBIGUOUS"
else:
    if (mae >= 1 and mae <= 12):
        ans = "MMYY"
    else:
        ans = "YYMM"

# Output
print(ans)


Fixed code:
# 2019/05/19
# AtCoder Beginner Contest 126 - B

# Input
s = input()

# Calc
mae = int(s[0]) * 10 + int(s[1])
ato = int(s[2]) * 10 + int(s[3])

if (mae < 1 or mae > 12) and (ato < 1 or ato > 12):
    ans = "NA"
elif (mae >= 1 and mae <= 12) and (ato >= 1 and ato <= 12):
    ans = "AMBIGUOUS"
else:
    if (mae >= 1 and mae <= 12):
        ans = "MMYY"
    else:
        ans = "YYMM"

# Output
print(ans)
Buggy code:
s = input()
s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
if s1 <= 12:
    if s2 <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif s2 <= 12:
    print('YYMM')
else:
    print('NA')


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

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


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

if l == 0:
    if u > 12:
        print("NA")
    elif u == 0:
        print("NA")
    else:
        print("YYMM")
elif l <= 12:
    if u > 12:
        print("MMYY")
    elif u == 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")
else:
    if u > 12:
        print("NA")
    elif u == 0:
        print("NA")
    else:
        print("YYMM")
Buggy code:
# -*- coding: utf-8 -*-
S = input()
S1 = int(S[:2])
S2 = int(S[2:])
A = (S1 >= 1 and S1 <= 12)
B = (S2 >= 1 and S2 <= 12)
if(A and B):
  print('ANBIGUOUS')
elif(A and not B):
  print('MMYY')
elif(not A and B):
  print('YYMM')
else:
  print('NA')


Fixed code:
# -*- coding: utf-8 -*-
S = input()
S1 = int(S[:2])
S2 = int(S[2:])
A = (S1 >= 1 and S1 <= 12)
B = (S2 >= 1 and S2 <= 12)
if(A and B):
  print('AMBIGUOUS')
elif(A and not B):
  print('MMYY')
elif(not A and B):
  print('YYMM')
else:
  print('NA')
Buggy code:
n = input()

a = int(n[0]+n[1])
b = int(n[2]+n[3])
if b = 0 or b > 12:
	if 1 <= a <= 12:
		print("MMYY")
	else:
		print("NA")
elif 1 <= a <= 12:
	print("AMBIGUOUS")
else:
	print("YYMM")

Fixed code:
n = input()

a = int(n[0]+n[1])
b = int(n[2]+n[3])
if b == 0 or b > 12:
	if 1 <= a <= 12:
		print("MMYY")
	else:
		print("NA")
elif 1 <= a <= 12:
	print("AMBIGUOUS")
else:
	print("YYMM")
Buggy code:
S = list(input())
s1 = [S[0],S[1]]
s2 = [S[2],S[3]]
s1 = int("".join(s1))
s2 = int("".join(s2))

if s1 > 12 and s2 > 12:
    print("NA")

elif s1 <1 and s2<1:
    print("NA")

elif s1 >0 and s1 <13 and s2>0 and s2 <13:
    print("AMBIGUOUS")

elif s1 > 0 and s2 < 13:
    print("YYMM")

elif s1 < 13 and s2 > 0:
    print("MMYY")

else:
    print("NA")



Fixed code:
S = list(input())
s1 = [S[0],S[1]]
s2 = [S[2],S[3]]
s1 = int("".join(s1))
s2 = int("".join(s2))

if s1 >0 and s1 <13 and s2>0 and s2 <13:
    print("AMBIGUOUS")

elif s2 > 0 and s2 < 13:
    print("YYMM")

elif s1 < 13 and s1 > 0:
    print("MMYY")

else:
    print("NA")
Buggy code:
s = input()
if 0 < int(s[:2]) and int(s[2:]) < 13:
    print("AMBIGUOUS")
elif 0 < int(s[:2]) < 13 and int(s[2:]) != 0:
    print("MMYY")
elif 0 < int(s[2:]) < 13 and int(s[:2]) != 0:
    print("YYMM")
else:
    print("NA")

Fixed code:
s = input()
if 0 < int(s[:2]) <13 and 0< int(s[2:]) < 13:
    print("AMBIGUOUS")
elif 0 < int(s[:2]) < 13:
    print("MMYY")
elif 0 < int(s[2:]) < 13:
    print("YYMM")
else:
    print("NA")
Buggy code:
y=["01","02","03","04","05","06","07","08","09","10","11","12"]
s=input()
if s[:1] in y:
  if s[2:] in y:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if s[2:] in y:
    print("YYMM")
  else:
    print("NA")

Fixed code:
y=["01","02","03","04","05","06","07","08","09","10","11","12"]
s=input()
if s[:2] in y:
  if s[2:] in y:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if s[2:] in y:
    print("YYMM")
  else:
    print("NA")
Buggy code:
S = int(input())
 
if 1 <= S[2:4] <= 12 and 1 <= S[0:2] <= 12:
    print('AMBIGUOUS') 
elif 1 <= S[2:4] <= 12:
    print('YYMM')
elif 1 <= S[0:2] <= 12:
    print('MMYY')
else:
    print('NA')

Fixed code:
S = input() 
is_yymm = 1 <= int(S[2:4]) <= 12
is_mmyy = 1 <= int(S[0:2]) <= 12

if is_mmyy and is_yymm:
    print('AMBIGUOUS') 
elif is_yymm:
    print('YYMM')
elif is_mmyy:
    print('MMYY')
else:
    print('NA')