Problem:


Score : 200 points

Problem Statement

You have a digit sequence S of length 4. You are wondering which of the following formats S is in:

YYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order

MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order

If S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.

Constraints

S is a digit sequence of length 4.

Input

Input is given from Standard Input in the following format:

S

Output

Print the specified string: YYMM, MMYY, AMBIGUOUS or NA.

Sample Input 1

1905

Sample Output 1

YYMM

May XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.

Sample Input 2

0112

Sample Output 2

AMBIGUOUS

Both December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.

Sample Input 3

1700

Sample Output 3

NA

Neither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.



Sample input:
1905


Sample output:
YYMM

Submission status: Wrong Answer

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

if S1 == 0 or S2 == 0:
    print('NA')
elif S1 >= 13 and S2 < 13:
    print('YYMM')
elif S1 < 13 and S2 >= 13:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

if S1 == 0 or S2 == 0:
    print('NA')
elif S1 > 13 and S2 < 13:
    print('YYMM')
elif S1 < 13 and S2 > 13:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

for i in range(10,100):

        YY.append(str(i))

if str(N[0])+str(N[1]) in YY and str(N[0])+str(N[1]) in MM and str(N[2])+str(N[3]) in YY and str(N[2])+str(N[3]) in MM:
    print("AMBIGUOUS")

elif str(N[0])+str(N[1]) in MM and str(N[2])+str(N[3]) in YY:
    print("MMYY")

elif str(N[0])+str(N[1]) in YY and str(N[2])+str(N[3]) in MM:
    print("YYMM")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = 0
b = 0
if (S[0] == '0' and S[1] != '0') or (S[0] == '1' and (S[1] == '0' or S[1] == '1' or S[1] == '2')):
  a = 1
if (S[2] == '0' and S[1] != '0') or (S[2] == '1' and (S[3] == '0' or S[3] == '1' or S[3] == '2')):
  b = 1
if a == 1 and b == 1:
  print("AMBIGUOUS")
elif a == 1:
  print("MMYY")
elif b == 1:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = 0
b = 0
if (S[0] == '0' and S[1] != '0') or (S[0] == '1' and (S[1] == '1' or S[1] == '2')):
  a = 1
if (S[2] == '0' and S[1] != '0') or (S[2] == '1' and (S[3] == '1' or S[3] == '2')):
  b = 1
if a == 1 and b == 1:
  print("AMBIGUOUS")
elif a == 1:
  print("MMYY")
elif b == 1:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = 0
b = 0
if S[0] == '0' or (S[0] == '1' and (S[1] == '1' or S[1] == '2')):
  a = 1
if S[2] == '0' or (S[2] == '1' and (S[3] == '1' or S[3] == '2')):
  b = 1
if a == 1 and b == 1:
  print("AMBIGUOUS")
elif a == 1:
  print("MMYY")
elif b == 1:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = 0
b = 0
if S[0] == '0' or (S[0] == '1' and (S[1] == '1' or S[1] == '2')):
  a = 1
if S[2] == '0' or (S[3] == '1' and (S[3] == '1' or S[3] == '2')):
  b = 1
if a == 1 and b == 1:
  print("AMBIGUOUS")
elif a == 1:
  print("MMYY")
elif b == 1:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:

s = list(input())

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

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

Submission status: Wrong Answer

Solution code:
S = list(input())

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

Submission status: Wrong Answer

Solution code:
S = list(input())

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

Submission status: Wrong Answer

Solution code:
S = list(input())

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

Submission status: Wrong Answer

Solution code:
S = list(input())

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

Submission status: Wrong Answer

Solution code:
s = input()
start = int(s[0]+s[1])
end = int(s[2]+s[3])

if 1 <= start <= 12 and 1 <= end <= 12:
    print("AMBIGUOUS")
elif 1 <= start <= 12 and (end > 12 or end == 0):
    print("MMYY")
elif (start > 12 or end == 0) and 1 <= end <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

#print(int(S[:2]), int(S[2:]))

if int(S[2:]) == 0 or int(S[:2]) == 0:
    print('NA')
elif int(S[:2]) <= 12:
    print('MMYY')
elif int(S[2:]) <= 12:
    print('YYMM')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()

#print(int(S[:2]), int(S[2:]))

if int(S[2:]) == 0 or int(S[:2]) == 0:
    print('NA')
