qyliang/CodeNanoFix huggingface dataset:
Buggy code:
S = input()

a = S[:2]
b = S[2:]

print(a,int(b))

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


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

Fixed code:
s = str(input())
if s[0] == "0" and s[1] == "0" and int(s[2]+s[3]) > 12:
    print("NA")
elif s[2] == "0" and s[3] == "0" and int(s[0]+s[1]) > 12:
    print("NA")
elif s == "0000":
    print("NA")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) > 12:
    print("NA")
elif s[0] == "0" and s[1] == "0":
    print("YYMM")
elif s[2] == "0" and s[3] == "0":
    print("MMYY")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) <= 12:
    print("YYMM")
elif int(s[2]+s[3]) > 12 and int(s[0]+s[1]) <= 12:
    print("MMYY")
else:
    print("AMBIGUOUS")
Buggy code:
s = list(input())
s = [int(i+j) for (i,j) in zip(s[::2],s[1::2])]

if 1 <= s[0] <= 12:
  if 1 <= s[1] <= 12:
    print("AMIGUOUS")
  else:
    print("MMYY")
else:
  if 1 <= s[1] <= 12:
    print("YYMM")
  else:
    print("NA")

Fixed code:
s = list(input())
s = [int(i+j) for (i,j) in zip(s[::2],s[1::2])]

if 1 <= s[0] <= 12:
  if 1 <= s[1] <= 12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 1 <= s[1] <= 12:
    print("YYMM")
  else:
    print("NA")
Buggy code:
s = input()

a = s[0:1]
b = s[2:3]

ans = 0

if a <= 12 and a >= 1:
    ans += 2

if b <= 12 and b >= 1:
  ans += 3
  
if ans == 0:
  print("NA")
elif ans == 2:
  print("MMYY")
elif ans == 3:
  print("MMYY")
elif ans == 5:
  print("AMBIGUOUS")

Fixed code:
s = input()

a = s[:2]
b = s[2:]

ans = 0

if int(a) <= 12 and int(a) >= 1:
    ans += 2

if int(b) <= 12 and int(b) >= 1:
  ans += 3
  
if ans == 0:
  print("NA")
elif ans == 2:
  print("MMYY")
elif ans == 3:
  print("YYMM")
elif ans == 5:
  print("AMBIGUOUS")
Buggy code:
s = input()
x = 0

sf = s[:2]
sl = s[2:]

if (int(sf[0]) == 0 and int(sf[1]) != 0):
    x += 1
if (int(sl[0]) == 0 and int(sl[1]) != 0):
    x += 2
    
b = x
if b == 0:
  print('NA')
elif b == 3:
  print('AMBIGUOUS')
elif b == 1:
  print('MMYY')
elif b == 2:
  print('YYMM')

Fixed code:
s = input()
x = 0

sf = s[:2]
sl = s[2:]

if (int(sf[0]) == 0 and int(sf[1]) != 0):
    x += 1
if int(sf[0]) == 1 and int(sf[1]) == 0:
    x += 1
if int(sf[0]) == 1 and int(sf[1]) == 1:
    x += 1
if int(sf[0]) == 1 and int(sf[1]) == 2:
    x += 1


if (int(sl[0]) == 0 and int(sl[1]) != 0):
    x += 2

if int(sl[0]) == 1 and int(sl[1]) == 0:
    x += 2
if int(sl[0]) == 1 and int(sl[1]) == 1:
    x += 2
if int(sl[0]) == 1 and int(sl[1]) == 2:
    x += 2

b = x

if b == 0:
  print('NA')
elif b == 3:
  print('AMBIGUOUS')
elif b == 1:
  print('MMYY')
elif b == 2:
  print('YYMM')
Buggy code:
n = input()
a = int(n[0])*10 + int(n[1])
b = int(n[2])*10 + int(n[3])

s = 0
t = 0

if a > 12 or a == 0:
  s = 1
elif b > 12 or b == 0:
  t = 1

if s == 0 and t == 0:
  print("AMBIGUOUS")
elif s == 1 and t == 0:
  print("MMYY")
elif s == 0 and t == 1:
  print("YYMM")
else:
  print("NA")

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

s = 0
t = 0

if a > 0 and a <= 12:
  s = 1
if b > 0 and b <= 12:
  t = 1
if s == 1 and t == 1:
  print("AMBIGUOUS")
elif s == 0 and t == 1:
  print("YYMM")
