qyliang/CodeNanoFix huggingface dataset:
Buggy code:
s = input()
a, b = int(s[0:2]), int(s[2:4])
if 1 <= a <= 12 and 1 <= b <= 12:
    print("AMBIGUOUS")
elif 1 <= a <= 12:
    print("MMYY")
elif 1 <= b <= 12:
    print("YYMM")
else:
    print("NO")


Fixed code:
s = input()
a, b = int(s[0:2]), int(s[2:4])
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()
S=list(s)
m1=0
m2=0
if S[0]=='0':
    m1=1
elif S[0]=='1':
    if S[1]=='0' or S[1]=='1' or S[1]=='2':
        m1=1
    else:
        m1=0
else:
    m1=0

if S[2]=='0':
    m2=1
elif S[2]=='1':
    if S[3]=='0' or S[3]=='1' or S[3]=='2':
        m2=1
    else:
        m2=0
else:
    m2=0

if m1==1 and m2==1:
    print('AMBIGUOUS')

elif m1==1:
    print('MMYY')

elif m2==1:
    print('YYMM')

else:
    print('NA')

Fixed code:
s=input()
S=list(s)
m1=0
m2=0
if S[0]=='0':
    if S[1]!='0':
        m1=1
    else:
        m1=0

elif S[0]=='1':
    if S[1]=='0' or S[1]=='1' or S[1]=='2':
        m1=1
    else:
        m1=0
else:
    m1=0

if S[2]=='0':
    if S[3]!='0':
        m2=1
    else:
        m2=0
elif S[2]=='1':
    if S[3]=='0' or S[3]=='1' or S[3]=='2':
        m2=1
    else:
        m2=0
else:
    m2=0

if m1==1 and m2==1:
    print('AMBIGUOUS')

elif m1==1:
    print('MMYY')

elif m2==1:
    print('YYMM')

else:
    print('NA')
Buggy code:
S = input()
S_list = list(S)
A = int(S_list[0]) * 10 + int(S_list[1])
B = int(S_list[2]) * 10 + int(S_list[3])

if A <= 12 and 1 <= A:
    if B <= 12 and 1 <= B:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if B <= 12 and 1 <= B:
        print("YYMM")
    else:
        print("MA")

Fixed code:
S = input()
S_list = list(S)
A = int(S_list[0]) * 10 + int(S_list[1])
B = int(S_list[2]) * 10 + int(S_list[3])

if A <= 12 and 1 <= A:
    if B <= 12 and 1 <= B:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if B <= 12 and 1 <= B:
        print("YYMM")
    else:
        print("NA")
Buggy code:
# -*- coding: utf-8 -*-
S = list(input())
FF = ''
RR = ''
J = [0] * 2

for st in S[0],S[1]:
	FF += st

for st in S[1],S[3]:
	RR += st

if 1 <= int(FF) <= 12:
	J[0] = 1
else:
	J[0] = 0

if 1 <= int(RR) <= 12:
	J[1] = 1
else:
	J[1] = 0

if J[0] == 0 and J[1] == 0:
	print('NA')
elif J[0] == 0 and J[1] == 1:
	print('YYMM')
elif J[0] == 1 and J[1] == 0:
	print('MMYY')
else:
	print('AMBIGUOUS')

Fixed code:
# -*- coding: utf-8 -*-
S = list(input())
FF = ''
RR = ''
J = [0] * 2

for st in S[0],S[1]:
	FF += st

for st in S[2],S[3]:
	RR += st

if 1 <= int(FF) <= 12:
	J[0] = 1
else:
	J[0] = 0

if 1 <= int(RR) <= 12:
	J[1] = 1
else:
	J[1] = 0

if J[0] == 0 and J[1] == 0:
	print('NA')
elif J[0] == 0 and J[1] == 1:
	print('YYMM')
elif J[0] == 1 and J[1] == 0:
	print('MMYY')
else:
	print('AMBIGUOUS')
Buggy code:
n = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen <= 12 and go <= 12:
  print("AMBIGUOUS")