elif int(S[:2]) <= 12 and int(S[2:]) > 12:
    print('MMYY')
elif int(S[:2]) > 12 and int(S[2:]) <= 12:
    print('YYMM')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()

#print(int(S[:2]), int(S[2:]))

if S[2:] == '00' or S[:2] == '00':
    print('NA')
elif int(S[:2]) <= 12 and int(S[2:]) > 12:
    print('MMYY')
elif int(S[:2]) > 12 and int(S[2:]) <= 12:
    print('YYMM')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()

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

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

Submission status: Wrong Answer

Solution code:
s = input()

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

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

Submission status: Wrong Answer

Solution code:
s = input()
#print(s[2])
#print(int(s[0] + s[1]))

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

Submission status: Wrong Answer

Solution code:
s = input()
#print(s[2])
#print(int(s[0] + s[1]))

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

Submission status: Wrong Answer

Solution code:
s = input()
#print(s[2])
print(int(s[0] + s[1]))

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

Submission status: Wrong Answer

Solution code:
s=int(input())
n1=s//100
n2=s%100
if 0<n1<=12 and 0<n2<=12:
    print('AMBIGUOUS')
elif 0<n1 and 0<n2<=12:
    print('YYMM')
elif 0<n2 and 0<n1<=12:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
j = int(s[:2])
k = int(s[2:])
if 0 < j <= 12 and 0 < k <= 12:
    print("AMBIGUOUS")
elif 0 < j <= 99 and 0 < k <= 12:
    print("YYMM")
elif 0 < k <= 99 and 0 < j <= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
j = int(s[:2])
k = int(s[2:])
if 0 < j <= 12 and 0 < k <= 12:
    print("AMBIGUOUS")
elif 0 < j <= 99 and 0 < k <= 12:
    print("YYMM")
elif 0 < k <= 99 and 0 < k <= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
j = int(s[:2])
k = int(s[2:])
if j <= 12 and k <= 12 and j != 0 and k != 0:
    print("AMBIGUOUS")
elif j > 12 and k != 0:
    print("YYMM")
elif j <= 12 and k > 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
j = int(s[:2])
k = int(s[2:])
if j > 12 and k > 12 or ((j >= 12 or k > 12) and (j == 0 or k == 0)) or (j == k == 0):
    print("NA")
elif j <= 12 and k <= 12:
    print("AMBIGUOUS")
elif j > 12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
j = int(s[:2])
k = int(s[2:])
if j > 12 and k > 12 or ((j >= 12 or k > 12) and (j == 0 or k == 0)):
    print("NA")
elif j <= 12 and k <= 12:
    print("AMBIGUOUS")
elif j > 12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = int(input())
s_1 = s // 100 #4桁の数字列の上2桁を取り出す
s_2 = s % 100  #4桁の数字列の下2桁を取り出す

if 1 <= s_1 <=12 and 1 <= s_2 <= 12:
    print("AMBIGUOUS")
elif 1 <= s_1 <= 12 and s_2 > 12 or s_2 == 0:
    print("MMYY")
elif 1 <= s_2 <= 12 and s_1 > 12 or s_1 == 0:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = int(input())
s_1 = s // 100 #4桁の数字列の上2桁を取り出す
s_2 = s % 100  #4桁の数字列の下2桁を取り出す

if 1 <= s_1 <=12 and 1 <= s_2 <= 12:
    print("AMBIGUOUS")
elif 1 <= s_1 <= 12 and s_2 > 12:
    print("MMYY")
elif 1 <= s_2 <= 12 and s_1 > 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()


if 0 < int(S[:2]) <= 12 and  0 < int(S[2:]) <= 12:
    print("AMBIGUOUS")
elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 0 < int(S[2:]) <= 12:
    print("YYMM")
elif 0 < int(S[:2]) <= 12 and (int(S[2:]) > 12 or int(S[:2]) == 0):
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=str(input())

Ans=[int(S[0]+S[1]),int(S[2]+S[3])]

if Ans[0]>12:
    if Ans[1]>12:
        print("NA")
    elif Ans[1]==0:
        print("NA")
    else:
        print("YYMM")
elif Ans[0]==0:
    print("NA")
else:
    if Ans[1]>12:
        print("MMYY")
    elif Ans[1]==0:
        print("NA")
    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S=str(input())