elif s == 1 and t == 0:
  print("MMYY")
elif s == 0 and t == 0:
  print("NA")
Buggy code:
yymm = input()

if 1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12 or 1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12:
    print('AMBIGUOUS')
elif (1 <= int(yymm[0:2]) and int(yymm[0:2])) <= 12 and int(yymm[2:4]) <= 99:
    print('YYMM')
elif int(yymm[0:2]) <= 99 and 1 <= (int(yymm[2:4]) and int(yymm[2:4]) <= 12):
    print('MMYY')
else:
    print('NA')

Fixed code:
yymm = input()

if (1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12) and (1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12):
    print('AMBIGUOUS')
elif (1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12) and int(yymm[2:4]) <= 99:
    print('MMYY')
elif int(yymm[0:2]) <= 99 and (1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12):
    print('YYMM')
else:
    print('NA')
Buggy code:
A=input()
B,C=int(A[0:2]),int(A[2:4])
if 1<=B<=12 and 1<=C<=12:
    print("AMBIGIOUS")
elif 1<=B<=12:
    print("MMYY")
elif 1<=C<=12:
    print("YYMM")
else:
    print("NA")

Fixed code:
A=input()
B,C=int(A[0:2]),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")
Buggy code:
S = input().rstrip()
S = input().rstrip()
be = int(S[:2])
en = int(S[2:])
flag_be = False
flag_en = False
answer = ""
if be <= 12 and be >= 1:
    flag_be = True
if en <= 12 and en >= 1:
    flag_en = True

if flag_be and flag_en:
    answer = "AMBIGUOUS"
elif flag_be == True and flag_en == False:
    answer = "MMYY"
elif flag_be == False and flag_en == True:
    answer = "YYMM"
else:
    answer = "NA"
print(answer)

Fixed code:
S = input().rstrip()
be = int(S[:2])
en = int(S[2:])
flag_be = False
flag_en = False
answer = ""
if be <= 12 and be >= 1:
    flag_be = True
if en <= 12 and en >= 1:
    flag_en = True

if flag_be and flag_en:
    answer = "AMBIGUOUS"
elif flag_be == True and flag_en == False:
    answer = "MMYY"
elif flag_be == False and flag_en == True:
    answer = "YYMM"
else:
    answer = "NA"
print(answer)
Buggy code:

s = input()

s1 = int(s[:2])
s2 = int(s[2:])

if s2 > 12:
    print("MMYY")
elif s1 > 12:
    print("YYMM")
elif ((s1 == 0) or (s2 == 0)) or ((s1 > 12) and (s2 > 12)):
    print("NA")
else:
    print("AMBIGUOUS")


Fixed code:

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

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

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

Fixed code:
S = input()
f,e = int(S[:2]),int(S[2:])
if (f > 12 or f == 0) and 0 < e <= 12:
   print('YYMM')
elif 0 < f <= 12 and (e > 12 or e == 0):
   print('MMYY')
elif 0 < f <= 12 and 0 < e <= 12:
   print('AMBIGUOUS')
else:
    print('NA')
Buggy code:
i = list(input())
yy = int(i[0] + i[1])
mm = int(i[2] + i[3])
print(yy, mm)

if (yy > 12) and (0 < mm <= 12):
    print("YYMM")
elif (0 < yy <= 12) and (mm > 12):
    print("MMYY")
elif (0 < yy <= 12) and (0 < mm <= 12):
    print("AMBIGUOUS")
else:
    print("NA")


Fixed code:
i = list(input())
yy = int(i[0] + i[1])
mm = int(i[2] + i[3])
 
if ((yy > 12) or (yy == 0))  and (0 < mm <= 12):
    print("YYMM")
elif (0 < yy <= 12) and ((mm > 12) or (mm == 0)):
    print("MMYY")
elif (0 < yy <= 12) and (0 < mm <= 12):
    print("AMBIGUOUS")
else:
    print("NA")
Buggy code:
s = input()

l = 0<int(s[:2])<13
r = 0<int(s[2:])<13

if l = 1:
  print('AMBIGUOUS' if r = 1 else 'MMYY')
else:
  print('YYMM' if r = 1 else 'NA')

Fixed code:
s = input()

l = 0<int(s[:2])<13
r = 0<int(s[2:])<13

if l == 1:
  print('AMBIGUOUS' if r == 1 else 'MMYY')
else:
  print('YYMM' if r == 1 else 'NA')
