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 = list(map(int, input()))
L = 10 * S[0] + S[1]
R = 10 * S[2] + S[3]
if L == 0 or R == 0:
    print('NA')
elif L <= 12:
    if R <= 12:
        print('AMBIGUOUS')
    else:
        print("MMYY")
elif L > 12:
    if R <= 12:
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[:2])
s2=int(s[2:])
print(s1,s2)
if 0<s1<13 and 0<s2<13:
  print("AMBIGUOUS")
elif (12<s1 or s1==0) and 0<s2<13:
  print("YYMM")
elif (12<s2 or s2==0) and 0<s1<13:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[:2])
s2=int(s[2:])
if 0<s1<13 and 0<s2<13:
  print("AMBIGUOUS")
if (12<s1 or s1==0) and 0<s2<13:
  print("YYMM")
if (12<s2 or s2==0) and 0<s1<13:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = input()
a, b = int(S[:2]), int(S[2:])
if (1 <= a <= 12):
    if (1 <= b <= 12):
        print('AMBIGUIOUS')
    else:
        print('MMYY')
else:
    if (1 <= b <= 12):
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
a=""
b=""
a=a+s[0]+s[1]
b=b+s[2]+s[3]
acount=0
bcount=0
if a=="00" and int(b)>=13:
  print("NA")
  acount=100
  bcount=100
if b=="00" and int(a)>=13:
  print("NA")
  acount=100
  bcount=100
if b=="00" and a=="00":
  print("NA")
  acount=100
  bcount=100
if int(b)>=13 and int(a)>=13:
  print("NA")
  acount=100
  bcount=100
  
if int(a)>=13:
  acount+=1
if int(b)>=13:
  bcount+=1
if acount+bcount==0:
  print("AMBIGUOUS")
elif acount+bcount== 1:
  if acount==0:
     print("MMYY")
  elif acount==1:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s=input()
a=""
b=""
a=a+s[0]+s[1]
b=b+s[2]+s[3]
acount=0
bcount=0
if a=="00" and int(b)>=13:
  print("NA")
  acount=100
  bcount=100
if b=="00" and int(a)>=13:
  print("NA")
  acount=100
  bcount=100

if int(a)>=13:
  acount+=1
if int(b)>=13:
  bcount+=1
if acount+bcount==0:
  print("AMBIGUOUS")
elif acount+bcount== 1:
  if acount==0:
     print("MMYY")
  elif acount==1:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s=input()
a=""
b=""
a=a+s[0]+s[1]
b=b+s[2]+s[3]
acount=0
bcount=0
if a=="00" or b=="00":
  print("NA")
  acount=100
  bcount=100

if int(a)>=13:
  acount+=1
if int(b)>=13:
  bcount+=1
if acount+bcount==0:
  print("AMBIGUOUS")
elif acount+bcount== 1:
  if acount==0:
     print("MMYY")
  elif acount==1:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[:2])
s2=int(s[2:4])
if s1>12 :
  if s2>0 :
    if s2<=12 :
      print("YYMM")
    else :
      print("NA")
  else :
    print("NA")
elif s1>0:
  if s2>0 :
    if s2<=12 :
      print("AMBIGUOU")
    else :
      print("MMYY")
  else :
    print("MMYY")
else :
  if s2>0 :
    if s2<=12 :
      print("YYMM")
    else :
      print("NA")
  else :
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

S_01 = int(S[0] + S[1])
S_23 = int(S[2] + S[3])

yymm_flag = True
mmyy_flag = True

if S_01 == 0 or S_23 == 0:
    yymm_flag = False
    mmyy_flag = False
    
if S_01 >= 13:
    mmyy_flag = False

if S_23 >= 13:
    yymm_flag = False

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

Submission status: Wrong Answer

Solution code:
S = input()

S_01 = int(S[0] + S[1])
S_23 = int(S[2] + S[3])

yymm_flag = True
mmyy_flag = True

if S_01 == 0 or S_23 == 0:
    yymm_flag = False
    mmyy_flag = False
    
if S_01 >= 13:
    mmyy_flag = False

if S_23 >= 13:
    yymm_flag = False

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

Submission status: Wrong Answer

Solution code:
import sys
s = input()

front = int(s[0:2])
back = int(s[2:4])

# NAの場合
if int(front) == 0 or int(back) == 0:
    print("NA")
    sys.exit()