Ans=[int(S[0]+S[1]),int(S[2]+S[3])]

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

Submission status: Wrong Answer

Solution code:
S=str(input())

Ans=[int(S[0]+S[1]),int(S[2]+S[3])]

if Ans[0]==0 or Ans[1]==0:
    print("NA")
elif Ans[0]>12 or Ans[0]<1:
    if Ans[1]>12 or Ans[1]<1:
        print("NA")
    else:
        print("YYMM")
else:
    if Ans[1]>12 or Ans[1]<1:
        print("MMYY")
    else:
        print("AMBIGOUS")

Submission status: Wrong Answer

Solution code:
S=str(input())

Ans=[int(S[0]+S[1]),int(S[2]+S[3])]

if Ans[0]==0 or Ans[1]==0:
    print("NA")
elif Ans[0]>12 or Ans[0]<1:
    if Ans[1]>12 or Ans[1]<1:
        print("NA")
    else:
        print("YYMM")
else:
    if Ans[1]>12 or Ans[1]<1:
        print("MMYY")
    else:
        print("AMBIGUOS")

Submission status: Wrong Answer

Solution code:
S=str(input())

Ans=[int(S[0]+S[1]),int(S[2]+S[3])]

if Ans[0]==0 or Ans[1]==0:
    print("NA")
elif Ans[0]>12 or Ans[0]<1:
    if Ans[1]>12 or Ans[1]<1:
        print("NA")
    else:
        print("YYMM")
else:
    if Ans[1]>12 or Ans[1]<1:
        print("MMYY")
    else:
        print("AMBIGUOS")

Submission status: Wrong Answer

Solution 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")

Submission status: Wrong Answer

Solution code:
S = list(map(str, input()))

F = int(S[0]+S[1])
L = int(S[2]+S[3])

if (L == 0 and F == 0) or (F > 12 and L > 12):
  print('NA')

elif F <= 12 and (L > 12 or L == 0):
  print('MMYY')
  
elif L <= 12 and (F > 12 or F == 0):
  print('YYMM')
  
 
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = list(map(str, input()))

F = int(S[0]+S[1])
L = int(S[2]+S[3])

if L == 0 or F == 0 or (F > 12 and L > 12):
  print('NA')

elif F <= 12 and L > 12:
  print('MMYY')
  
elif L <= 12 and F > 12:
  print('YYMM')
  
 
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = list(map(str, input()))

F = int(S[0]+S[1])
L = int(S[2]+S[3])

if L == 0 or F == 0 or F >= 13 and L >= 13:
  print('NA')

elif F <= 12 and L > 12:
  print('MMYY')
  
elif L <= 12 and F > 12:
  print('YYMM')
  
 
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = list(map(str, input()))

F = int(S[0]+S[1])
L = int(S[2]+S[3])

if L == 0 or F == 0 or F >= 13 and L >= 13:
  print('NA')

elif F <= 12 and L > 12:
  print('MMYY')
  
elif L <= 12 and F > 12:
  print('YYMM')
  
 
else:
  print('AMBIGOUS')

Submission status: Wrong Answer

Solution code:
def solve_128b(a, b):
    if 1 <= a & a <= 12:
        if 1 <= b & b <= 12:
            return "AMBIGUOUS"
        else:
            return "MMYY"
    else:
        if 1 <= b & b <= 12:
            return "YYMM"
        else:
            return "NA"