Buggy code:


S = input()

try:
    first = int(S[:2])
except ValueError:
    first = -1

try:
    end = int(S[2:])
except ValueError:
    end = -1

def judgeYM(num):
    if num >= 1 and num <= 12:
        return "M"
    elif num >= 0 and num <=99:
        return "Y"
    else:
        return "N"

fj = judgeYM(first)
ej = judgeYM(end)

if fj == "N" or ej == "N":
    print("NA")
elif fj == "M" and ej == "M":
    print("AMBIGUOUS")
elif fj == "M":
    print("MMYY")
else:
    print("YYMM")

Fixed code:


S = input()

try:
    first = int(S[:2])
except ValueError:
    first = -1

try:
    end = int(S[2:])
except ValueError:
    end = -1

def judgeYM(num):
    if num >= 1 and num <= 12:
        return "M"
    elif num >= 0 and num <=99:
        return "Y"
    else:
        return "N"

fj = judgeYM(first)
ej = judgeYM(end)

if fj == "N" or ej == "N":
    print("NA")
elif fj == "M" and ej == "M":
    print("AMBIGUOUS")
elif fj == "M":
    print("MMYY")
elif ej == "M":
    print("YYMM")
else:
    print("NA")
Buggy code:
S = int(input())
a = int(S / 100)
b = S - a*100
if a <=12 and b <= 12:
    print("AMBIGUOUS")
elif a <= 12:
    print("MMYY")
elif b<= 12:
    print("YYMM")
else:
    print("NA")

Fixed code:
S = int(input())
a = int(S / 100)
b = S - a*100
if a <=12 and b <= 12 and a > 0 and b > 0:
    print("AMBIGUOUS")
elif a <= 12 and a > 0:
    print("MMYY")
elif b<= 12 and b > 0:
    print("YYMM")
else:
    print("NA")
Buggy code:
S = input()
Fa = int(S[:2])
Se = int(S[2:])
if 1 <= Fa <= 12 and 1 <= Se <= 12:
	print("AMBIGIOUS")
elif 1 <= Fa <= 12:
	print("MMYY")
elif 1 <= Se <= 12:
	print("YYMM")
else:
	print("NA")

Fixed code:
S = input()
Fa = int(S[:2])
Se = int(S[2:])
if 1 <= Fa <= 12 and 1 <= Se <= 12:
	print("AMBIGUOUS")
elif 1 <= Fa <= 12:
	print("MMYY")
elif 1 <= Se <= 12:
	print("YYMM")
else:
	print("NA")
Buggy code:
A=int(input())
B=int(A/100)
C=A/100
if 1<=B and B<=12:
 if 1<=C and C<=12:
  print("AMBIGUOUS")
 else:
  print("YYMM")
else:
 if 1<=C and C<=12:
  print("MMYY")
 else:
  print("NA")

Fixed code:
A=int(input())
B=int(A/100)
C=A%100
if 1<=B and B<=12:
 if 1<=C and C<=12:
  print("AMBIGUOUS")
 else:
  print("MMYY")
else:
 if 1<=C and C<=12:
  print("YYMM")
 else:
  print("NA")
Buggy code:
S = input().rstrip()
front = int(S[0:2])
back = int(S[2:4])

if 1 <= front <= 12:
    if 1 <= back <= 12:
        print('AMBIGUOUS')
    elif 0 < back:
        print('MMYY')
    else:
        print('NA')
elif 0 < front:
    if 1 <= back <= 12:
        print('YYMM')
else:
    print('NA')

Fixed code:
S = input().rstrip()
front = int(S[0:2])
back = int(S[2:4])

if 1 <= front <= 12:
    if 1 <= back <= 12:
        print('AMBIGUOUS')
    elif 0 <= back:
        print('MMYY')
    else:
        print('NA')
else:
    if 0 <= front and 1 <= back <= 12:
        print('YYMM')
    else:
        print('NA')
Buggy code:
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 <= 12:
    print("AMBIGUOUS")
elif 0 < a <= 12 and b > 12:
    print("MMYY")
elif a > 12 and 0 < b <= 12:
    print("YYMM")
elif a > 12 and b > 12:
    print("NA")

Fixed code:
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")
Buggy code:
S=input()
if 1<=int(S[:2])<=12 and 13<=int(S[2:]):
    print("MMYY")
elif 1<=int(S[2:])<=12 and 13<=int(S[:2]):
    print("YYMM")
