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:
inp = input()
fst = int(inp[0:2])
snd = int(inp[2:4])

if(fst!=0 and fst>0 and fst<=12 and snd!=0 and snd>0 and snd<=12):
    print("AMBIGUOUS")
else:
    if(fst!=0 and fst>0 and fst>=12 and snd>0 and snd!=0 and snd<=12):
        print("YYMM")
    elif(fst!=0 and fst>0 and snd>0 and fst<=12 and snd!=0 and snd>=12):
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
inp = input()
fst = int(inp[0:2])
snd = int(inp[2:4])

if(fst!=0 and fst<=12 and snd!=0 and snd<=12):
    print("AMBIGUOUS")
else:
    if(fst!=0 and fst>=12 and snd!=0 and snd<=12):
        print("YYMM")
    elif(fst!=0 and fst<=12 and snd!=0 and snd>=12):
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[0]+s[1])
s2=int(s[2]+s[3])
if (0<s1<13)and(0<s2<13):
    print("AMBIGUOUS")
elif (0<s1<13)and(s2!=0):
    print("MMYY")
elif (s1!=0)and(0<s2<13):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[0]+s[1])
s2=int(s[2]+s[3])
if (0<s1<13)&(0<s2<13):
    print("AMBIGUOUS")
elif (0<s1<13)&(12<s2<100):
    print("MMYY")
elif (12<s1<100)&(0<s2<13):
    print("YYMM")
elif (s1==0)|(s2==0):
    print("NA")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[0]+s[1])
s2=int(s[2]+s[3])
if (0<s1<13)&(0<s2<13):
    print("AMBIGUOUS")
elif (0<s1<13)&(12<s2<100):
    print("MMYY")
elif (12<s1<100)&(0<s2<13):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

s1 = int(s[0]+s[1])
s2 = int(s[2]+s[3])
print(s1, s2)
L=[]

for i in range(1, 13):
    L.append(i)


if s1 not in L and s2 not in L:
    print('NA')
elif s1 in L and s2 not in L:
    print('MMYY')
elif s1 not in L and s2 in L:
    print('YYMM')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
if int(s[:2]) and int(s[2:]) > 12:
  print("NA")
elif int(s[:2]) and int(s[2:]) == 0:
  print("NA")
elif int(s[:2]) > 12 and int(s[2:]) == 0:
  print("NA")
elif int(s[:2]) == 0 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()
a = int(s[0:2])
b = int(s[2:])

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = str(input())

flag = [0, 0] # [YYMM, MMYY]
l = 10*int(S[0]) + int(S[1])
r = 10*int(S[2]) + int(S[3])
if (1<=l and l<=99) and (1<=r and r<=12):
  flag[0] += 1
if (1<=l and l<=12) and (1<=r and r<=99):
  flag[1] += 1
if flag == [0, 0]:
  print('NA')
elif flag == [0, 1]:
  print('MMYY')
elif flag == [1, 0]:
  print('YYMM')
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
ans = 'NA'
if 1 <= int(s[:2]) <= 12:
    ans = 'MMYY'
    if 1 <= int(s[2:]) <= 12:
        ans = 'ANBIGUOUS'
elif 1 <= int(s[2:]) <= 12:
    ans = 'YYMM'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

if 0 < int(s[:2]) <= 12 and 0 < int(s[2:]) <= 12:
    print('AMBIGUOUS')
elif 0 < int(s[:2]) <= 12 and int(s[2:]) >= 12:
    print('MMYY')
elif int(s[:2]) >= 12 > 0 and 0 < int(s[2:]) <= 12:
    print('YYMM')
elif int(s[:2]) == 0 and 0 < 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 and int(s[2:]) >= 12:
    print('MMYY')
elif int(s[:2]) >= 12 and 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 and int(s[2:]) >= 12:
    print('MMYY')
elif int(s[:2]) >= 12 and int(s[2:]) <= 12:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
s=input()
f1=int(s[:2])<=12
f2=int(s[2:4])<=12
if f1 and f2:print("AMBIGUOUS")
elif not f1 and not f2:print("NA")
elif f1:print("MMYY")
else:print("YYMM")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())
s = [int(i+j) for (i,j) in zip(s[::2],s[1::2])]

if 1 <= s[0] <= 12:
  if 1 <= s[1] <= 12:
    print("AMIGUOUS")
  else:
    print("MMYY")
else:
  if 1 <= s[1] <= 12:
    print("YYMM")
  else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = list(input())
s = [int(i+j) for (i,j) in zip(s[::2],s[1::2])]