s = input()
s1 = int(s[0:2])
s2 = int(s[2:4])
print(solve_128b(s2, s1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
if (int(S[:2]) > 12 and int(S[2:]) > 12) or int(S[:2]) == 0 or int(S[2:]) == 0:
    print("NA")
elif int(S[:2]) > 12:
    print("YYMM")
elif int(S[2:]) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
if int(S[:2]) > 12 and int(S[2:]) > 12 or int(S[:2]) == 0 or int(S[2:]) == 0:
    print("NA")
elif int(S[:2]) > 12:
    print("YYMM")
elif int(S[2:]) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
if int(S[:2]) > 12 and int(S[2:]) > 12:
    print("NA")
elif int(S[:2]) > 12:
    print("YYMM")
elif int(S[2:]) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s=input()
f=int(s[:2])
b=int(s[2:4])

if (f>=13 or f==00)and b>=13 :
    print('NA')
if (f>=13 or f==00)and 1<=b<=12 :
    print('YYMM')
elif 1<=f<=12 and (b>=13 or b==00) :
    print('MMYY')
elif f<=13 and (b>=13 or b==00) :
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s=input()
f=int(s[:2])
b=int(s[2:4])

if (f>=13 or f==00)and b>=13 :
    print('NA')
if (f>=13 or f==00)and 1<=b<=12 :
    print('YYMM')
elif 1<=f<=12 and (b>=13 or b==00) :
    print('MMYY')
if f<=13 and (b>=13 or b==00) :
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s=input()
f=int(s[:2])
b=int(s[2:4])

if (f>=13 or f==00)and b>=13 :
    print('NA')
elif (f>=13 or f==00)and 1<=b<=12 :
    print('YYMM')
elif 1<=f<=12 and (b>=13 or b==00) :
    print('MMYY')
elif f<=13 and (b>=13 or b==00) :
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s=input()
f=int(s[:2])
b=int(s[2:4])

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

Submission status: Wrong Answer

Solution code:
s=input()
f=int(s[:2])
b=int(s[2:4])

if (f>=13 or f==00)and b>=13 :
    print('NA')
elif (f>=13 or f==00)and b<=12 :
    print('YYMM')
elif f<=12 and (b>=13 or b==00) :
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s=input()
f=int(s[:2])
b=int(s[2:4])

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

Submission status: Wrong Answer

Solution code:
s=input()
f=int(s[:2])
b=int(s[2:4])

if b>=13 or b==0:
    print('NA')
elif f>=13:
    print('YYMM')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
 
s1 = int(S[0] + S[1])
s2 = int(S[2] + S[3])
 
if s1 > 12: #YY
    if 0 < s2 <= 12:
        print('YYMM')
    else:
        print('NA')
elif s2 > 12: #YY
    if 0 < s1 <= 12:
        print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

if s[:2] == "00" and s[2:] == "00":
  print("NA")
  exit()

if int(s[:2]) >= 13 and int(s[2:]) >= 13:
  print("NA")
  exit()

if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:
  print("AMBIGUOUS")
  exit()


if  int(s[2:]) >= 12:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

if s[:2] == "00" and s[2:] == "00":
  print("NA")
  exit()

if int(s[:2]) >= 13 and int(s[2:]) >= 13:
  print("NA")
  exit()

if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:
  print("AMBIGUOUS")
  exit()


if 1 <= int(s[2:]) >= 12:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

if s[:2] == "00" and s[2:] == "00":
  print("NA")
  exit()

if int(s[:2]) >= 13 and int(s[2:]) >= 13:
  print("NA")
  exit()

if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:
  print("AMBIGUOUS")
  exit()


if int(s[2:]) > 13:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

if s[:2] == "00" or s[2:] == "00":
  print("NA")
  exit()

if int(s[:2]) >= 13 and int(s[2:]) >= 13:
  print("NA")
  exit()

if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:
  print("AMBIGUOUS")
  exit()


if int(s[2:]) > 13:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

if s[:2] == "00" or s[2:] == "00":
  print("NA")
  exit()

if int(s[:2]) > 13 and int(s[2:]) > 13:
  print("NA")
  exit()

if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:
  print("AMBIGUOUS")
  exit()


if int(s[2:]) > 13:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

if s[:2] == "00" or s[2:] == "00":
  print("NA")
  exit()

if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:
  print("AMBIGUOUS")
  exit()


if int(s[2:]) > 13:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

if s[:2] == "00" or s[2:] == "00":
  print("NA")
  exit()

if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:
  print("AMBIGUOUS")
  exit()

if int(s[2:]) > 13:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2])
b = int(s[2:])
if a <= 12:
  if b <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if b <= 12:
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

Solution 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')

Submission status: Wrong Answer

Solution code:
S = input()

if S[:2] == '00' and int(S[2:]) > 12:
    print('NA')
elif S[2:] == '00' and int(S[:2]) > 12:
    print('NA')
elif S == '0000':
    print('NA')
if S[:2] == '00' and int(S[2:]) <= 12:
    print('YYMM')
elif S[2:] == '00' and int(S[:2]) <= 12:
    print('MMYY')
elif int(S[:2]) <= 12 and int(S[2:]) <= 12:
    print('AMBIGUOUS')