# ambiguousの場合
if front <= 12 and back <= 12:
    print("AMBIGUOUS")
    sys.exit()

if front <=12 and back >12:
    print("MMYY")
elif front > 12 and back <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import sys
s = input()

front = int(s[0:2])
back = int(s[2:4])

# NAの場合
if int(front) == 0 or int(back) == 0:
    print("NA")
    sys.exit()

# ambiguousの場合
if front <= 12 and back <= 12:
    print("AMBIGUOUS")
    sys.exit()

if front <=12:
    print("MMYY")
elif front > 12 and back <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import sys
s = input()

front = int(s[0:2])
back = int(s[2:4])

# NAの場合
if int(front) == 0 or int(back) == 0 or (front >= 12 and back >= 12):
    print("NA")
    sys.exit()

# ambiguousの場合
if front <= 12 and back <= 12:
    print("AMBIGUOUS")
    sys.exit()

if front <=12:
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
import sys
s = input()

front = int(s[0:2])
back = int(s[2:4])

# NAの場合
if int(front) == 0 or int(back) == 0:
    print("NA")
    sys.exit()

# ambiguousの場合
if front <= 12 and back <= 12:
    print("AMBIGUOUS")
    sys.exit()

if front <=12:
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
#print(S[0:2])
#print(S[2:4])
#print(int(S[0:2]))

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

Submission status: Wrong Answer

Solution code:
S = input()
#print(S[0:2])
#print(S[2:4])
#print(int(S[0:2]))

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

Submission status: Wrong Answer

Solution code:
S = input()
if int(S[:2]) > 12:
    if 13 > int(S[2:]) > 0:
        print("YYMM")
    else:
        print("NA")
elif 0 < int(S[:2]) < 13:#12xx~01xx
    if int(S[2:]) > 12:
        print("MMYY")
    elif 0 < int(S[2:]) < 13:
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:#00xx
    if 0 < int(S[2:]) <13:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
l=s[0]+s[2]
m=s[1]+s[3]
month=['01','02','03','04','05','06','07','08','09','10','11','12']
if month.count(l)==1 and month.count(m)==1:
    print('AMBIGOUS')
elif month.count(l)==1 and month.count(m)==0:
    print('MMYY')
elif month.count(m)==1 and month.count(l)==0:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
l=s[0]+s[1]
m=s[2]+s[3]
month=['01','02','03','04','05','06','07','08','09','10','11','12']
if month.count(l)==1 and month.count(m)==1:
    print('AMBIGOUS')
elif month.count(l)==1 and month.count(m)==0:
    print('MMYY')
elif month.count(m)==1 and month.count(l)==0:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
l=s[0]+s[1]
m=s[2]+s[3]
month=['01','02','03','04','05','06','07','08','09','10','11','12']
if month.count(l)==1 and month.count(m)==1:
    print('AMBIGOUS')
elif month.count(l)==1 and month.count(m)==0:
    print('MMYY')
elif month.count(m)==1 and month.count(m)==0:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

mae = s[:2]
ato = s[2:]

def syoukyo(i):
    if i[0] == 0:
        i = i[1]
    return int(i)

mae = syoukyo(mae)
ato = syoukyo(ato)

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

mae = s[:2]
ato = s[2:]

def syoukyo(i):
    if i[0] == 0:
        i = i[1]
    else:
        i = int(i)
    return int(i)

mae = syoukyo(mae)
ato = syoukyo(ato)

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

Submission status: Wrong Answer

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

mae = s[:2]
ato = s[2:]

def syoukyo(i):
    if i[0] == 0:
        i = i[1]
    else:
        i = int(i)
    return int(i)

mae = syoukyo(mae)
ato = syoukyo(ato)

if mae > 12 and ato > 12:
    print("NA")
elif mae > 12 and ato < 13:
    print("YYMM")
elif mae < 13 and ato > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
def main(f, e):
    if f==0 or e==0:
        print("NA")
        
    elif f <13:
        if e < 13:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if e < 13:
            print("YYMM")
        else:
            print("NA")

if __name__ == "__main__":
    S = input()

    a = int(S[:2])
    b = int(S[2:])
    main(a, b)

Submission status: Wrong Answer

Solution code:
def main(f, e):
    if f==0 or e==0:
        print("NA")
    elif f <13:
        if e < 13:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if e < 13:
            print("YYMM")
        else:
            print("NA")