zero = int('{0:02d}'.format(0))

if zero < s[0] <= 12:
  if zero < s[1] <= 12:
    print("AMIGUOUS")
  else:
    print("MMYY")
else:
  if zero < s[1] <= 12:
    print("YYMM")
  else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = list(input())
s = [int(i+j) for (i,j) in zip(s[::2],s[1::2])]

zero = int('{0:02d}'.format(0))

if zero <= s[0] <= 12:
  if zero <= s[1] <= 12:
    print("AMIGUOUS")
  else:
    print("MMYY")
else:
  if zero <= s[1] <= 12:
    print("YYMM")
  else:
    print("NA")

Submission status: Wrong Answer

Solution code:
#ABC126 B

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

Submission status: Wrong Answer

Solution code:
#ABC126 B

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

if int(S[:2]) > 13:
  if int(S[2:]) > 13 or int(S[2:]) == 0: print('NA')
  else: print('YYMM')
else:
  if int(S[2:]) > 13: print('MMYY')
  else: print('AMBIGOUS')

Submission status: Wrong Answer

Solution code:
S = input()
num1 = int(S[:2])
num2 = int(S[2:])

if 1 <= num1 <= 12 and 1 <=  num2 <= 12:
    ans = "ABMIGUOUS"
elif 1 <= num1 <= 12 and (num2 == 0 or 12 < num2):
    ans = "MMYY"
elif (num1 == 0 or 12 < num1) and 1 <=  num2 <= 12:
    ans = "YYMM"
else:
    ans = "NA"
print(ans)

Submission status: Wrong Answer

Solution code:
S = int(input())

a = int(S/100 - (S%100)/100)
b = int(S%100)

if( 0<a<13 and 0<b<13 ):
  print("AMBIGUOUS")
if( 0<a<13 and 12<b<100 ):
  print("MMYY")
if( 12<a<100 and 0<b<13 ):
  print("YYMM")
if( 12<a<100 and 12<b<100 ):
  print("NA")
if( a==0 and 12<b<100 ):
  print("NA")
if( 12<a<100 and b==0 ):
  print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
l = s[:2]
r = s[2:]

if(int(l) <=12 and int(r) <= 12):
    print('AMBIGUOUS')
else :
    if(int(l) <= 12):
        print('MMYY')
    else:
        if(int(r) <= 12):
            print('YYMM')
        else:
            print('NA')

Submission status: Wrong Answer

Solution code:
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


s = S()
f = int(s[:2])
l = int(s[2:])

if 1 <= f <= 12 and 1 <= l <= 12:
    print('AMBIGUOUS')

elif 1 <= l <= 12 and f > 12:
    print('YYMM')

elif 1 <= f <= 12 and l > 12:
    print('MMYY')

else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = list(input())
a = S[0] + S[1]
b = S[2] + S[3]
A = int(a)
B = int(b)

if (0 < A < 13 and 0 < B < 13):
  print("AMBIGUOUS")
elif (0 < A < 13 and 12 < B < 100):
  print("MMYY")
elif (0 < B < 13 and 12 < A < 100):
  print("YYMM")
elif (A == 0 or B == 0):
  print("NA")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
a = S[0] + S[1]
b = S[2] + S[3]
A = int(a)
B = int(b)

if (0 < A < 13 and 0 < B < 13):
  print("AMBIGUOUS")
elif (0 < A < 13 and 12 < B <= 99):
  print("MMYY")
elif (0 < B < 13 and 12 < A <= 99):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
a = S[0] + S[1]
b = S[2] + S[3]
A = int(a)
B = int(b)

if (0 <= A < 13 and 0 <= B < 13):
  print("AMBIGUOUS")
elif (0 <= A < 13 and 12 < B < 100):
  print("MMYY")
elif (0 <= B < 13 and 12 < A < 100):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())
a = S[0] + S[1]
b = S[2] + S[3]
A = int(a)
B = int(b)

if (0 < A < 13 and 0 < B < 13):
  print("AMBIGUOUS")
elif (0 < A < 13 and 12 < B < 100):
  print("MMYY")
elif (0 < B < 13 and 12 < A < 100):
  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 (0 < A < 13 and 0 < B < 13):
  print("AMBIGUOUS")
elif (0 < A < 13 and 12 < B < 100):
  print("MMYY")
elif (0 < B < 13 and 12 < A < 100):
  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 (1 <= A <= 12 and 1 <= B <= 12):
  print("AMBIGUOUS")
