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:])

# 00<= YY <= 99
# 01<= MM <= 12

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

Submission status: Wrong Answer

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

# 00<= YY <= 99
# 01<= MM <= 12

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

Submission status: Wrong Answer

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

if a >12 and b>12 or a > 31 or b > 31 or a==0 or b == 0:
  print('NA')
elif 1<=a<=12 and 1<=b<=12:
  print('AMBIGUOUS')
elif a in (4,6,9,11) and 1<=b<=30 or a in (1,3,5,7,8,10,12) and 1<=b<31 or a==2 and 1<=b<=29:
  print('MMYY')
elif b in (4,6,9,11) and 1<=a<=30 or b in (1,3,5,7,8,10,12) and 1<=a<31 or b==2 and 1<=a<=29:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = list(input())

x12 = int(''.join(x[:2]))
x34 = int(''.join(x[2:]))

is_12YYMM = True
is_34YYMM = None
is_12MMYY = None
is_34MMYY = True

if (x12 > 12) or (x12 < 1):
  is_12MMYY = False
else:
  is_12MMYY = True

if (x34 > 12) or (x34 < 1):
  is_34YYMM = False
else:
  is_34YYMM = True

if (is_12YYMM and is_34YYMM) and (is_12MMYY and is_34YYMM):
  print('AMBIGUOUS')
elif (is_12YYMM and is_34YYMM):
  print('YYMM')
elif (is_12MMYY and is_34YYMM):
  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("AMBIGOUS")
elif int(S[:2]) >= 0 and 1 <= int(S[2:]) <= 12:
    print("YYMM")
elif int(S[2:]) >= 0 and 1 <= int(S[:2]) <= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[0])
b = int(S[1])
c = int(S[2])
d = int(S[3])

if a*10 + b == 0:
    if c*10 + d == 0:
        print("NA")
    elif c*10 + d <= 12:
        print("YYMM")
    else:
        print("NA")
elif a*10 + b <= 12:
    if c*10 + d <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if c*10 + d == 0:
        print("NA")
    elif c*10 + d <= 12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:

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

if s1 == 0 or s2 == 0:
    print("NA")
    exit()

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[0:2])
b=int(s[2:4])
if a<13 and b<13:print("AMBIGUOUS")
elif not(a<13 or b<13):print("NA")
elif b<13:print("YYMM")
else:print("MMYY")

Submission status: Wrong Answer

Solution code:
s=input()

s1=s[0]+s[1]
s2=s[2]+s[3]

if s1=='00' or s2=='00':
  print('NA')
  exit()

if s1[0]=='0' or s1=='11' or s1=='12':
  ans1='MM'
else:
  ans1='YY'

if s2[0]=='0' or s2=='11' or s2=='12':
  ans2='MM'
else:
  ans2='YY'

if ans1==ans2=='MM':
  print('AMBIGUOUS')
elif ans1==ans2=='YY':
  print('NA')
else:
  print(ans1+ans2)

Submission status: Wrong Answer

Solution code:
s=input()

s1=s[0]+s[1]
s2=s[2]+s[3]

if s1=='00' or s2=='00':
  print('NA')
  exit()

if s1[0]=='0' or s1=='11' or s1=='12':
  ans1='MM'
else:
  ans1='YY'

if s2[0]=='0' or s2=='11' or s2=='12':
  ans2='MM'
else:
  ans2='YY'

if ans1==ans2=='MM':
  print('AMBIGUOUS')
else:
  print(ans1+ans2)

Submission status: Wrong Answer

Solution code:
S = int(input())
if 0 < S//100 <= 12 and S - S//100*100 > 12:
    print("MMYY")
elif S//100 > 12 and 0 < S - S//100*100 <= 12:
    print("YYMM")
elif 0 < S//100 <= 12 and 0 < S - S//100*100 <= 12:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())

S = list(map(int, S))

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

Submission status: Wrong Answer

Solution code:
S = list(input())

S = list(map(int, S))

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

Submission status: Wrong Answer

Solution code:
S = list(input())

S = list(map(int, S))

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

Submission status: Wrong Answer

Solution code:
S = list(input())

S = list(map(int, S))

if S[0] > 1 or (S[0] == 1 and S[1] > 2):
    print("YYMM")
elif S[2] > 1 or (S[2] == 1 and S[3] > 2):
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()

first = int(s[0:2])
second = int(s[2:4])

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

Submission status: Wrong Answer

Solution code:
s = list(str(input()))

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

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

Submission status: Wrong Answer

Solution code:
s = input()
YYMM = False
MMYY = False

if 0 < int(s[:2]) < 100:
    if 0 < int(s[2:]) < 13:
        YYMM = True
