qyliang/CodeNanoFix huggingface dataset:
Buggy code:
S = list(input())
S1 = int(S[0] + S[1])
S2 = int(S[2] + S[3])
if  S1 == 0 or S2 == 0:
    if S2 <= 12:
        print("YYMM")
    elif S1 <= 12:
        print("MMYY")
    else:
        print("NA")
elif S2 <= 12 and S1 <= 12:
    print("AMBIGUOUS")
elif S2 <= 12:
    print("YYMM")
else:
    print("MMYY")


Fixed code:
S = list(input())
S1 = int(S[0] + S[1])
S2 = int(S[2] + S[3])
if S1>12 and S2>12:
    print("NA")
elif  S1 == 0 or S2 == 0:
    if 1 <= S2 <= 12:
        print("YYMM")
    elif 1<= S1 <= 12:
        print("MMYY")
    else:
        print("NA")
elif S2 <= 12 and S1 <= 12:
    print("AMBIGUOUS")
elif S2 <= 12:
    print("YYMM")
else:
    print("MMYY")
Buggy code:
s = input()
l = s[0]+s[1]
r = s[2]+s[3]
mm = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
if mm.count(l) == 1 and mm.count(r) == 1:
    print('AMBIGIUOUS')
elif mm.count(l) == 1 and mm.count(r) != 1:
    print('MMYY')
elif mm.count(l) != 1 and mm.count(r) == 1:
    print('YYMM')
else:
    print('NA')

Fixed code:
s = input()
l = s[0]+s[1]
r = s[2]+s[3]
mm = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
if mm.count(l) == 1 and mm.count(r) == 1:
    print('AMBIGUOUS')
elif mm.count(l) == 1 and mm.count(r) != 1:
    print('MMYY')
elif mm.count(l) != 1 and mm.count(r) == 1:
    print('YYMM')
else:
    print('NA')
Buggy code:
n = list(map(int,input()))
a,b = n[0]+n[1],n[2]+n[3]
if a==0 or b == 0:
  print("NA")
elif a<=12 and b<=12:
  print("AMBIGUOUS")
elif a<=12 and b>12:
  print("MMYY")
elif a>12 and b<=12:
  print("YYMM")

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

Fixed code:
s = input()
n1 = int(s[:2])
n2 = int(s[2:])
if 1 <= n1 <= 12 and 1 <= n2 <= 12:
  print("AMBIGUOUS")
elif (n1 > 12 or n1 == 0) and 1 <= n2 <= 12:
  print("YYMM")
elif (n2 > 12 or n2 == 0) and 1 <= n1 <= 12:
  print("MMYY")
else:
  print("NA")
Buggy code:
S=list(input())
def main():
    while True:
        if int(S[0]+S[1])>12:
            if int(S[2]+S[3])==0:
                return 'NA'
            if int(S[2]+S[3])>12:
                return 'YYMM'
            else:
                return 'AMBIGUOUS'
        else:
            return 'MMYY'
            
print(main())

Fixed code:
S=list(input())
def main():
    while True:
        if 1<=int(S[0]+S[1])<=12:
            if 1<=int(S[2]+S[3])<=12:
                return 'AMBIGUOUS'
            else:
                return 'MMYY'
        else:
            if 1<=int(S[2]+S[3])<=12:
                return 'YYMM'
            else:
                return 'NA'

print(main())
Buggy code:
def main():
  S=int(input())
  a=S//100
  b=S%100
  if 1<=a<=12 and 1<=b<=12:
    print("AMBIGUOUS ")
  elif 1<=a<=12 and b==0 or 13<=b<=99:
    print("MMYY")
  elif 1<=b<=12 and a==0 or 13<=a<=99:
    print("YYMM")
  else:
    print("NA")
main()