elif int(S[:2]) <= 12:
    print('MMYY')
elif int(S[2:]) <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

if S[:2] == '00' and int(S[2:]) > 12:
    print('NA')
elif S[2:] == '00' and int(S[:2]) > 12:
    print('NA')
elif S == '0000':
    print('NA')
elif int(S[:2]) <= 12 and int(S[2:]) <= 12:
    print('AMBIGUOUS')
elif int(S[:2]) <= 12:
    print('MMYY')
elif int(S[2:]) <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

if S[:2] == '00' and int(S[2:]) > 12:
    print('NA')
elif S[2:] == '00' and int(S[:2]) > 12:
    print('NA')
elif int(S[:2]) <= 12 and int(S[2:]) <= 12:
    print('AMBIGUOUS')
elif int(S[:2]) <= 12:
    print('MMYY')
elif int(S[2:]) <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

if S[:2] == '00' or S[2:] == '00':
    print('NA')
elif int(S[:2]) <= 12 and int(S[2:]) <= 12:
    print('AMBIGUOUS')
elif int(S[:2]) <= 12:
    print('MMYY')
elif int(S[2:]) <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
am = s[0]+s[1]
pm = s[2]+s[3]
p = ["01","02","03","04","05","06","07","08","09","10","11","12"]
if am in p and pm in p:
    print("AMBIGUOUGS")
elif am in p and pm not in p:
    print("MMYY")
elif am not in p and pm in p:
    print("YYMM")
elif am not in p and pm not in p:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

s1 = int(S[0] + S[1])
s2 = int(S[2] + S[3])

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

Submission status: Wrong Answer

Solution code:
S = input()

s1 = int(S[0] + S[1])
s2 = int(S[2] + S[3])

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

Submission status: Wrong Answer

Solution code:
S = input()

s1 = int(S[0] + S[1])
s2 = int(S[2] + S[3])

if s1 > 12: #YY
    if s2 > 12 or s2 == 0:
        print('NA')
    else:
        print('YYMM')
elif s2 > 12: #YY
    if s1 > 12 or s1 == 0:
        print('NA')
    else:
        print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()

s1 = int(S[0] + S[1])
s2 = int(S[2] + S[3])

if s1 > 12: #YY
    if s2 > 12 or s2 == 0:
        print('NA')
    else:
        print('YYMM')
elif s2 > 12: #YY
    if s1 > 12:
        print('NA')
    else:
        print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
be = s[0:2]
af = s[2:4]
if int(be) <= 12 and int(af) <= 12:
  print('AMBIGUOUS')
elif (int(be) > 12 and af == '00') or (be == '00' and int(af) > 12):
  print('NA')
else:
  if int(be) > 12:
    print('MMYY')
  elif int(af) > 12:
    print('YYMM')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
if 0< int(S[0:2]) < 13: #月の可能性
    if 0< int(S[0:2]) < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
    
elif 0< int(S[2:5]) < 13: #月の可能性
    print("YYMM")
    
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
n = input()
a = int(n[:2])
b = int(n[2:])
x = 0 < a <= 12
y = 0 < b <= 12
print(a,b)
if x and y :
    print('AMBIGUOUS')
elif not x and y:
    print('YYMM')
elif x and not y:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
s1 = int(S[:2])
s2 = int(S[2:])

if 1 <= s1 <= 12 and 1 <= s2 <= 12:
  print('AMBIGUOUS')
elif 1 <= s1 <= 12:
  print('MMYY')