if 0 < int(s[:2]) < 13:
    if 0 < int(s[2:]) < 100:
        MMYY = True
if YYMM == True and MMYY == True:
    print('AMBIGUOUS')
elif YYMM == True:
    print('YYMM')
elif MMYY == True:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()

l=[]
for i in range(len(s)):
    l.append(s[i])
l1=[]
l1.append(int(l[0]+l[1]))
l1.append(int(l[2]+l[3]))

if(l1[0] <= 0 or l1[1] <= 0) or (l1[0] > 12 and l1[0] > 12):
    print('NA')
elif l1[0] > 12 and l1[1] > 0 and  l1[1] <= 12:
    print('YYMM')
elif l1[0] > 0 and  l1[0] <= 12 and l1[1] > 12:
    print('MMYY')
elif (l1[0] > 0 and l1[0] <= 12) and (l1[1] > 0 and l1[1] <= 12):
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s=input()

l=[]
for i in range(len(s)):
    l.append(s[i])
l1=[]
l1.append(int(l[0]+l[1]))
l1.append(int(l[2]+l[3]))

if l1[0] <= 0 or l1[1] <= 0:
    print('NA')
elif l1[0] > 12 and l1[1] > 0 and  l1[1] <= 12:
    print('YYMM')
elif l1[0] > 0 and  l1[0] <= 12 and l1[1] > 12:
    print('MMYY')
elif (l1[0] > 0 and l1[0] <= 12) and (l1[1] > 0 and l1[1] <= 12):
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
#import sys
#import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
N=input()

a=int(N[0:2])
b=int(N[2:4])

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

Submission status: Wrong Answer

Solution code:
#import sys
#import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
N=input()

a=int(N[0:2])
b=int(N[2:4])

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

Submission status: Wrong Answer

Solution code:
#import sys
#import math
#import numpy as np
'''a,b= map(int,input().split())'''
#a, b, c = [list(map(int, input().split())) for _ in range(3)]
#li0= [int(x) for x in input().split()]
#n,l= map(int, input().split())
#x = [list(map(int, input().split())) for _ in range(n)] 
N=input()

a=int(N[0:2])
b=int(N[2:4])

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

Submission status: Wrong Answer

Solution code:
s = input()

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

a = int(a)
b = int(b)

if a == 0 or b == 0:
  print('NA')
  exit()

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

Submission status: Wrong Answer

Solution code:
s = input()

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

a = int(a)
b = int(b)

if a == 0 or b == 0:
  print('NA')
  exit()

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

Submission status: Wrong Answer

Solution code:
import math
import itertools
import statistics
#n = int(input())
s=input()
a = int(s[0])*10+int(s[1])
b = int(s[2])*10+int(s[3])
# yymm yy>12 and 12>=mm>=1
# mmyy 1<=mm<=12 and yy > 12
# doble 1<=yy<=12 and  1<=mm<=12
# na mm=0 and yy?12
if 0<a<13 and 0<b<13:
    print("AMBIGUOUS")
elif a > 12 and 0<b<13:
    print("YYMM")
elif 0<a<13 and b > 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 and S1<=99) and (1<=S2 and S2<=12)):
    if (0<=S1 and S1<=12) and (1<=S2 and S2<=99):
        print("AMBIGUOUS")
    else:
        print("YYMM")
elif (1<=S1 and S1<=12) and (0<=S2 and S2<=99):
    print("MMYY")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S=input()

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

Submission status: Wrong Answer

Solution code:
S = input()
f, r = int(S[:2]), int(S[2:])
#print(f)
#print(r)
if f == 0 or r == 0 or (f > 12 and r > 12):
  ans = "NA"
elif f > 12 and r <= 12:
  ans = "YYMM"
elif f <= 12 and r > 12:
  ans = "MMYY"
elif r <= 12 and f <= 12:
  ans = "AMBIGUOUS"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
f, r = S[:2], S[2:]
if f == "00" or r == "00" or (int(f)>12 and int(r)>12):
  ans = "NA"
elif int(f) > 12 and int(r) <= 12:
  ans = "YYMM"
elif int(r) > 12 and int(f) <= 12:
  ans = "MMYY"
else:
  ans = "AMBIGUOUS"
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
f, r = S[:2], S[2:]
if f == "00" or r == "00":
  ans = "NA"
elif int(f) > 12 and int(r) <= 12:
  ans = "YYMM"
elif int(r) > 12 and int(f) <= 12:
  ans = "MMYY"
else:
  ans = "AMBIGUOUS"
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

if 1 <= int(S[2] + S[3]) <= 12 and 1 <= int(S[0] + S[1]) <= 12:
  print('AMBIGUOUS')