Fixed code:
def main():
  S=int(input())
  a=S//100
  b=S%100
  if 1<=a<=12 and 1<=b<=12:
    print("AMBIGUOUS ")
  elif 1<=a<=12 and (b==0 or 13<=b<=99):
    print("MMYY")
  elif 1<=b<=12 and (a==0 or 13<=a<=99):
    print("YYMM")
  else:
    print("NA")
main()
Buggy code:
s = input()
x=int(s[:2])
y=int(s[2:])
if 1<=x and x<=12:
    if 1<=y and y<=12:
        print('AMBIGUPUS')
    else:
        print('MMYY')
elif 1<=y and y<=12:
    print('YYMM')
else:
    print('NA')

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

a, b = 0, 0

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

Fixed code:
S = str(input())

a, b = 0, 0

#YYMM
if 1 <= int(S[2:]) and int(S[2:]) <= 12:
  a = 1
#MMYY
if 1 <= int(S[:2]) and int(S[:2]) <= 12:
  b = 1
  
if a == 1 and b == 1:
  print("AMBIGUOUS")
elif a == 1 and b == 0:
  print("YYMM")
elif a == 0 and b == 1:
  print("MMYY")
else:
  print("NA")
Buggy code:
s = input()
if 1<=int(s[0:2])<=12 and 1<=int(s[2:4])<=12:
    print("AMBIGUOU")
elif 1<=int(s[0:2])<=12:
    print("MMYY")
elif 1<=int(s[2:4])<=12:
    print("YYMM")
else:
    print("NA")

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

S_zen =int(S[0:2])
S_go = int(S[2:4])

judge_list_MM = [1+i for i in range(12)]

print(judge_list_MM)


if S_zen ==0 or S_go ==0:
    print("NA")
if S_zen in judge_list_MM :
    print("MMYY")
elif S_go in judge_list_MM :
    print("YYMM")
elif S_zen in judge_list_MM and S_go in judge_list_MM :
    print("AMBIGUOUS")


Fixed code:
S = input()

S_zen =int(S[0:2])
S_go = int(S[2:4])

judge_list_MM = [1+i for i in range(12)]

#print(judge_list_MM)

if S_zen in judge_list_MM and S_go in judge_list_MM :
    print("AMBIGUOUS")
elif S_go in judge_list_MM :
    print("YYMM")
elif S_zen in judge_list_MM :
    print("MMYY")
else :
    print("NA")
Buggy code:
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')


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

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

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










Fixed code:
S = input()

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

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

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


Fixed code:

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

foward = int(S[0 : 2])
back = int(S[2 : 4])

foward_MM = False
back_MM = False

if foward >= 1 and foward <= 12:
  foward_MM = True
if back >= 1 and back <= 12:
  back_MM = True

if foward_MM and back_MM:
  print("AMBIGOUS")
elif foward_MM and not back_MM:
  print("MMYY")
elif not foward_MM and back_MM:
  print("YYMM")
else:
  print("NA")

Fixed code:
S = input()

foward = int(S[0 : 2])
back = int(S[2 : 4])

foward_MM = False
back_MM = False

if foward >= 1 and foward <= 12:
  foward_MM = True
if back >= 1 and back <= 12:
  back_MM = True

if foward_MM and back_MM:
  print("AMBIGUOUS")
elif foward_MM and not back_MM:
  print("MMYY")
elif not foward_MM and back_MM:
  print("YYMM")
else:
  print("NA")
Buggy code:
x = list(input())
first = 10 * x[0] + x[1]
second = 10 * x[2] + x[3]


def mc(num):
    if 1 <= num <= 12:
        return True
    else:
        return False


def yc(num):
    if 1 <= num <= 99:
        return True
    else:
        return False


if yc(first):
    if mc(second):
        if yc(second):
            if mc(first):
                print("AMBIGUOUS")
            else:
                print("YYMM")
        else:
            print("YYMM")
    elif yc(second):
        if mc(first):
            print("MMYY")
        else:
            print("NA")
    else:
        pirnt("NA")
elif yc(second):
    if mc(first):
        print("MMYY")
    else:
        print("NA")
else:
    print("NA")