elif (1 <= A <= 12 and 13 <= B <= 99):
  print("MMYY")
elif (1 <= B <= 12 and 13 <= A <= 99):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())

A = int(S[0]) + int(S[1])
B = int(S[2]) + int(S[3])

if (1 <= A <= 12 and 1 <= B <= 12):
  print("AMBIGUOUS")
elif (1 <= A <= 12 and 13 <= B <= 99):
  print("MMYY")
elif (1 <= B <= 12 and 13 <= A <= 99):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())

ans = []

A = int(S[0] + S[1])
B = int(S[2] + S[3])

if (1 <= A <= 12 and 1 <= B <= 12):
  print("AMBIGUOUS")
elif (1 <= A <= 12 and 13 <= B <= 99):
  print("MMYY")
elif (1 <= B <= 12 and 13 <= A <= 99):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
yymm = input()

if 1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12 and 1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12:
    print('AMBIGUOUS')
elif (1 <= int(yymm[0:2]) and int(yymm[0:2])) <= 12 and int(yymm[2:4]) <= 99:
    print('YYMM')
elif int(yymm[0:2]) <= 99 and 1 <= (int(yymm[2:4]) and int(yymm[2:4]) <= 12):
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
yymm = input()

if 1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12 or 1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12:
    print('AMBIGUOUS')
elif (1 <= int(yymm[0:2]) and int(yymm[0:2])) <= 12 and int(yymm[2:4]) <= 99:
    print('YYMM')
elif int(yymm[0:2]) <= 99 and 1 <= (int(yymm[2:4]) and int(yymm[2:4]) <= 12):
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

month = ["{:02}".format(x) for x in range(1,13)]
years = ["{:02}".format(x) for x in range(0,99)]

ans = 'NA'

S_0 = S[:2]
S_1 = S[2:]

ans_flg = [False, False, False, False]

if S_0 in month:
    ans_flg[0] = True
if S_0 in years:
    ans_flg[1] = True
if S_1 in month:
    ans_flg[2] = True
if S_1 in years:
    ans_flg[3] = True

if sum(ans_flg[:2]) == 0 or sum(ans_flg[2:]) == 0:
    ans = 'NA'
elif sum(ans_flg) == 4:
    ans = 'AMBIGUOUS'
elif ans_flg[0] == 1:
    ans = 'MMYY'
else:
    ans = 'YYMM'
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

month = ["{:02}".format(x) for x in range(1,13)]
years = ["{:02}".format(x) for x in range(0,99)]

ans = 'NA'

S_0 = S[:2]
S_1 = S[2:]

ans_flg = [False, False, False, False]

if S_0 in month:
    ans_flg[0] = True
if S_0 in years:
    ans_flg[1] = True
if S_1 in month:
    ans_flg[2] = True
if S_1 in years:
    ans_flg[3] = True

print(S)
print(ans_flg)
if sum(ans_flg[:2]) == 0 or sum(ans_flg[2:]) == 0:
    ans = 'NA'
elif sum(ans_flg) == 4:
    ans = 'AMBIGUOUS'
elif ans_flg[0] == 1:
    ans = 'MMYY'
else:
    ans = 'YYMM'
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

month = ["{:02}".format(x) for x in range(1,13)]
years = ["{:02}".format(x) for x in range(0,99)]

ans = 'NA'

S_0 = S[:2]
S_1 = S[2:]

ans_flg = [False, False, False, False]

if S_0 in month:
    ans_flg[0] = True
if S_0 in years:
    ans_flg[1] = True
if S_1 in month:
    ans_flg[2] = True
if S_1 in years:
    ans_flg[3] = True

if sum(ans_flg[:2]) == 0 or sum(ans_flg[2:]) == 0:
    ans = 'NA'
elif sum(ans_flg[:2]) == 2 or sum(ans_flg[2:]) == 2:
    ans = 'AMBIGUOUS'
elif ans_flg[0] == 1:
    ans = 'MMYY'
else:
    ans = 'YYMM'
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
yy = ["%02d" % i for i in range(100)]
mm = ["%02d" % i for i in range(1, 13)]
print(mm)
yymm = s[:2] in yy and s[2:] in mm
mmyy = s[:2] in mm and s[2:] in yy
print(["NA","MMYY","YYMM","AMBIGUOUS"][yymm*2+mmyy])

Submission status: Wrong Answer

Solution code:
s = input()

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

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

bf = yorm(b)
af = yorm(a)
   
ans = bf+af
if len(ans) != 4:
    ans = 'NA'