elif 1 <= int(S[2] + S[3]) <= 12 and not (1 <= int(S[0] + S[1]) <= 12):
  print('YYMM')
elif 1 <= int(S[0] + S[1]) <= 12 and not (1 <= int(S[2] + S[3]) <= 12):
  print('MMYY')
else:
  print('NN')

Submission status: Wrong Answer

Solution code:
s = input()
ans = "NA"
c = 0
#YYMM
if 0<=int(s[:2])<=99 and 1<=int(s[2:])<=12:
  ans = "YYMM"
  c += 1
#MMYY
elif 1<=int(s[:2])<=12 and 0<=int(s[2:])<=99:
  ans = "MMYY"
if c == 2:
  ans = "AMBIGUOUS"
print(ans)

Submission status: Wrong Answer

Solution code:
a=input()
a_i=int(a[0:2])
b_i=int(a[2:4])
if a_i<=12 and b_i<=12:
    print('AMBIGUOUS')
elif 0<b_i<=12:
    print("YYMM")
elif 0<a_i<=12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())

fo = int(''.join(S[:2]))
la = int(''.join(S[2:]))

if fo==0 or la==0:
  print("NA")
elif fo <= 12 and la <= 12:
  print("AMBIGUOUS")
elif fo <= 12 and la > 12:
  print("MMYY")
elif fo > 12 and la <= 12:
  print("YYMM")
elif fo > 12 and la > 12:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())

fo = int(''.join(S[:2]))
la = int(''.join(S[2:]))

if fo==0 or la==0:
  print("NA")
elif fo <= 12 and la <= 12:
  print("AMBIGUOUS")
elif fo <= 12 and la > 12:
  print("MMYY")
elif fo > 12 and la <= 12:
  print("YYMM")
elif fo > 12 and la > 13:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())

fo = int(''.join(S[:2]))
la = int(''.join(S[2:]))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
fs=int(s[:2])
ls=int(s[2:])
if 1<=fs<=12 and ls>=13:
    print('MMYY')
elif 1<=fs<=12 and 1<=ls<=12:
    print('AMBIGUOUS')
elif fs>=13 and 1<=ls<=12:
    print('YYMM')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n=int(input())
n_1=n//100
n_2=n%100

if  1<=n_1<=12 :
            print('MMYY')
elif 1<=n_1<=12 and 1<=n_2<=12:
            print('AMBIGUOUS')
elif 1<=n_2<=12:
            print('YYMM')
else:
            print('NA')

Submission status: Wrong Answer

Solution code:

n=int(input())
n_1=n//100
n_2=n%100

if  1<=n_1<=12 and 13<=n_1<=31:
            print('MMYY')
elif 1<=n_1<=12 and 1<=n_2<=12:
            print('AMBIGUOUS')
elif 13<=n_1<=31 and 1<=n_2<=12:
            print('YYMM')
else:
            print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
A=int(S[0:2])
B=int(S[2:4])
if 1<=A<=12:
    if 1<=B<=12:
        ans="AMBIGUOUS"
    elif 12<B:
        ans="MMYY"
    else:
        ans="NA"
elif 12<A:
    if 1<=B<=12:
        ans="YYMM"
    else:
        ans="NA"
else:
    ans="NA"
print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
A=int(S[0:2])
B=int(S[2:4])
if 1<=A<=12:
    if 1<=B<=12:
        ans="AMBIGUOUS"
    elif 12<=B:
        ans="MMYY"
    else:
        ans="NA"
elif 12<=A:
    if 1<=B<=12:
        ans="YYMM"
    else:
        ans="NA"
else:
    ans="NA"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution 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:
        if r <= 0:
            print("NA")
            exit()

        print("YYMM")
        exit()

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

        print("MMYY")
        exit()

    print("AMBIGUOUS")


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()

if int(s[:2]) >= 13 or s[:2] != '00' and int(s[2:4]) >= 13 or s[2:4] != '00':
    print('NA')
elif int(s[:2]) <= 12 and int(s[2:4]) <= 12:
    print('AMBIGUOUS')
elif int(s[:2]) <= 12:
    print('MMYY')
elif int(s[:2]) >= 13:
    print('YYMM')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()
l = s[:2]
r = s[2:]
yy = [str(i).zfill(2) for i in range(1, 100)]
mm = [str(i).zfill(2) for i in range(1, 13)]

if l in mm and r in mm:
    print("AMBIGUOUS")
elif l in yy and r in mm:
    print("YYMM")
elif l in mm and r in yy:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = [int(k) for k in list(input())]
s1 = 10*int(s[0])+int(s[1])
s2 = 10*int(s[2])+int(s[3])
if s2 == 0 and s1 > 12:
    print("NA")