Fixed code:
x = list(input())
first = 10 * int(x[0]) + int(x[1])
second = 10 * int(x[2]) + int(x[3])


def mc(num):
    if 1 <= num <= 12:
        return True
    else:
        return False


def yc(num):
    if 0 <= num <= 99:
        return True
    else:
        return False


if yc(first):
    if mc(second):
        if yc(second):
            if mc(first):
                print("AMBIGUOUS")
            else:
                print("YYMM")
        else:
            print("YYMM")
    elif yc(second):
        if mc(first):
            print("MMYY")
        else:
            print("NA")
    else:
        print("NA")
elif yc(second):
    if mc(first):
        print("MMYY")
    else:
        print("NA")
else:
    print("NA")
Buggy code:
data=list(input())
a=10*int(data[0])+int(data[1])
b=10*int(data[2])+int(data[3])

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


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

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

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

s = input()
s_up = int(s[0] + s[1])
s_down = int(s[2] + s[3])

if 0 <= s_up <= 12 and 0 <= s_down <= 12:
    print("AMBIGUOUS")
elif 0 <= s_down <= 12:
    print("YYMM")
elif 0 <= s_up<= 12:
    print("MMYY")
else:
    print("NA")

Fixed code:

s = input()
s_up = int(s[0] + s[1])
s_down = int(s[2] + s[3])

if 0 < s_up <= 12 and 0 < s_down <= 12:
    print("AMBIGUOUS")
elif 0 < s_down <= 12:
    print("YYMM")
elif 0 < s_up<= 12:
    print("MMYY")
else:
    print("NA")
Buggy code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect, math
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]

def solve():
    u = N // 100
    l = N % 100
    if u == 0 and l < 13 :
        return 'YYMM'
    elif l == 0 and u < 13 :
        return 'MMYY'
    if u > 12 and l < 13:
        return 'YYMM'
    elif u < 13 and l > 12:
        return 'MMYY'
    elif u < 13 and l < 13:
        return 'AMBIGUOUS'
    else:
        return 'NA'

if __name__ == "__main__":
    print(solve())


Fixed code:
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect, math
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]

def solve():
    u = N // 100
    l = N % 100
    if u == 0 and l == 0:
        return 'NA'
    if u == 0:
        if l < 13:
            return 'YYMM'
        else: return 'NA'
    if l == 0:
        if u < 13:
            return 'MMYY'
        else: return 'NA'
    if u > 12:
        if l < 13:
            return 'YYMM'
        else: return 'NA'

    if u < 13:
        if l > 12:
            return 'MMYY'
        else: return 'AMBIGUOUS'
    else:
        return 'NA'

if __name__ == "__main__":
    print(solve())
Buggy code:
#B
s = input()
print(int(s[0:2]), int(s[2:4]))
if 1 <= int(s[0:2]) <= 12 and 1 <= int(s[2:4]) <= 12:
    print('AMBIGUOUS')
elif 1 <= int(s[0:2]) <= 12:
    print('MMYY')
elif 1 <= int(s[2:4]) <= 12:
    print('YYMM')
else:
    print('NA')


Fixed code:
#B
s = input()
# print(int(s[0:2]), int(s[2:4]))
if 1 <= int(s[0:2]) <= 12 and 1 <= int(s[2:4]) <= 12:
    print('AMBIGUOUS')
elif 1 <= int(s[0:2]) <= 12:
    print('MMYY')
elif 1 <= int(s[2:4]) <= 12:
    print('YYMM')
else:
    print('NA')
Buggy code:
#B
s = list(input())
left = int(s[0])*10+int(s[1])
right = int(s[2])*10+int(s[3])
print(left,right)
if 0 < left <= 12:
    if 0 < right <= 12:
        print("AMBIGUOUS")
    else:
        print('MMYY')
elif 0 < right <= 12:
    print('YYMM')
else:
    print('NA')