elif 1<=int(S[2:])<=12 and 1<=int(S[:2])<=12:
    print("AMBIGUOUS")
elif 13<=int(S[2:]) and 13<=int(S[:2]):
    print("NA")

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

S1 = S[0:2]
S2 = S[2:4]

def is_MM(s):
  if 1 <= int(s) <= 12:
    return(True)
  else:
    return(False)

def is_YY(s):
  if 0 <= int(s) <= 99:
    return(True)
  else:
    return(False)

if (not is_MM(S1) and not is_YY(S1)) or (not is_MM(S2) and not is_YY(S2)):
  print("NA")
elif is_YY(S1) and is_MM(S1) and is_YY(S2) and is_MM(S2):
  print("AMBIGUOUS")
elif is_YY(S1) and is_MM(S2):
  print("YYMM")
elif is_YY(S2) and is_MM(S1):
  print("MMYY")



Fixed code:
S = input()

S1 = S[0:2]
S2 = S[2:4]

def is_MM(s):
  if 1 <= int(s) <= 12:
    return(True)
  else:
    return(False)

def is_YY(s):
  if 0 <= int(s) <= 99:
    return(True)
  else:
    return(False)

if (not is_MM(S1) and not is_MM(S2)) or (not is_YY(S1) and not is_YY(S2)):
  print("NA")
elif is_YY(S1) and is_MM(S1) and is_YY(S2) and is_MM(S2):
  print("AMBIGUOUS")
elif is_YY(S1) and is_MM(S2):
  print("YYMM")
elif is_YY(S2) and is_MM(S1):
  print("MMYY")
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):
  print("YYMM")
elif (1 <= b <= 12):
    print("MMYY")
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):
  print("MMYY")
elif (1 <= b <= 12):
    print("YYMM")
else:
  print("NA")
Buggy code:
s = input()
left = int(s[:2])
right = int(s[2:])

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

Fixed code:
s = input()
left = int(s[:2])
right = int(s[2:])
 
if 1 <= left and left <=12 and 1 <= right and right <= 12:
  print("AMBIGUOUS")
elif 1 <= left and left <= 12:
  print("MMYY")
elif 1 <= right and right <= 12:
  print("YYMM")
else:
  print("NA")
Buggy code:
order = input()
forw = int(order[:2])
back = int(order[2:])
flg_f = 0
flg_b = 0

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

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

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

if flg_f + flg_b == 2:
  print('AMBIGUOUS')
elif flg_f == 1:
  print('MMYY')
elif flg_b == 1:
  print('YYMM')
else:
  print('NA')
Buggy code:
n =  str(input())

a = n[0:2]
b = n[2:]

c = int(a)
d = int(b)
print(c)
print(d)
yymm = False
mmyy = False
ambiguous = False
na = False

if (c < 1) or (12 < c):
    if (d < 1) or (12 < d):
        na = True

if (1 <= c) and (c <= 12):
    if (d < 1) or (12 < d):
        mmyy = True

if (1 <= d) and (d <= 12):
    if (c < 1) or (12 < c):
        yymm = True

if na == False and mmyy == False and yymm == False:
    ambiguous = True

if na == True:
    print("NA")
if mmyy == True:
    print("MMYY")
if yymm == True:
    print("YYMM")
if ambiguous == True:
    print("AMBIGUOUS")


Fixed code:
n =  str(input())

a = n[0:2]
b = n[2:]

c = int(a)
d = int(b)
yymm = False
mmyy = False
ambiguous = False
na = False

if (c < 1) or (12 < c):
    if (d < 1) or (12 < d):
        na = True

if (1 <= c) and (c <= 12):
    if (d < 1) or (12 < d):
        mmyy = True

if (1 <= d) and (d <= 12):
    if (c < 1) or (12 < c):
        yymm = True

if na == False and mmyy == False and yymm == False:
    ambiguous = True

if na == True:
    print("NA")
if mmyy == True:
    print("MMYY")
if yymm == True:
    print("YYMM")
if ambiguous == True:
    print("AMBIGUOUS")
Buggy code:
S = list(input())

p = S[0]+S[1]
q = S[2]+S[3]

p_flag = 0
q_flag = 0

if int(q) = 0 and int(p) == 0:
    print('NA')
elif int(p) == 0:
    print('YYMM')
elif int(q) == 0:
    print('MMYY')