elif s1 > 12 and s2 <= 12:
    print("YYMM")
elif s1 <= 12 and s2 > 12:
    print("MMYY")
else:
    if s1 > 12 and s2 > 12:
        print("NA")
    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = [int(k) for k in list(input())]
s1 = 10*int(s[0])+int(s[1])
s2 = 10*int(s[2])+int(s[3])
if s2 == 0 and s1 > 12:
    print("NA")
elif s1 > 12 and s2 <= 12:
    print("YYMM")
elif s1 <= 12 and s2 > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = [int(k) for k in list(input())]
s1 = 10*int(s[0])+int(s[1])
s2 = 10*int(s[2])+int(s[3])
if s2 == 0:
    print("NA")
elif s1 > 12 and s2 <= 12:
    print("YYMM")
elif s1 <= 12 and s2 > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = [int(k) for k in list(input())]
s1 = 10*int(s[0])+int(s[1])
s2 = 10*int(s[2])+int(s[3])
if s2 == 0:
    print("NA")
elif s1 <= 12 and s2 <= 12:
    print("AMBIGUOUS")
elif s1 <= 12 and s2 >= 12:
    print("MMYY") 
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = [int(k) for k in list(input())]
s1 = 10*int(s[0])+int(s[1])
s2 = 10*int(s[2])+int(s[3])
if s1 == 0 or s2 == 0:
    print("NA")
elif s1 <= 12 and s2 <= 12:
    print("AMBIGUOUS")
elif s1 <= 12 and s2 >= 12:
    print("MMYY") 
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s=list(str(input()))

s1=(int("".join(s[:2])))
s2=(int("".join(s[2:])))

if s1==00 or s1>12 and s2==00 or s2>12:
            print('NA')

elif s1==00 or  s1>12 and 1<=s2<=12:
            print('YYMM')
elif s2==00 or s2>12 and 1<=s1<=12 :
            print('MMYY')
else:
            print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
first_half = int(S[:2])
second_half = int(S[2:])
if 0 < first_half and first_half <= 12 and 0 < second_half and second_half <= 12:
    print("ambiguous")
elif 0 < first_half and first_half <= 12:
    print("MMYY")
elif 0 < second_half and second_half <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import re
a, b = re.split('(..)', input())[1::2]

if (a == "00") and (b == "00"):
    print("NA")
    exit(0)

if a == "00":
    if 12 < int(b):
        print("YYMM")
        exit(0)
    else:
        print("NA")
        exit(0)
elif b == "00":
    if 12 < int(b):
        print("MMYY")
        exit(0)
    else:
        print("NA")
        exit(0)

if 12 < int(a):
    if 12 < int(b):
        print("NA")
    else:
        print("YYMM")
else:
    if 12 < int(b):
        print("MMYY")
    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
import re

arg = input()

valid_year = r"0[1-9]|[1-9][0-9]"
valid_month = r"0[1-9]|1[0-2]"

s1_is_year = re.match(valid_year, arg[:2])
s1_is_month = re.match(valid_month, arg[:2])
s2_is_year = re.match(valid_year, arg[2:])
s2_is_month = re.match(valid_month, arg[2:])

is_yymm = s1_is_year and s2_is_month
is_mmyy = s1_is_month and s2_is_year

if is_yymm and is_mmyy:
    print("AMBIGUOUS")
elif is_yymm:
    print("YYMM")
elif is_mmyy:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
f=int(s[:2])
b=int(s[3:])
if f>13:
	if b<13:
		print("YYMM")
	else:
		print("NA")
else:
	if b<13:
		print("AMBIGUOUS")
	else:
		prinr("MMYY")

Submission status: Wrong Answer

Solution code:
num = input()
if int(num[:2]) > 12 or int(num[2:])==0:
    if int(num[2:]) > 12 or int(num[2:])== 0:
        print('NA')
    else:
        print('YYMM')
else:
    if int(num[2:]) > 12 or int(num[2:])== 0:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    S = input()

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    S = input()

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    S = input()

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

    if first < 10 and second < 10:
        print('NA')
    elif first == 0 or second == 0:
        print('NA')
    elif first > 12 and second <= 12:
        print('YYMM')
    elif first <= 12 and second > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    S = input()

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

    if first < 10 or second < 0:
        print('NA')
    elif first > 12 and second <= 12:
        print('YYMM')
    elif first <= 12 and second > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    S = input()

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

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    S = input()

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

    if first == 0 or second == 0:
        print('NA')
    elif first <= 12 and second <= 12:
        print('AMBIGUOUS')
    elif first > 12 and second <= 12:
        print('YYMM')
    elif first <= 12 and second > 12:
        print('MMYY')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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