Fixed code:
#B
s = list(input())
left = int(s[0])*10+int(s[1])
right = int(s[2])*10+int(s[3])
if 0 < left <= 12:
    if 0 < right <= 12:
        print("AMBIGUOUS")
    else:
        print('MMYY')
elif 0 < right <= 12:
    print('YYMM')
else:
    print('NA')
Buggy code:
S = input()
F = int(S) // 100
B = int(S) % 100
if (F <= 12 & F > 0) & (B <= 12 & B > 0):
  print("AMBIGUOUS")
elif F <= 12 & F > 0:
  print("MMYY")
elif B <= 12 & B > 0:
  print("YYMM")
else:
  print("NA")

Fixed code:
S = input()
F = int(S) // 100
B = int(S) % 100
if (F <= 12 and F > 0) and (B <= 12 and B > 0):
  print("AMBIGUOUS")
elif F <= 12 and F > 0:
  print("MMYY")
elif B <= 12 and B > 0:
  print("YYMM")
else:
  print("NA")
Buggy code:
s = str(input())
ss = s[:2]
sss = s[2:]

if "01" <= ss <= "12":
    if "01" <= sss <= "12":
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    if "01" <= sss <= "12":
        print("MMYY")
    else:
        print("NA")

Fixed code:
s = str(input())
ss = s[:2]
sss = s[2:]

if "01" <= sss <= "12":
    if "01" <= ss <= "12":
        print("AMBIGUOUS")
        exit()
    else:
        print("YYMM")
        exit()
if "01" <= ss <= "12":
    print("MMYY")
else:
    print("NA")
Buggy code:
a = input()
if 0<int(a[:2])<=12:
  if int(a[2:])<=12:
    print("AMBIGIUOUS")
  else:
    print("MMYY")
else:
  if int(a[2:])<=12:
    print("YYMM")
  else:
    print("NA")

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

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

print(s1, s2)

if(s1 <= 12 and s2 <= 12 and s1 is not 0 and s2 is not 0):
    print('AMBIGUOUS')
elif(s1 <= 12 and s2 > 12 and s1 is not 0):
    print('MMYY')
elif(s1 > 12 and s2 <= 12 and s2 is not 0):
    print('YYMM')
else:
    print('NA')

Fixed code:
S = input()

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

if(s1 <= 12 and s2 <= 12 and s1 is not 0 and s2 is not 0):
    print('AMBIGUOUS')
elif(s1 <= 12 and s2 > 12 and s1 is not 0):
    print('MMYY')
elif(s1 > 12 and s2 <= 12 and s2 is not 0):
    print('YYMM')
elif(s1 is 0 and s2 <= 12 and s2 is not 0):
    print('YYMM')
elif(s1 <= 12 and s2 is  0 and s1 is not 0):
    print('MMYY')
else:
    print('NA')
Buggy code:
s=input()

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

a=str(s[0])+str(s[1])
b=str(s[2])+str(s[3])

flag=[1,2,3]

if a not in tuki:
    flag.remove(1)
    flag.remove(3)
if b not in tuki:
    flag.remove(2)
    if 3 in flag:
        flag.remove(3)

if flag==[]:
    print('NA')
elif flag[-1]==3:
    print('AMBIGOUS')
elif flag[-1]==2:
    print('YYMM')
elif flag[-1]==1:
    print('MMYY')

Fixed code:
s=input()

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

a=str(s[0])+str(s[1])
b=str(s[2])+str(s[3])

flag=[1,2,3]

if a not in tuki:
    flag.remove(1)
    flag.remove(3)
if b not in tuki:
    flag.remove(2)
    if 3 in flag:
        flag.remove(3)

if flag==[]:
    print('NA')
elif flag[-1]==3:
    print('AMBIGUOUS')
elif flag[-1]==2:
    print('YYMM')
elif flag[-1]==1:
    print('MMYY')