if __name__ == "__main__":
    S = input()

    a = int(S[:2])
    b = int(S[2:])
    main(a, b)

Submission status: Wrong Answer

Solution code:
def main(f, e):
    if f==0 or e==0:
        print("NA")
        return 0
    if f <13:
        if e < 13:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if e < 13:
            print("YYMM")
        else:
            print("NA")

if __name__ == "__main__":
    S = input()

    a = int(S[:2])
    b = int(S[2:])
    main(a, b)

Submission status: Wrong Answer

Solution code:
def main(f, e):
    if f==0 or e==0:
        print("NA")
        return 0
    if f <13:
        if e < 13:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if e < 13:
            print("YYMM")
        else:
            print("NA")

if __name__ == "__main__":
    S = input()

    a = int(S[:2])
    b = int(S[2:])
    print(a, b)
    main(a, b)

Submission status: Wrong Answer

Solution code:
def main(f, e):
    if f==0 or e==0:
        print("NA")
        return 0
    if f <13 and f>0:
        if e < 13:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if e < 13:
            print("YYMM")


if __name__ == "__main__":
    S = input()

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

    main(a, b)

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[:2])
b = int(S[2:])

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

Submission status: Wrong Answer

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

if 1<=s1<=12:
    print("AMBIGUOUS" if 1<=s2<=12 else "MMYY")