if ans == 'MMMM':
    ans = 'AMBIGUOUS'
if ans == 'YYYY':
    ans = 'NA'
print(ans)

Submission status: Wrong Answer

Solution code:

# ABC126
# B YYMM or MMYY
S = list(input())
x = int("".join(S[0:2]))
y = int("".join(S[2:4]))
if x > 12:
    if y > 12:
        print('NA')
    else:
        if y == 0:
            print('NA')
        else:
            print('YYMM')
else:
    if y > 12:
        if x == 0:
            print('NA')
        else:
            print('MMYY')
    else:
        if x + y == 0:
            print('NA')
        else:
            print('AMBIGUOUS')
pass

Submission status: Wrong Answer

Solution code:
S = list(input())
x = int("".join(S[0:2]))
y = int("".join(S[2:4]))
if x == 0 or y == 0:
    print('NA')
    exit()

if x > 12:
    if y > 12:
        print('NA')
    else:
        print('YYMM')
else:
    if y > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')
pass

Submission status: Wrong Answer

Solution code:
a=input()
b=int(a[0]+a[1])
c=int(a[2]+a[3])
if b>12 or b==0:
  if c>12 or c==0:
    print("Na")
  else:
    print("YYMM")
elif c>12 or c==0:
  if b>12 or b==0:
    print("Na")
  else:
    print("MMYY")
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
a=input()
b=int(a[0]+a[1])
c=int(a[2]+a[3])
if b>12 or b==0:
  if c>12 or c==0:
    print("Na")
  elif 1<=c<=12:
    print("YYMM")
elif c>12 or c==0:
  if b>12 or b==0:
    print("Na")
  elif 1<=b<=12:
    print("MMYY")
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
a=input()
b=int(a[0]+a[1])
c=int(a[2]+a[3])
if b>12 or b==0:
  if c>12 or c==0:
    print("Na")
  elif 1<=c<=12:
    print("YYMM")
if c>12 or c==0:
  if b>12 or b==0:
    print("Na")
  elif 1<=b<=12:
    print("MMYY")
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

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

if F == 0 and B == 0:
    print('NA')
elif (F == 0 and B > 12) or (B == 0 and F > 12):
    print('NA')
elif F <= 12 and B <= 12:
    print('AMBIGUOUS')
elif F > 12 and B <= 12:
    print('YYMM')
elif F <= 12 and B > 12:
    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 B > 12:
    print('NA')
elif F == 0 and B > 12:
    print('NA')
elif B == 0 and F > 12:
    print('NA')
elif F <= 12 and B <= 12:
    print('AMBIGUOUS')
elif B <= 12:
    print('YYMM')
else:
    print('MMYY')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
if s == '0000' or (int(s[:2]) >= 13 and int(s[-2:]) >= 13):
    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')

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    first, second = int(s[:2]), int(s[2:])
    if 1 <= first <= 12:
        if 1 <= second <= 12:
            print("AMBIGOUS")
        else:
            print("MMYY")
    elif 1 <= second <= 12:
        if 1 <= first <= 12:
            print("AMBIGOUS")
        else:
            print("YYMM")
    else:
        print("NA")


main()

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    first, second = int(s[:2]), int(s[2:])
    if first < 1 or second < 1 or (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("AMBIGUOS")

main()

Submission status: Wrong Answer

Solution code:
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>12:
    print('MMYY')
elif a>12 and 1<=b<=12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()

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

Submission status: Wrong Answer

Solution code:
import sys

S = input()

if int(S[:2]) == 0 and 0 < int(S[2:]) <= 12:
  print("YYMM")
  sys.exit()

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = str(input())
year = int(S[0] + S[1])
month = int(S[2] + S[3])
if year <= 12 and year >= 1 and month >= 1 and month <= 12:
    print('AMBIGUOUS')
elif year >= 1 and year <= 99 and month >= 1 and month <= 12:
    print('YYMM')
elif year >= 1 and year <= 12 and month >= 1 and month <= 99:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())
year = int(S[0] + S[1])
month = int(S[2] + S[3])
if year <= 12 and year >= 1 and month >= 1 and month <= 12:
    print('AMBIGUOUS')
elif year >= 1 and year <= 99 and month >= 1 and month <= 12:
    print('YYMM')
elif year >= 12 and year <= 12 and month >= 1 and month <= 99:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())
year = int(S[0] + S[1])
month = int(S[2] + S[3])
if year <= 12 and year >= 1 and month >= 1 and month <= 12:
    print('AMBIGOUS')