else:
    if int(p) > 12:
        p_flag = 1
    if int(q) > 12:
        q_flag = 1

    if p_flag and q_flag:
        print('NA')
    elif p_flag:
        print('YYMM')
    elif q_flag:
        print('MMYY')
    else:
        print('AMBIGUOUS')


Fixed code:
S = list(input())

p = S[0]+S[1]
q = S[2]+S[3]

p_flag = 0
q_flag = 0

if int(p) == 0 and int(q) == 0:
    print('NA')
elif int(p) == 0:
    if int(q) < 13:
        print('YYMM')
    else:
        print('NA')
elif int(q) == 0:
    if int(p) < 13:
        print('MMYY')
    else:
        print('NA')
else:
    if int(p) > 12:
        p_flag = 1
    if int(q) > 12:
        q_flag = 1

    if p_flag and q_flag:
        print('NA')
    elif p_flag:
        print('YYMM')
    elif q_flag:
        print('MMYY')
    else:
        print('AMBIGUOUS')
Buggy code:
s = input()
h = s[:2]
t = s[2:]
print(h, t)
def montheable(p):
    return '00' < p < '13'
if montheable(h) and montheable(t):
    print('AMBIGUOUS')
elif montheable(h):
    print('MMYY')
elif montheable(t):
    print('YYMM')
else:
    print('NA')

Fixed code:
s = input()
h = s[:2]
t = s[2:]
def montheable(p):
    return '00' < p < '13'
if montheable(h) and montheable(t):
    print('AMBIGUOUS')
elif montheable(h):
    print('MMYY')
elif montheable(t):
    print('YYMM')
else:
    print('NA')
Buggy code:
r, g, b, n = [int(i) for i in input().split()]
print(r, g, b)

r, g, b = sorted([r, g, b])

ans = 0
divb = n // b
for i in range(divb+1):
    remain_n1 = n - b * i
    divg = remain_n1 // g
    for j in range(divg+1):
        remain_n2 = remain_n1 - g * j
        if remain_n2 % r == 0:
            ans += 1

print(ans)

Fixed code:
r, g, b, n = [int(i) for i in input().split()]

r, g, b = sorted([r, g, b])

ans = 0
divb = int(n / b)
for i in range(divb+1):
    remain_n1 = n - b * i
    divg = int(remain_n1 / g)
    for j in range(divg+1):
        remain_n2 = remain_n1 - g * j
        if remain_n2 % r == 0:
            ans += 1

print(ans)
Buggy code:
A,B,C,N=map(int, input().split())
count=0
for x in range(N+1):
  for y in range(N-x*A+1):
    b=(N-x*A-y*B)/C
    if b>=0:
      count+=1
                
print(count)

Fixed code:
A,B,C,N=map(int, input().split())
count=0
for x in range(N+1):
  for y in range(N-x*A+1):
    b=(N-x*A-y*B)
    if b>=0 and b%C==0:
      count+=1
                
print(count)
Buggy code:
R, G, B ,N = map(int, input().split())

RGB = [R, G, B]
RGB.sort(reverse=True)

cnt = 0
NR = N//RGB[0]
NG = N//RGB[1]
for r in range(NR + 1):
  for g in range(NG + 1):
    NrRgG = N - (r*R + g*G)
    if NrRgG < 0:
      break
    elif NrRgG >= 0:
      if NrRgG % RGB[2] == 0:
        cnt += 1
print(cnt)

Fixed code:
R, G, B ,N = map(int, input().split())

if R==1 and G==1 and B==1:
  print(int((N+2)*(N+1)*(1/2)))
else:
  RGB = [R, G, B]
  RGB.sort(reverse=True)

  R = RGB[0]
  G = RGB[1]
  B = RGB[2]

  cnt = 0
  NR = N//R
  NG = N//G
  for r in range(NR + 1):
    for g in range(NG + 1):
      NrRgG = N - (r*R + g*G)
      if NrRgG < 0:
        break
      elif NrRgG >= 0:
        if NrRgG % B == 0:
          cnt += 1
  print(cnt)