else:
    print("YYMM" if 1<=s2<=12 else "NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[:2])
b = int(S[2:])

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
p = int(S[:2])
s = int(S[2:])

if p > 12 and s <= 12 and s > 0:
  print("YYMM")
elif p > 0 and p <= 12 and s > 12:
  print("MMYY")
elif p < 13 and s < 13 and p > 0 and s > 0:
  print("AMBIGUOUS")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=list(input())
a=int(''.join(s[:2]))
b=int(''.join(s[2:]))
if 0<a and a<=12 and 0<b and b<=12:
    print("AMBIGUOUS")
elif(a>12 and 0<b and b<=12):
    print("YYMM")
elif 0<a and a<=12 and b>12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
s1=s[0]+s[1]
s2=s[2]+s[3]
m=0
y=0
for si in [s1,s2]:
    if '01'<=si<='12':
        m+=1
        y+=1
    elif '13'<=si<='99':
        y+=1
if m==2 and y==2:
    print('AMBIGUOUS')
elif m==1 and y==2:
    print('YYMM')
elif m==2 and y==1:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
S1 = int(S[:2])
S2 = int(S[2:])
if S1 == 00 or S2 == 00 or (13<=S1 and 13<=S2):
    print("NA")
    exit()
if 1 <= S1 <=12 and 1<=S2<=12:
    print("AMBIGUOUS")
    exit()
if 1 <= S1 <=12:
    print("MMYY")
    exit()
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
n = input()
a = int(n[0]+n[1])
b = int(n[2]+n[3])
if 1 <= a <= 12 and 1 <= b <=12:
  print("AMBIGUOUS")
elif 13 <= a <= 99 and 1 <= b <= 12:
  print("YYMM")
elif 1 <= a <= 12 and 13 <= b <= 99:
  print("MMYY")
elif (a == 0 or b == 0): 
  print("NA")
elif (13 <= a <= 99 and 13 <= b <= 99):
  print("NA")

Submission status: Wrong Answer

Solution code:
n = input()
a = int(n[0]+n[1])
b = int(n[2]+n[3])
if 1 <= a <= 12 and 1 <= b <=12:
  print("AMBIGUOUS")
elif 13 <= a <= 99 and 1 <= b <= 12:
  print("YYMM")
elif 1 <= a <= 12 and 13 <= b <= 99:
  print("MMYY")
elif (a == 0 or b == 0) or (13 <= a <= 99 and 13 <= b <= 99):
  print("NA")

Submission status: Wrong Answer

Solution code:
n = input()
a = int(n[0]+n[1])
b = int(n[2]+n[3])
if 1 <= a <= 12 and 1 <= b <=12:
  print("AMBIGUOUS")
elif 13 <= a <= 99 and 1 <= b <= 12:
  print("YYMM")
elif 1 <= a <= 12 and 13 <= b <= 99:
  print("MMYY")
elif a == 0 or b == 0:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
u=int(s[0]+s[1])
d=int(s[2]+s[3])
if 0<u<=12 and 0<d<=12:
  print('AMBIGUOUS')
elif 0<u<=12 and d>12:
  print('MMYY')
elif u>12 and 0<d<=12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
u=int(s[0]+s[1])
d=int(s[2]+s[3])
if u<=12 and d<=12:
  print('AMBIGUOUS')
elif 0<u<=12 and d>12:
  print('MMYY')
elif u>12 and 0<d<=12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = str(input())
head =s[0]+s[1]
tail =s[2]+s[3]
if int(head)>12 and int(tail)>12 :
    print('NA')
elif head =='00' and tail == '00':
    print('NA')
elif head == '00'  and tail != '00':
    print('YYMM')
elif head != '00'  and tail == '00':
    print('MMYY')
elif int(head)<13 and int(tail) <13:
    print('AMBIGUOUS')
elif int(head) >12 and int(tail) <13:
    print('YYMM')
else:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
s = str(input())
head =s[0]+s[1]
tail =s[2]+s[3]
if int(head)>12 and int(tail)>12 :
    print('NA')
elif head == '00':
    print('NA')
elif tail == '00':
    print('NA')
elif int(head)<13 and int(tail) <13:
    print('AMBIGUOUS')
elif int(head) >12 and int(tail) <13:
    print('YYMM')
else:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
S = input()
#YYMMformat
YYMM_yy = int(S[0]) * 10 + int(S[1])
YYMM_mm = int(S[2]) * 10 + int(S[3])
YYMM = False
MMYY = False
AM = False
NA = False
if YYMM_yy > 12:
    YYMM = True
elif YYMM_mm > 12:
    MMYY = True
else:
    AM = True
if YYMM_yy == 0 and YYMM_mm > 12:
    NA = True
elif YYMM_mm == 0 and YYMM_yy > 12:
    NA = True
elif YYMM_mm == 0 and YYMM_yy == 0:
    NA = True
elif YYMM_mm > 12 and YYMM_yy > 12:
    NA = True
    
if NA:
    print('NA')
elif AM:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
S = input()
#YYMMformat
YYMM_yy = int(S[0]) * 10 + int(S[1])
YYMM_mm = int(S[2]) * 10 + int(S[3])
YYMM = False
MMYY = False
AM = False
NA = False
if YYMM_yy > 12:
    YYMM = True
elif YYMM_mm > 12:
    MMYY = True
else:
    AM = True
if YYMM_yy == 0 and YYMM_mm > 12:
    NA = True
elif YYMM_mm == 0 and YYMM_yy > 12:
    NA = True 
if NA:
    print('NA')
elif AM:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
S = input()
#YYMMformat
YYMM_yy = int(S[0]) * 10 + int(S[1])
YYMM_mm = int(S[2]) * 10 + int(S[3])
YYMM = False
MMYY = False
AM = False
NA = False
if YYMM_yy > 12:
    YYMM = True
elif YYMM_mm > 12:
    MMYY = True
else:
    AM = True
if YYMM_yy == 0 or YYMM_mm == 0:
    NA = True
if NA:
    print('NA')
elif AM:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')

Submission status: Wrong Answer

Solution code:
s = input()
s_header = int(s[0:2])
s_footer = int(s[2:4])




if s_header >=1 and s_header <=12 and s_footer >= 1 and s_footer <= 12 :
  print("AMBIGUOUS")
elif s_header >= 0 and s_footer >=1 and s_footer <=12:
  print("YYMM")
elif s_header >=1 and s_header <=12 and s_footer >= 1:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
s_header = int(s[0:2])
s_footer = int(s[2:4])




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

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0]+s[1]
b = s[2]+s[3]
if a <= '12' and a > '00' and b <= '12' and b > '00':
    print('AMBIGUOUS')
elif a != '00' and b <= '12' and b > '00':
    print('YYMM')
elif a <= '12' and b != '00' and a > '00':
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0]+s[1]
b = s[2]+s[3]
if a <= '12' and a > '0' and b <= '12' and b > '0':
    print('AMBIGUOUS')
elif a != '0' and b <= '12' and b > '0':
    print('YYMM')
elif a <= '12' and b != '0' and a > '0':
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0]+s[1]
b = s[2]+s[3]
if a != '0' and b <= '12' and b > '0':
    print('YYMM')
elif a <= '12' and b != '0' and a > '0':
    print('MMYY')