elif year >= 1 and year <= 99 and month >= 1 and month <= 12:
    print('YYMM')
elif year >= 12 and year <= 12 and month >= 1 and month <= 99:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())
year = S[0] + S[1]
month = S[2] + S[3]
if int(year) <= 12 and int(month) <= 12 and int(year) != 0 and int(month) != 0:
    print('AMBIGUOUS')
elif int(month) > 12 and int(month) != 0 and int(year) == 0:
    print('MMYY')
elif int(year) > 12 and int(year) != 0 and int(month) != 0:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())
year = S[0] + S[1]
month = S[2] + S[3]
if int(year) <= 12 and int(month) <= 12:
    print('AMBIGUOUS')
elif int(year) > 0 and int(month) != 0:
    print('YYMM')
elif int(month) > 0 and int(year) != 0:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())
year = S[0] + S[1]
month = S[2] + S[3]
if int(year) > 12 and int(month) != 0:
    print('YYMM')
elif int(month) > 12 and int(month) != 0:
    print('MMYY')
elif int(year) <= 12 and int(month) <= 12:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())
year = S[0] + S[1]
month = S[2] + S[3]
if (int(year) > 12 and int(month) >12) or (int(year) == 0) or (int(month) == 0):
    print('NA')
elif int(year) > 12:
    print('YYMM')
elif int(month) >12:
    print('MMYY')
elif int(year) <= 12 and int(month) <= 12:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = str(input())
year = S[0] + S[1]
month = S[2] + S[3]
if (int(year) > 12 and int(month) >12) or (int(year) == 0) or (int(month) == 0):
    print('NA')
elif int(year) > 12:
    print('MMYY')
elif int(month) >12:
    print('YYMM')
elif int(year) <= 12 and int(month) <= 12:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
up = int(S[0:2])
down = int(S[2:4])

if(up >= 13 and 1 <= down <= 12):
    print("YYMM")
if(1 <= up <= 12 and down >= 13):
    print("MMYY")
if(1 <= up <= 12 and 1 <= down <= 12):
    print("AMBIGUOUS")
if((up >= 13 and down >= 13) or (up == 0 or down == 0)):
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
up = int(S[0:2])
down = int(S[2:4])

if(up >= 13 and 0 < down < 13):
    print("YYMM")
if(0 < up < 13 and down >= 13):
    print("MMYY")
if(0 < up < 13 and 0 < down < 13):
    print("AMBIGUOUS")
if((up >= 13 and down >= 13) or (up == 0 or down == 0)):
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
up = int(S[0:2])
down = int(S[2:4])

if(up >= 13 and 0 < down < 13):
    print("YYMM")
if(0 < up < 13 and down >= 13):
    print("MMYY")
if(0 < up < 13 and 0 < down < 13):
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()

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

Submission status: Wrong Answer

Solution code:
s=input()

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

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


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

Submission status: Wrong Answer

Solution code:
s=input()

def month(n):
    if n <= 12:
        return True
    else:
        return False
if s == "0000":
    print("NA")
    exit()

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

Submission status: Wrong Answer

Solution code:
s=input()

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

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

Submission status: Wrong Answer

Solution code:
s=input()
if s[0] == '0':
    if s[-2] == '0':
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif s[-2] == '0':
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:

s = input()
a=int(s[0:2])
b=int(s[2:4])
if 0<b<=12:
    print('YYMM')
elif 0<a<=12 :
    print('MMYY')
elif 0<a<=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 0<b<=12:
    print('YYMM')
elif 0<a<=12 and b>12:
    print('MMYY')
elif 0<a<=12 and 0<b<=12:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
n = list(map(str,input().split()))
if int(n[0][0:2]) in range(13,100) and int(n[0][3]) in range(1,13):
  print('YYMM')
elif int(n[0][1]) in range(1,13) and int(n[0][2:]) in range(13,100):
  print('MMYY')
elif int(n[0][0:2]) in range(1,13) and int(n[0][2:]) in range(1,13):
  print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

s=int(input())
a=s//100
b=s%100
if (a==0 or a>12) and (b==0 or b>12):
    print("Na")
elif (a==0 or a>12):
    print("YYMM")
elif (b==0 or b>12):
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

s=int(input())
a=s//100
b=s%100
if a>12 and b>12:
    print("Na")
elif a>12:
    print("YYMM")
elif b>12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s=list(input())
s=list(map(int,s))

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

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

Submission status: Wrong Answer

Solution code:
s=list(input())
s=list(map(int,s))

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

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