Buggy code:
import bisect
import math
def solve():
  s = int(input())
  if s//100 == 0 or s%100 == 0:
    print("NA")
    exit()
  
  if s//100 != 0 and s//100 <= 12:
    tp = s%100
    if 1<= tp and tp <= 12:
      print("AMBIGIOUS")
    elif 13 <= tp and tp <= 99:
      print("MMYY")
    else:
      print("NA")
  else:
    tp = s%100
    if 1<= tp and tp <= 12:
      print("YYMM")
    else:
      print("NA")
solve()


Fixed code:
import bisect
import math
def solve():
  s = int(input())
  if s == 0:
    print("NA")
    exit()
  
  if s//100 != 0 and s//100 <= 12:
    tp = s%100
    if 1<= tp and tp <= 12:
      print("AMBIGUOUS")
    elif tp == 0:
      print("MMYY")
    elif 13 <= tp and tp <= 99:
      print("MMYY")
    else:
      print("NA")
  else:
    tp = s%100
    if 1<= tp and tp <= 12:
      print("YYMM")
    else:
      print("NA")
solve()
Buggy code:
s = input()

b = int(s[:2])
a = int(s[2:])

print(b)
print(a)

def yorm(i):
    flag = 'none'
    if 0<i<12:
        flag = 'MM'
    elif i<100:
        flag = 'YY'
    return flag
   
ans = bf+af
if len(ans) != 4:
    ans = 'NA'
if ans == 'MMMM':
    ans = 'AMBIGUOUS'
if ans == 'YYYY':
    ans = 'NA'
print(ans)

Fixed code:
s = input()

b = int(s[:2])
a = int(s[2:])

def yorm(i):
    flag = 'none'
    if 0<i<=12:
        flag = 'MM'
    elif i<100:
        flag = 'YY'
    return flag

bf = yorm(b)
af = yorm(a)
   
ans = bf+af
if len(ans) != 4:
    ans = 'NA'
if ans == 'MMMM':
    ans = 'AMBIGUOUS'
if ans == 'YYYY':
    ans = 'NA'
print(ans)
Buggy code:
NN = input()
AA = int(NN[0:2])
BB = int(NN[2:-1])
count1 = 0
count2 = 0
if AA >12:
  count1 +=1
if BB >12:
  count2 +=2
if count1 == 0 and count2 == 0:
  print('AMBIGUOUS')
elif count1 ==1 and count2 == 0:
  print('YYMM')
elif count1 ==0 and count2 == 1:
  print('MMYY')
else:
  print('NA')

Fixed code:
NN = input()
AA = int(NN[0:2])
BB = int(NN[2:])

count1 = 0
count2 = 0
if AA > 12 or AA == 00:
  count1 +=1
if BB > 12 or BB == 00:
  count2 +=1
if count1 == 0 and count2 == 0:
  print('AMBIGUOUS')
elif count1 ==1 and count2 == 0:
  print('YYMM')
elif count1 ==0 and count2 == 1:
  print('MMYY')
else:
  print('NA')
Buggy code:
S =input()
#MMYYcheck
ans = "NA"
if 0 < int(S[0])*10+int(S[1]) < 13 :
    ans = "MMYY"
if 0<int(S[2])*10+int(S[3])<13:
    if ans == "MMYY":
         ans ="ANBIGUOUS"
    else: ans ="YYMM"
print(ans)


Fixed code:
S =input()
#MMYYcheck
ans = "NA"
if 0 < int(S[0])*10+int(S[1]) < 13 :
    ans = "MMYY"
if 0<int(S[2])*10+int(S[3])<13:
    if ans == "MMYY":
         ans ="AMBIGUOUS"
    else: ans ="YYMM"
print(ans)
Buggy code:
a = input()
mm = int(a[:2])
yy = int(a[2:])

can1 = True
can2 = True

if mm>12:
  can1 = False
if mm<1:
  can1= False

if yy>12:
  can2 = False
if yy<1:
  can2 = False

if can1 and can2:
  print("AMBIGIOUS")
elif can2:
  print("YYMM")