elif a <= '12' and a > '0' and b <= '12' and b > '0':
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0]+s[1]
b = s[2]+s[3]
if a > '12' and b <= '12' and b > '0':
    print('YYMM')
elif a <= '12' and b > '12' and a > '0':
    print('MMYY')
elif a <= '12' and a > '0' and b <= '12' and b > '0':
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = s[0]+s[1]
b = s[2]+s[3]
if (a > '12' and b > '12') or (a == '00' or b == '00'):
    print('NA')
elif a > '12' and b <= '12':
    print('YYMM')
elif a <= '12' and b > '12':
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
n = int(input())
x=n//100
y=n%100

if 0<x<13:
    if 0<y<13:
        print('AMBIGUOUS')
        exit()
    else:
        print('MMYY')
        exit()
if 0<y<13:
    if x>13 or x ==0:
        print('YYMM')
        exit()
else:
    print('NA')
    exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
x=n//100
y=n%100

if 0<x<13:
    if 0<y<13:
        print('AMBIGUOUS')
        exit()
    else:
        print('MMYY')
        exit()
if 0<y<13:
    if x>13 or x ==0:
        print('YYMM')
        exit()
    else:
            print('NA')
            exit()

Submission status: Wrong Answer

Solution code:
n = int(input())
x=n//100
y=n%100

if 0<x<13:
    if 0<y<13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
if x>13:
    if 0<y<13:
        print('YYMM')
    else:
            print('NA')

Submission status: Wrong Answer

Solution code:
n = int(input())
x=n//100
y=n%100

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

Submission status: Wrong Answer

Solution code:
S = input()
left = S[:2]
right = S[2:]

month = [str(m).zfill(2) for m in range(1, 13)]
year = [str(y).zfill(2) for y in range(1, 100)]

if (left in year and right in year) and (left in month and right in month):
    print("AMBIGUOUS")
elif left in month and right in year:
    print("MMYY")
elif left in year and right in month:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
a = s[:2]
b = s[2:]
if a == '00' and b == '00':
    print('NA')
elif a == '00' and b >= '13':
    print('NA')
elif a >= '13' and b == '00':
    print('NA')
elif a >= '13' and b >= '13':
    print('NA')
elif a < '13' and b >= '13':
    print('MMYY')
elif a >= '13' and b < '13':
    print('YYMM')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = list(input())
def month(i):
  if "1" <= i <='12':
    return True
  else:
    return False
a = month("".join(s[0:2]))
b = month("".join(s[2:4]))
if a and b:
  print('AMBIGUOUS')
elif not a and b:
  print('YYMM')
elif a and not b:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

else:
    if S[2]=='0' and S[3]!=0:
        print('YYMM')
    elif S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2'):
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

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

else:
    if S[2]=='0' and S[3]!=0:
        print('YYMM')
    elif S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2'):
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

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

else:
    if S[2]=='0' and S[3]!=0:
        print('YYMM')
    elif S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2'):
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

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

else:
    if S[2]=='0' and S[2]!=0:
        print('YYMM')
    elif S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2'):
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

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

else:
    if S[2]=='0':
        print('YYMM')
    elif S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2'):
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
if S[0]=='0':
    if S[2]=='0':
        print('AMBIGUOUS')
    elif S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2'):
        print('AMBIGIOUS')
    else:
        print('MMYY')
elif S[0]=='1' and(S[1]=='0' or S[1]=='1' or S[2]=='2'):
    if S[2]=='0':
        print('AMBIGUOUS')
    elif S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2'):
        print('AMBIGIOUS')
    else:
        print('MMYY')

else:
    if S[2]=='0':
        print('YYMM')
    elif S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2'):
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S=int(input())

A=int(S/100)
B=int(S%100)

if 1<=A and A<=12:
    if 1<=B and B<=12:
        print('AMBIGUOUS')
    elif B>=13:
        print('MMYY')
    elif B==0:
        print('NA')
elif A>=13:
    if 1<=B and B<=12:
        print('YYMM')
    elif B>=13:
        print('NA')
    elif B==0:
        print('NA')
elif A==0:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
left = s[:2]
right = s[2:]

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

Submission status: Wrong Answer

Solution code:
X=input()
YM=0
MY=0
F=int(X[0] + X[1])
B=int(X[2] + X[3])
if 0<F<=12 :
    MY += 1
else:
    pass

if 0<B<=12 :
    YM += 1
else:
    pass

print(YM,MY)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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