Buggy code:
import sys
R, G, B, N = map(int, sys.stdin.readline().split())
print([0 for r in range(N//R + 1) for g in range((N - (r*R))//G + 1) for b in range((N-(r * R + g * G))//B + 1) if  r*R + g*G + b*B == N])


Fixed code:
import sys
R, G, B, N = map(int, sys.stdin.readline().split())
print(len([0 for r in range(N//R + 1) for g in range((N - (r*R))//G + 1) if  (N -(r*R + g*G))%B == 0]))
Buggy code:
R,G,B,n = map(int,input().split())
ans = 0
for r in range(n+1) :
    for g in range(n+1-r*R) :
        b = n-r*R-g*G
        if b > 0 and b % B == 0 :
            ans += 1

print(ans)

Fixed code:
R,G,B,n = map(int,input().split())
ans = 0
for r in range(n+1) :
    for g in range(n+1-r*R) :
        b = n-r*R-g*G
        if b >= 0 and b % B == 0 :
            ans += 1

print(ans)
Buggy code:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(3001):
    for j in range(3001):
        b = (N-i*R-j*G)/B
        if b.is_integer() and b >= 0:
            ans += 1
            print(i, j, b)
        if b < 0:
            break

print(ans)

Fixed code:
R, G, B, N = map(int, input().split())

ans = 0
for i in range(3001):
    for j in range(3001):
        b = (N-i*R-j*G)/B
        if b.is_integer() and b >= 0:
            ans += 1
        if b < 0:
            break

print(ans)
Buggy code:
r,g,b,n=map(int,input().split())
def INT(m):
  if int(m)==m:
    return True
  return False
aa=[r,g,b]
aa.sort()
a,b,c=aa[0],aa[1],aa[2]
ans=0
for i in range(n//c):
  for j in range((n-i*c)//b):
    if INT((n-i*c-j*b)/a):
      ans+=1
print(ans)

Fixed code:
r,g,b,n=map(int,input().split())
def INT(m):
  if int(m)==m:
    return True
  return False
aa=[r,g,b]
aa.sort()
a,b,c=aa[0],aa[1],aa[2]
ans=0
for i in range(n//c +1):
  for j in range((n-i*c)//b +1):
    if INT((n-i*c-j*b)/a):
      ans+=1
print(ans)
Buggy code:
r,g,b,n = [int(i) for i in input().split()]

cnt = 0
for i in range(n//r+1):
  n_r = i*r
  if n_r > n:
    break
  for j in range(n//g+1):
    n_rg = j*g + n_r
    if n_rg > n:
      break
    if n_rg%b == 0:
      cnt += 1
        
print(cnt)

Fixed code:
r,g,b,n = [int(i) for i in input().split()]

cnt = 0
for i in range(n//r+1):
  n_r = i*r
  if n_r > n:
    break
  for j in range(n//g+1):
    n_rg = j*g + n_r
    if n_rg > n:
      break
    if (n-n_rg)%b == 0:
      cnt += 1
        
print(cnt)
Buggy code:
R, G, B, N = map(int, input().split())
cnt = 0

for i in range(n // R + 1):
    for j in range(n // G + 1):
        if (N - R * i - G * j) / B >= 0 and ((N - R * i - G * j) / B) % 1 == 0:
            cnt += 1
print(cnt)

Fixed code:
R, G, B, N = map(int, input().split())
cnt = 0

for i in range(N // R + 1):
    for j in range(N // G + 1):
        if (N - R * i - G * j) / B >= 0 and ((N - R * i - G * j) / B) % 1 == 0:
            cnt += 1
print(cnt)
Buggy code:
import sys

#+++++
		
def main():
	R,G,B,N = map(int, input().split())
	cc=0
	ri=0
	while ri * R <= N:
		ri+=1
		gi=0
		while G*gi + ri*R <= N:
			gi+=1
			nn=N-(G*gi+R*ri)
			if nn % B == 0:
				cc+=1
			gi+=1
		ri+=1
	
	print(cc)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Fixed code:
import sys

#+++++
		
def main():
	R,G,B,N = map(int, input().split())
	cc=0
	ri=0
	while ri * R <= N:
		gi=0
		while G*gi + ri*R <= N:
			nn=N-(G*gi+R*ri)
			if nn % B == 0:
				cc+=1
			gi+=1
		ri+=1
	
	print(cc)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)
Buggy code:
r,g,b,n=map(int,input().split())
ans=0
for i in range(n//r+1):
  for j in range((n-r*i)//g+1):
    if (n-i*r-b*j)%b==0:ans+=1
print(ans)

Fixed code:
r, g, b, n = map(int, input().split())
ans = 0
for i in range(n // r + 1):
    t = n - i * r
    for j in range(t // g + 1):
        if (t - j * g) % b == 0:
            ans += 1
print(ans)