elif zen > 12 and go > 12:
  print("NA")
elif zen <= 12 and go > 12:
  print("YYMM")
elif zen > 12 and go <= 12:
  print("MMYY")

Fixed code:
n = int(input())
zen = int(n // 100)
go = int(n % 100)
if zen and zen <= 12 and go and go <= 12:
  print("AMBIGUOUS")
elif zen and zen <= 12:
  print("MMYY")
elif go and go <= 12:
  print("YYMM")
else:
  print("NA")
Buggy code:
S = int(input())
if (S // 100 > 12 or S == 0) and S % 100 > 12:
  print('NA')
elif (S // 100 > 12 or S == 0) and 1 <= S % 100 <= 12:
  print('YYMM')
elif 1 <= S // 100 <= 12 and (S % 100 > 12 or S == 0):
  print('MMYY')
else:
  print('AMBIGUOUS')


Fixed code:
S = int(input())
if (S // 100 > 12 or S // 100 == 0) and (S % 100 > 12 or S % 100 == 0):
  print('NA')
elif (S // 100 > 12 or S // 100 == 0) and 1 <= S % 100 <= 12:
  print('YYMM')
elif 1 <= S // 100 <= 12 and (S % 100 > 12 or S % 100 == 0):
  print('MMYY')
else:
  print('AMBIGUOUS')
Buggy code:
ans = ''
fmt = input()
n1 = int(fmt[:2])
n2 = int(fmt[2:])

if n1 == 0 or n2  == 0:
    ans = 'NA'
elif n1 > 12 and n2 > 12:
    ans = 'AMBIGUOUS'
elif n1 > 12:
    ans = 'YYMM'
else:
    ans = 'MMYY'
print(ans)

Fixed code:
ans = ''
fmt = input()
n1 = int(fmt[:2])
n2 = int(fmt[2:])

if n1 == 0:
    if n2 == 0:
        print("NA")
    elif n2 > 12:
        print("NA")
    else:
        print("YYMM")
elif n1 > 12:
    if n2 == 0:
        print("NA")
    elif n2 > 12:
        print("NA")
    else:
        print("YYMM")
else:
    if n2 == 0:
        print("MMYY")
    elif n2 > 12:
        print("MMYY")
    else:
        print("AMBIGUOUS")
Buggy code:
S = input()
pre = int(S[0:2])
af = int(S[2:4])
if 1 <= pre <= 12:
    preM = 1
else:
    preM = 0
if 1 <= af <= 12:
    afM = 1
else:
    afM = 0
if preM == 1:
    if afM == 1:
        ans = "AMBIGUOUS"
    else:
        ans = "MMYY"
else:
    if afM == 1:
        ans = "YYMM"
    else:
        ans == "NA"
print(ans)

Fixed code:
S = input()
pre = int(S[0:2])
af = int(S[2:4])
if 1 <= pre <= 12:
    preM = 1
else:
    preM = 0
if 1 <= af <= 12:
    afM = 1
else:
    afM = 0
if preM == 1:
    if afM == 1:
        ans = "AMBIGUOUS"
    else:
        ans = "MMYY"
else:
    if afM == 1:
        ans = "YYMM"
    else:
        ans = "NA"
print(ans)
Buggy code:
def main():
    S = input()

    l = int(S[:2])
    r = int(S[2:])

    if l > 12 and r > 12:
        print("NA")
        exit()
    if l == 0 and r == 0:
        print("NA")
        exit()

    if l > 12 or l == 0:
        print("YYMM")
        exit()

    if r > 12 or r == 0:
        print("MMYY")
        exit()

    print("AMBIGUOUS")


main()


Fixed code:
def main():
    S = input()

    l = int(S[:2])
    r = int(S[2:])

    if (l > 12 or l == 0) and (r > 12 or r == 0):
        print("NA")
        exit()

    if l > 12 or l == 0:
        print("YYMM")
        exit()

    if r > 12 or r == 0:
        print("MMYY")
        exit()

    print("AMBIGUOUS")


main()
Buggy code:
x=input()
a=x[:2]
b=x[2:]
ans_lst=[]
for y in [a,b]:
	if "00"<y<"13":
  		ans_lst.append(True)
    else:ans_lst.append(False)
if all(ans_lst):
    print("AMBIGUOUS")
elif not any(ans_lst):
    print("NA")
elif ans_lst[0] and ans_lst[1]==False:
	print("MMYY")
elif ans_lst[0]==False and ans_lst[1]:
	print("YYMM")

Fixed code:
x=input()
a=x[:2]
b=x[2:]
ans_lst=[]
for y in [a,b]:
	if "00"<y<"13":
		ans_lst.append(True)
	else:ans_lst.append(False)
if all(ans_lst):
    print("AMBIGUOUS")
elif not any(ans_lst):
    print("NA")
elif ans_lst[0] and ans_lst[1]==False:
	print("MMYY")
elif ans_lst[0]==False and ans_lst[1]:
	print("YYMM")
Buggy code:
S=input()
mae=S[:2]
ato=S[2:]
mon_list=("01","02","03","04","05","06","07","08","09","10","11","12")
test=0
if mae in mon_list:
  test=test+1
if ato in mon_list:
  test=test+3

if test==0:
  print("NA")
if test==1:
  print("YYMM")
if test==3:
  print("MMYY")
if test==4:
  print("AMBIGUOUS")

Fixed code:
S=input()
mae=S[:2]
ato=S[2:]
mon_list=("01","02","03","04","05","06","07","08","09","10","11","12")
test=0
if mae in mon_list:
  test=test+1
if ato in mon_list:
  test=test+3

if test==0:
  print("NA")
if test==1:
  print("MMYY")
if test==3:
  print("YYMM")
if test==4:
  print("AMBIGUOUS")
Buggy code:
s = input()

x = int(s[0:2])
y = int(s[3:])

if x > 12:
    if y > 12:
        print("NA")
    elif y >= 1:
        print("YYMM")
    else:
        print("NA")
elif x >= 1
    if y > 12:
        print("MMYY")
    elif y >= 1:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if y > 12:
        print("NA")
    if y >= 1:
        print("YYMM")
    else:
        print("NA")
        

Fixed code:
s = input()

x = int(s[0:2])
y = int(s[2:])

if x > 12:
    if y > 12:
        print("NA")
    elif y >= 1:
        print("YYMM")
    else:
        print("NA")
elif x >= 1:
    if y > 12:
        print("MMYY")
    elif y >= 1:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if y > 12:
        print("NA")
    if y >= 1:
        print("YYMM")
    else:
        print("NA")
Buggy code:
#!/usr/bin/env python3

s = str(input())

a = s[0:2]

b = s[2:]


def div(a):
    a = int(a)
    if a <= 12 and a >= 1:
        return "BOTH"
    else:
        return "YY"


if div(a) == div(b):
    if div(a) == "YY":
        print("NA")
    else:
        print("AMBIGUOUS")
elif div(a) == "YY":
    print(b+a)
else:
    print(a+b)


Fixed code:
#!/usr/bin/env python3

s = str(input())

a = s[0:2]

b = s[2:]


def div(a):
    a = int(a)
    if a <= 12 and a >= 1:
        return "BOTH"
    else:
        return "YY"


if div(a) == div(b):
    if div(a) == "YY":
        print("NA")
    else:
        print("AMBIGUOUS")
elif div(a) == "YY":
    print("YYMM")
else:
    print("MMYY")
Buggy code:
def main():
    S = input()
    mae = int(S[:2])
    ushiro = int(S[2:])
    if (mae == 0 or mae > 12) and (ushiro == 0 or ushiro > 12): print('NA')
    elif (mae == 0 or mae > 12): print('YYMM')
    elif (ushiro == 0 or ushiro > 12): print('MMYY')
    else: print('AMBIGuOUS')



if __name__ == '__main__':
    main()


Fixed code:
def main():
    S = input()
    mae = int(S[:2])
    ushiro = int(S[2:])
    if (mae == 0 or mae > 12) and (ushiro == 0 or ushiro > 12): print('NA')
    elif (mae == 0 or mae > 12): print('YYMM')
    elif (ushiro == 0 or ushiro > 12): print('MMYY')
    else: print('AMBIGUOUS')



if __name__ == '__main__':
    main()
Buggy code:
S = input()

f = int(S[0]+S[1])
s = int(S[2]+S[3])

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

Fixed code:
S = input()

f = int(S[0]+S[1])
s = int(S[2]+S[3])

if f >= 1 and f <= 12 and s >= 1 and s <= 12:
  print('AMBIGUOUS')
elif f >= 1 and f <=12 and (s >= 13 or s == 0):
  print('MMYY')
elif (f >= 13 or f == 0) and s >= 1 and s <= 12:
  print('YYMM')
else:
  print('NA')
Buggy code:
c = int(input())

a = int (c / 100)
b = c % 100
if 0 < a <13:
    if 0 < b <13:
        print('AMBIGOUS')
    else:
        print('MMYY')
else:
    if 0 < b <13:
        print('YYMM')
    else:
        print('NA')






Fixed code:
c = int(input())

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


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

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

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


Fixed code:
a = input()

if 1 <= int(a[:2]) <= 12 and 1 <= int(a[2:]) <= 12:
    print("AMBIGUOUS")
elif 1 <= int(a[:2]) <= 12:
    print("MMYY")
elif 1 <= int(a[2:]) <= 12:
    print("YYMM")
else:
    print("NA")
Buggy code:
S = input()
if ((int(S[:2]) == 0) and (int(S[2:4])) == 0):
    print("{}".format("NA"))
elif (int(S[:2]) == 0) and (12< int(S[2:4])):
    print("{}".format("NA"))
elif(12< (int(S[:2])) and (int(S[2:4]) == 0)):
    print("{}".format("NA"))
elif (12 < int(S[:2])) and (12 < int(S[2:4])):
      print("{}".format("NA"))
elif(int(S[:2]) == 0) and (int(S[2:4]) < 13):
    print("{}".format("YYMM"))
elif(int(S[:2]) < 13) and (int(S[2:4]) == 0):
    print("{}".format("MMYY"))
elif (0<(int(S[:2]) <13) and (0< int(S[2:4]) < 13)):
    print("{}".format("AMBIGUOUS"))
elif(int(S[:2]) < 13):
     print("{}".format("MMYY"))
elif(0 <int(S[2]) <13):
     print("{}".format("YYMM"))
elif((int(S[:2]) > 12) and (int(S[2:4]) > 12)):
    print("{}".format("NA"))

Fixed code:
S = input()
if ((int(S[:2]) == 0) and (int(S[2:4])) == 0):
    print("{}".format("NA"))
elif (int(S[:2]) == 0) and (12< int(S[2:4])):
    print("{}".format("NA"))
elif(12< (int(S[:2])) and (int(S[2:4]) == 0)):
    print("{}".format("NA"))
elif (12 < int(S[:2])) and (12 < int(S[2:4])):
      print("{}".format("NA"))
elif(int(S[:2]) == 0) and (int(S[2:4]) < 13):
    print("{}".format("YYMM"))
elif(int(S[:2]) < 13) and (int(S[2:4]) == 0):
    print("{}".format("MMYY"))
elif (0<(int(S[:2]) <13) and (0< int(S[2:4]) < 13)):
    print("{}".format("AMBIGUOUS"))
elif(int(S[:2]) < 13):
     print("{}".format("MMYY"))
else:
     print("{}".format("YYMM"))
Buggy code:
def can_be_month(n):
    if 0 < int(n) < 13:
        return True
    return False


S = input()

if not S:
    print('NA')
elif can_be_month(S[:2]) and can_be_month(S[2:]):
    print('AMBIGUOUS')
elif can_be_month(S[:2]):
    print('MMYY')
elif can_be_month(S[2:]):
    print('YYMM')


Fixed code:
def can_be_month(n):
    if 0 < int(n) < 13:
        return True
    return False


S = input()

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

Fixed code:
s=input()
sf=int(s[:2])
sl=int(s[2:4])
if sf>=13 and 13>sl>0 or sf==0 and 13>sl>0:
  print('YYMM')
elif 12>=sf>0 and sl==0 or 13>sf>0 and sl>=13:
  print('MMYY')
elif 13>sf>0 and 13>sl>0 or 13>sf>0 and 13>sl>0:
  print('AMBIGUOUS')
else:
  print('NA')
Buggy code:
#s = int(input())
#first = s//100
#second = s%100
s=input()
first = int(s[:2])
second = int(s[2:])
#print(first,second)

if first > 12 and second > 12:
  print('NA') # YY/YY
elif first > 12 and second <=12:
  print('YYMM')
elif first <= 12 and second > 12:
  print('MMYY')
else:
  print('AMBIGUOUS')

Fixed code:
#s = int(input())
#first = s//100
#second = s%100
s=input()
first = int(s[:2])
second = int(s[2:])
#print(first,second)

if (first > 12 or first < 1) and (second > 12 or second < 1):
  print('NA') # YY/YY
elif (first > 12 or first == 0) and (second > 0 and second <=12):
  print('YYMM')
elif (first > 0 and first <= 12) and (second ==0 or second > 12):
  print('MMYY')
else:
  print('AMBIGUOUS')
Buggy code:
S = input()
u = int(S[0]) * 10 + int(S[1])
d = int(S[2]) * 10 + int(S[3])

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



Fixed code:
S = input()
u = int(S[0]) * 10 + int(S[1])
d = int(S[2]) * 10 + int(S[3])

if d >= 1 and d <= 12:
  if u >= 1 and u <=12:
    print("AMBIGUOUS")
  else:
    print("YYMM")
elif u >= 1 and u <= 12:
  print("MMYY")
else:
  print("NA")
Buggy code:
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input().strip()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if (first_half == [True, True] and second_half == [True, True]):
  print('AMBIGUOUS')
elif first_half[0] is True and second_half[1] is True:
  print('MMYY')
elif first_half[1] == False and second_half[0] is True:
  print('YYMM')
else:
  print('NA')

Fixed code:
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input().strip()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if (first_half == [True, True] and second_half == [True, True]):
  print('AMBIGUOUS')
elif first_half[0] is True and second_half[1] is True:
  print('MMYY')
elif first_half[1] is True and second_half[0] is True:
  print('YYMM')
else:
  print('NA')
Buggy code:
S = input()
S_a = int(S[0] + S[1])
S_b = int(S[2] + S[3])
if((S_a >= 1 and S_a <= 12) and (S_b < 1 or S_b > 12)):
  print('MMYY')
elif((S_a < 1 or S_a > 12) and (S_b >= 1 and S_b <= 12)):
  print('YYMM')
elif((S_a >= 1 and S_a <= 12) and (S_b >= 1 and S_b <= 12)):
  print('AMBIGUOUS')
else:
  print('NO')

Fixed code:
S = input()
S_a = int(S[0] + S[1])
S_b = int(S[2] + S[3])
if((S_a >= 1 and S_a <= 12) and (S_b < 1 or S_b > 12)):
  print('MMYY')
elif((S_a < 1 or S_a > 12) and (S_b >= 1 and S_b <= 12)):
  print('YYMM')
elif((S_a >= 1 and S_a <= 12) and (S_b >= 1 and S_b <= 12)):
  print('AMBIGUOUS')
else:
  print('NA')
Buggy code:
S = input()
first = int(S[:2])
second = int(S[2:])

def month(num):
  if first <= 12:
    return True
  else:
    return False

if month(first) and month(second):
  print('AMBIGUOUS')

elif month(first) and month(second) == False:
  print('MMYY')

elif month(first) == False and month(second):
  print('YYMM')

else:
  print('NA')





Fixed code:
def month(num):
    if 0 < num <= 12:
        return True
    else:
        return False


S = input()
first = int(S[:2])
second = int(S[2:])

if month(first):
    if month(second):
        print('AMBIGUOUS')
    else:
        print('MMYY')

elif not month(first) and month(second):
    print('YYMM')

else:
    print('NA')
Buggy code:
def solve():
	unknownDate = input()
	datePre = int(unknownDate[:2])
	datePos = int(unknownDate[2:])
	
	isPreMightMonth = (0 < datePre <= 12)
	isPostMightMonth = (0 < datePos <= 12)
	
	if isPreMightMonth and isPostMightMonth:
		print('AMBIGUOUS')
	elif isPreMightMonth and (not isPostMightMonth):
		print('MMYY')
	elif (not isPreMightMonth) and isPostMightMonth:
		print('YYMM')
	else:
		print('NA')
 solve()

Fixed code:
def solve():
	unknownDate = input()
	datePre = int(unknownDate[:2])
	datePos = int(unknownDate[2:])
	
	isPreMightMonth = (0 < datePre <= 12)
	isPostMightMonth = (0 < datePos <= 12)
	
	if isPreMightMonth and isPostMightMonth:
		print('AMBIGUOUS')
	elif isPreMightMonth and (not isPostMightMonth):
		print('MMYY')
	elif (not isPreMightMonth) and isPostMightMonth:
		print('YYMM')
	else:
		print('NA')
solve()
Buggy code:
s = input()

x = int(s[:2])
y = int(s[2:])

if x > 12 and y > 12:
    print('NA')
elif x == 0 and y == 0:
    print('NA')
elif (x > 12 or x == 0) and y <= 12:
    print('YYMM')
elif x <= 12 and (y > 12 or y == 0):
    print('MMYY')
else:
    print('AMBIGUOUS')

Fixed code:
s = input()

x = int(s[:2])
y = int(s[2:])

if (x > 12 or x == 0) and (y > 12 or y == 0):
    print('NA')
elif (x > 12 or x == 0) and y <= 12:
    print('YYMM')
elif x <= 12 and (y > 12 or y == 0):
    print('MMYY')
else:
    print('AMBIGUOUS')
Buggy code:
S=input()
x=int(S[0:2])
y=int(S[2:4])
if x>0 & y>0 & x<13 & y<13: print('AMBIGUOUS')
elif x>0 & x<13 & y>13: print('MMYY')
elif y>0 & y<13 & x>13: print('YYMM')
else: print('NA')

Fixed code:
S=input()
x=int(S[0:2])
y=int(S[2:4])
if (0<x<13) & (0<y<13): print('AMBIGUOUS')
elif (0<x<=12) & ((y>=13) | (y==0)): print('MMYY')
elif (0<y<=12) & ((x>=13) | (x==0)): print('YYMM')
else: print('NA')
Buggy code:
i = input()
x = int(i[0:2])
y = int(i[2:4])

def isMM(a):
  return 1 <= a and a <= 12

r = isMM(x) * 2 + isMM(y)

print(["NA", "YYMM", "MMYY", "AMBIGIOUS"][r])

Fixed code:
i = input()
x = int(i[0:2])
y = int(i[2:4])

def isMM(a):
  return 1 <= a and a <= 12

r = isMM(x) * 2 + isMM(y)

print(["NA", "YYMM", "MMYY", "AMBIGUOUS"][r])
Buggy code:
S = list(map(int, input()))
L = 10 * S[0] + S[1]
R = 10 * S[2] + S[3]
if L == 0 and R == 0:
    print('NA')
elif L == 0 and R <= 12:
    print('YYMM')
elif L <= 12 and R == 0:
    print('MMYY')
elif L <= 12:
    if R <= 12:
        print('AMBIGUOUS')
    else:
        print("MMYY")
elif L > 12:
    if R <= 12:
        print('YYMM')
    else:
        print('NA')

        

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

Y = s/100
M = s%100
flag=0
#YYMM
if(M!=0 and M<13):
    flag+=1
#MMYY
if(Y!=0 and Y<13):
    flag+=2

if(flag==0):
    print('NA')
elif(flag==1):
    print('YYMM')
elif(flag==2):
    print('MMYY')
elif(flag==3):
    print('AMBIGUOS')

Fixed code:
s = int(input())

Y = s//100
M = s%100
flag=0
#YYMM
if(M!=0 and M<13):
    flag+=1
#MMYY
if(Y!=0 and Y<13):
    flag+=2

if(flag==0):
    print('NA')
elif(flag==1):
    print('YYMM')
elif(flag==2):
    print('MMYY')
elif(flag==3):
    print('AMBIGUOUS')
Buggy code:
S = list(input())

left = int(''.join(S[0:2]))
right = int(''.join(S[2:4]))
print(left)
print(right)

if (left > 0 and left < 13) and (right > 0 and right < 13):
  print('AMBIGUOUS')
elif left >= 0 and (right > 0 and right < 13):
  print('YYMM')
elif (left > 0 and left < 13) and right >= 0:
  print('MMYY')
else:
  print('NA')
  

Fixed code:
S = list(input())

left = int(''.join(S[0:2]))
right = int(''.join(S[2:4]))

if (left > 0 and left < 13) and (right > 0 and right < 13):
  print('AMBIGUOUS')
elif left >= 0 and (right > 0 and right < 13):
  print('YYMM')
elif (left > 0 and left < 13) and right >= 0:
  print('MMYY')
else:
  print('NA')
Buggy code:

def main():
    S = input()

    A = int(S[:2])
    B = int(S[2:])
    print(A, B)

    if A != 0 and B <= 12 and B != 0 and A <= 12:
        print("AMBIGUOUS")

    elif (A != 0 and B <= 12) and B != 0:
        print("YYMM")

    elif (B != 0 and A <= 12) and A != 0:
        print("MMYY")

    else:
        print("NA")


if __name__ == "__main__":
    main()


Fixed code:

def main():
    S = input()

    A = int(S[:2])
    B = int(S[2:])

    if A != 0 and B <= 12 and B != 0 and A <= 12:
        print("AMBIGUOUS")

    elif (A != 0 and B <= 12) and B != 0:
        print("YYMM")

    elif (B != 0 and A <= 12) and A != 0:
        print("MMYY")

    elif (A == 0 and 1 <= B and B <= 12):
        print("YYMM")

    elif (B == 0 and 1 <= A and A <= 12):
        print("MMYY")

    else:
        print("NA")


if __name__ == "__main__":
    main()
Buggy code:
S = input()
ls = ['01','02','03','04','05','06','07','08','09','10','11','12']
for x in ls:
    if x == S[:2]:
        for x in ls:
            if x == S[2:]:
                print('AMBIGUOUS')
            else:
                print('MMYY')
    else:
        for x in ls:
            if x == S[2:]:
                print('YYMM')
            else:
                print('NA')

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

if S[:2] in ls:
    if S[2:] in ls:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if S[2:] in ls:
        print('YYMM')
    else:
        print('NA')
Buggy code:
import sys

s=input()

chars2=[int(s[i: i+2])for i in range(0,len(s),2)]

if (chars2[0]>0 and  chars2[0]<13):
    if (chars2[1]>0 and  chars2[1]<13):
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if (chars2[1]>0 and  chars2[1]<13):
        print('YYMM')
    else:
        print('NS')


Fixed code:
import sys

s=input()

chars2=[int(s[i: i+2])for i in range(0,len(s),2)]

if (chars2[0]>0 and  chars2[0]<13):
    if (chars2[1]>0 and  chars2[1]<13):
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if (chars2[1]>0 and  chars2[1]<13):
        print('YYMM')
    else:
        print('NA')