elif can1:
  print("MMYY")
else:
  print("NA")

Fixed code:
a = input()
mm = int(a[:2])
yy = int(a[2:])

can1 = True
can2 = True

if mm>12:
  can1 = False
if mm<1:
  can1= False

if yy>12:
  can2 = False
if yy<1:
  can2 = False

if can1 and can2:
  print("AMBIGUOUS")
elif can2:
  print("YYMM")
elif can1:
  print("MMYY")
else:
  print("NA")
Buggy code:
li = list(input())
front = int(li[0]+li[1])
back = int(li[2]+li[3])

if front < 13:
    if back < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
        
else:
    if back<13:
        print('YYMM')
    else:
        print('NA')

Fixed code:
li = list(input())
front = int(li[0]+li[1])
back = int(li[2]+li[3])

if front > 0 and front < 13:
    if back > 0 and back < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
        
else:
    if back > 0 and back < 13:
        print('YYMM')
    else:
        print('NA')
Buggy code:

S = input()

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

MMYY_Flag = False
YYMM_Flag = False


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

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


if MMYY_Flag and YYMM_Flag:
    print ("AMBIGUOUS")

elif MMYY_Flag:
    print ("MMYY")
1700

elif YYMM_Flag:
    print ("YYMM")

else:
    print ("NA")


Fixed code:

S = input()

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

MMYY_Flag = False
YYMM_Flag = False


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

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


if MMYY_Flag and YYMM_Flag:
    print ("AMBIGUOUS")

elif MMYY_Flag:
    print ("MMYY")

elif YYMM_Flag:
    print ("YYMM")

else:
    print ("NA")
Buggy code:
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")

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

def month(n):
    if 1 <= n <= 12:
        return True
    else:
        return False
if int(s[0:2]) == 0:
    if month(int(s[2:4])) :
        print("YYMM")
        exit()
    else:
        print("NA")
        exit()

if int(s[2:4]) == 0:
    if month(int(s[1:2])):
        print("MMYY")
        exit()
    else:
        print("NA")
        exit()


if month(int(s[0:2])):
    if month(int(s[2:4])):
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if month(int(s[2:4])):
            print("YYMM")
    else:
        print("NA")


Fixed code:
s=input()

def month(n):
    if 1 <= n <= 12:
        return True
    else:
        return False


if int(s[0:2]) == 0:
    if month(int(s[2:4])) :
        print("YYMM")
        exit()
    else:
        print("NA")
        exit()

if int(s[2:4]) == 0:
    if month(int(s[0:2])):
        print("MMYY")
        exit()
    else:
        print("NA")
        exit()


if month(int(s[0:2])):
    if month(int(s[2:4])):
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if month(int(s[2:4])):
            print("YYMM")
    else:
        print("NA")
Buggy code:
s=input()
s1=int(s[0:2])
s2=int(s[2:4])

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

print(s1,s2)

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

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


Fixed code:
S = input()
front = int(S[0:2])
back = int(S[2:4])
if 1 <= front <= 12:
    if 1 <= back <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 1 <= back <= 12:
    print("YYMM")
else:
    print("NA")
Buggy code:
ym = int(input())
 
ym1 = int(ym/100)
ym2 = int(ym%100)

print(ym1,ym2)
 
if ym1 >= 1 and ym1 <= 12 and ym2 >= 1 and ym2 <=12:
  print('AMBIGUOUS')
elif ym2>=1 and ym2<=12:
  print('YYMM')
elif ym1>=1 and ym1<=12:
  print('MMYY')
else:
  print('NA')


Fixed code:
ym = int(input())
 
ym1 = int(ym/100)
ym2 = int(ym%100)
 
if ym1 >= 1 and ym1 <= 12 and ym2 >= 1 and ym2 <=12:
  print('AMBIGUOUS')
elif ym2>=1 and ym2<=12:
  print('YYMM')
elif ym1>=1 and ym1<=12:
  print('MMYY')
else:
  print('NA')