elif 1 <= s2 <= 12:
  print('YMMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
a = input()
frm = int(a[:2])
lat = int(a[2:])


if frm > 12 and lat > 12:
    print('NA')
elif frm <= 12 and lat > 12:
    if 0<frm:
        print('MMYY')
    else:
        print('NA')    
elif frm > 12 and  lat <= 12:
    if lat > 0:
        print('YYMM')
    else:
        print('NA')
elif frm <= 12 and lat==0:
    print('MMYY')
elif frm == 0 and  lat <= 12:
    print('YYMM')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
a = input()
frm = int(a[:2])
lat = int(a[2:])


if frm >= 12 and lat >= 12:
    print('NA')
elif frm <= 12 and lat > 12:
    if 0<frm:
        print('MMYY')
    else:
        print('NA')    
elif frm > 12 and  lat <= 12:
    if lat > 0:
        print('YYMM')
    else:
        print('NA')
elif frm <= 12 and lat==0:
    print('MMYY')
elif frm == 0 and  lat <= 12:
    print('YYMM')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
head = int(s[:2])
teil = int(s[2:])
if head>12 or head == 0:
  if teil>12 or teil == 0:
    print("NA")
  else:
    print("YYMM")
else:
  if teil>12:
    print("MMYY")
  else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
head = int(s[:2])
teil = int(s[2:])
if head>12:
  if teil>12:
    print("NA")
  else:
    print("YYMM")
else:
  if teil>12:
    print("MMYY")
  else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
a = input()
frm = int(a[:2])
lat = int(a[2:])


if frm >= 12 and lat >= 12:
    print('NA')
elif frm <= 12 and lat > 12:
    if 0<frm:
        print('MMYY')
    else:
        print('NA')
        
    
elif frm > 12 and  lat <= 12:
    if lat > 0:
        print('YYMM')
    else:
        print('NA')    
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:


s = input()


if int(s[:2]) <= 12 or int(s[2:]) <= 12:
    if int(s[:2]) <= 12 and 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')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S= input()

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

if f>0 and f<=12 and r>0 and r<=12:
  print('AMBIGUOUS')
elif (f>12 and r>0 and r<=12):
  print('YYMM')
elif (f>0 and f<=12 and r>12):
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
a, b = int(S[:2]), int(S[2:])
c1 = set(list(range(1, 12 + 1)))
c2 = set(list(range(1, 31 + 1)))
c3 = set(list(range(1, 30 + 1)))
c4 = set(list(range(1, 28 + 1)))

if a in c1:
    if b in c1:
        print('AMBIGUOUS')
        exit()
    if a in [4, 6, 9, 11]:
        if b in c3:
            print('MMYY')
            exit()
    if a == 2:
        if b in c4:
            print('MMYY')
            exit()
    if b in c2:
        print('MMYY')
        exit()
    print('NA')
    exit()

if b in c1:
    if a in c1:
        print('AMBIGUOUS')
        exit()
    if b in [4, 6, 9, 11]:
        if a in c3:
            print('YYMM')
            exit()
    if b == 2:
        if a in c4:
            print('YYMM')
            exit()
    if a in c2:
        print('YYMM')
        exit()
    print('NA')
    exit()

print('NA')

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    S = input()
    isMM = lambda s: int(s) > 0 and int(s) <= 12
    if   isMM(S[:2]) and int(S[2:]) > 12: print('MMYY')
    elif int(S[:2]) > 12 and isMM(S[2:]): print('YYMM')
    elif isMM(S[:2]) and isMM(S[2:]): print('AMBIGUOUS')
    else: print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    S = input()
    if S[:2] == '00' and int(S[2:]) > 12: print('NA')
    elif S[2:] == '00': print('NA')
    elif int(S[:2]) <= 12 and int(S[2:]) >  12: print('MMYY')
    elif int(S[:2]) >  12 and int(S[2:]) <= 12: print('YYMM')
    elif int(S[:2]) <= 12 and int(S[2:]) <= 12: print('AMBIGUOUS')
    else: print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    S = input()
    if S[:2] == '00' and int(S[2:]) > 12: print('NA')
    elif S[2:] == '00': print('NA')
    elif int(S[:2]) <= 12 and int(S[2:]) >  12: print('MMYY')
    elif int(S[:2]) >  12 and int(S[2:]) <= 12: print('YYMM')
    elif int(S[:2]) <= 12 and int(S[2:]) <= 12: print('AMBIGUOUS')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    S = input()
    if S[:2] == '00' or S[2:] == '00': print('NA')
    elif int(S[:2]) <= 12 and int(S[2:]) > 12: print('MMYY')
    elif int(S[:2]) > 12 and int(S[2:]) <= 12: print('YYMM')
    elif int(S[:2]) <= 12 and int(S[2:]) <= 12: print('AMBIGUOUS')
    else: print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    S = input()
    if S[:2] == '00' or S[2:] == '00': print('NA')
    elif int(S[:2]) <= 12 and int(S[2:]) > 12: print('MMYY')
    elif int(S[:2]) > 12 and int(S[2:]) <= 12: print('YYMM')
    else: print('AMBIGUOUS')

if __name__ == '__main__':
    main()