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

yymm = False
mmyy = False

#MMYY
if 1 <= int(S[:2]) and int(S[:2]) <= 12:
    if 1 <= int(S[3:]):
        mmyy = True

#YYMM
if 1 <= int(S[3:]) and int(S[3:]) <= 12:
    if 1 <= int(S[:2]):
        yymm = True

if yymm:
    if mmyy:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif mmyy:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s  = input()
a = int(s[:2])
b = int(s[2:])
print(s[:2], a, s[2:], b)
is_MMxx = is_xxMM = False
if 13 > a > 0:
  is_MMxx = True
if 13 > b > 0:
  is_xxMM = True
if is_MMxx and is_xxMM:
  print("AMBIGUOUS")
elif is_MMxx:
  print("MMYY")
elif is_xxMM:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
import sys

s=input()

if (s[:2] == '00' or s[2:] == '00'):
    print('NA')
    sys.exit()

if s[0] == '0':
    if s[2] == '0':
        print('AMBIGUOUS')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
            print('AMBIGUOUS')
        else:
            print('MMYY')

elif s[0] == '1':
    if(s[:2] == '10' or s[:2] == '11' or s[:2] == '12'):
        if s[2] == '0':
            print('AMBIGUOUS')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('AMBIGUOUS')
            else:
                print('MMYY')
    else:
        if s[2] == '0':
            print('YYMM')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
        else:
            print('NA')


else:
    if s[2] == '0':
        print('YYMM')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
import numpy as np

suuji=int(input())

d=suuji%1000%100%10
c=int((suuji%1000%100-d)/10)
b=int((suuji%1000-10*c-d)/100)
a=int((suuji-100*b-10*c-d)/1000)
zenhan=10*a+b
kouhan=10*c+d

if (zenhan>=1 and zenhan <=12) and (kouhan==0 or kouhan>=13):
    print("MMYY")

if (kouhan>=1 and kouhan <=12) and (zenhan==0 or zenhan>=13):
    print("YYMM")
    
if (zenhan>=1 and zenhan <=12) and (kouhan>=1 and kouhan<=12):
    print("AMBIGUOUS")
    
if zenhan==0 or kouhan==0:
    print("NA")

if zenhan>=13 and kouhan>=13:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = int(input())

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

if a ==0 or b == 0:
    print("NA")
elif 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=int(input())
month=S%100
year=(S-S%100)//100
if (month!=0 and month<=12) and (year!=0 and year<=12):
  print("AMBIGUOUS") 
elif (month!=0 and month<=12) and year!=0: 
  print("YYMM") 
elif month!=0 and (year!=0 and year<=12):
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
# your code goes here\
s = input()
op = ''
first = s[0:2]
second = s[2:4]
if (0 < int(first) <= 12):
	op += 'MM'
else:
	op += 'YY'
if (0 < int(second) <= 12):
	op += 'MM'
else:
	op += 'YY'

if (len(s) != 4 or op == 'MMMM'):
	op = 'NA'
elif (op == 'MMMM'):
	op = 'AMBIGUOUS'
elif (op == 'YYYY'):
	if ((second == '00' and first == '00') or int(second) > 12 or int(first) > 12):
		op = 'NA'
print(op)

Submission status: Wrong Answer

Solution code:
s = list(input())
if s[0] == "0":
    s[0] = ''
if s[2] == "0":
    s[2] = ''
x = int(s[0]+s[1])
y = int(s[2]+s[3])



if (x <= 12 and x >= 1) and (y >=1 and y <=12):
    print("AMBIGOUS")

elif(x >0 and (y >= 1 and y <= 12)):
    print("YYMM")

elif(y >0 and (x >= 1 and x <= 12)):
    print("MMYY")

else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = int(input())
a = S // 100
b = S % 100

ans = ""

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

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
fast = int(S[0:2])
end = int(S[2:4])

if 0 < fast < 13 and 0 < end < 13 :
  print('AMBIGUOUS')
elif 12 < fast and 0 < end < 13:
  print('YYMM')
elif 0 < fast < 13 and 12 < end:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s=input()

tuki=['01','02','03','04','05','06','07','08','09','10','11','12']

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

flag=[1,2,3]

if a not in tuki:
    flag.remove(1)
    flag.remove(3)
if b not in tuki:
    flag.remove(2)
    if 3 in flag:
        flag.remove(3)

if flag==[]:
    print('NA')
elif flag[-1]==3:
    print('AMBIGOUS')
elif flag[-1]==2:
    print('YYMM')
elif flag[-1]==1:
    print('MMYY')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def main():
    S = sys.stdin.readline().rstrip()

    s1, s2 = int(S[:2]), int(S[2:])
    if s1 < 1 or s2 < 1:
        print("NA")
    elif s1 > 20 and s2 > 13:
        print("NA")
    elif s2 > 13 and s1 > 20:
        print("NA")
    elif s1 > 13 and s2 < 13:
        print("YYMM")
    elif s1 < 13 and s2 > 13:
        print("MMYY")
    else:
        print("AMBIGUOUS")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# your code goes here\
s = input()
op = ''
first = s[0:2]
second = s[2:4]
if (0 < int(first) <= 12):
	op += 'MM'
else:
	op += 'YY'
if (0 < int(second) <= 12):
	op += 'MM'
else:
	op += 'YY'

if (len(s) != 4 or op == 'MMMM'):
	op = 'NA'
elif (op == 'MMMM'):
	op = 'AMBIGUOUS'
elif (second == '00' or first == '00'):
	if ((second == '00' and first == '00') or int(second) > 12 or int(first) > 12):
		op = 'NA'
print(op)

Submission status: Wrong Answer

Solution code:
S = input()
A = int(S[0:2])
B = int(S[2:4])

print(A,B)

if A == 0 & B == 0:
    print('NA')
    
elif 1 <= A <= 12:
    if 1 <= B <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
        
elif 1 <= B <= 12:
    if 1 <= A <= 12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
        
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

s=input()

if (s[:2] == '00' or s[2:] == '00'):
    print('NA')
    sys.exit()

if s[0] == '0':
    if s[2] == '0':
        print('AMBIGUOUS')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
            print('AMBIGUOUS')
        else:
            print('MMYY')

elif s[0] == '1':
    if(s[:2] == '10' or s[:2] == '11' or s[:2] == '12'):
        if s[2] == '0':
            print('AMBIGUOUS')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('AMBIGUOUS')
            else:
                print('MMYY')
    else:
        if s[2] == '0':
            print('YYMM')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
        else:
            print('NA')


else:
    if s[2] == '0':
        print('YYMM')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S = list(input())
Ans = ["NA", "AMBIGUOUS", "YYMM", "MMYY"]
C1 = int(S[0] + S[1])
C2 = int(S[2] + S[3])

if (C1 == 0 or C2 == 0) or (C1 > 12 and C2 > 12):
    f = 0

elif C1 <= 12 and C2 <= 12:
    f = 1

elif C2 <= 12:
    f = 2

elif C1 <= 12:
    f = 3


print(Ans[f])

Submission status: Wrong Answer

Solution code:
def ability(a, b):
    e = 10*a + b

    if e == 0:
        return ['YY']
    elif 1 <= e <= 12:
        return ['YY', 'MM']
    else:
        return ['YY']


S = [int(x) for x in list(input())]

l_able = ability(*S[0:2])
r_able = ability(*S[2:4])

if ['YY', 'MM'] == l_able:
    if ['YY', 'MM'] == r_able:
        print('AMBIGUOS')
    elif 'YY' in r_able:
        print('MMYY')
    elif 'MM' in r_able:
        print('YYMM')
    else:
        print('NA')
elif 'YY' in l_able:
    if ['YY', 'MM'] == r_able:
        print('YYMM')
    elif 'MM' in r_able:
        print('YYMM')
    elif 'YY' in l_able:
        print('NA')
elif 'MM' in l_able:
    if ['YY', 'MM'] == r_able:
        print('MMYY')
    elif 'MM' in r_able:
        print('NA')
    elif 'YY' in l_able:
        print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

F_NA = 0
F_Y = 1
F_YM = 2

s = [0, 0]
s[0] = int(S[:2])
s[1] = int(S[2:])

flg = [0, 0]
for i in range(2):
    if s[i] >= 1 and s[i] <=12:
        flg[i] = F_YM
    elif s[i] >= 1:
        flg[i] = F_Y
    else:
        flg[i] = F_NA

if flg[0] == F_NA or flg[1] == F_NA:
    print("NA")
elif flg[0] == F_YM:
    if flg[1] == F_YM:
        print("AMBIGUOUS")
    elif flg[1] == F_Y:
        print("MMYY")
else: #flg[0] == F_Y
    if flg[1] == F_YM:
        print("YYMM")
    elif flg[1] == F_Y:
        print("NA")

Submission status: Wrong Answer

Solution code:
s = (input())

a = True
b = True
if s[0] is '0':   
    if s[1] is '0':
        a = False
elif s[0] is '1':
    if s[1] is '0'or s[1] is '1' or s[1] is '2':
        a = True
    else:
        a = False
else:
    a = False

if s[2] is '0':   
    if s[3] is '0':
        a = False
elif s[2] is '1':
    if s[3] is '0'or s[3] is '1' or s[3] is '2':
        a = True
    else:
        a = False
else:
    a = False

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

Submission status: Wrong Answer

Solution code:
s=input()
if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
  if 10*int(s[0])+int(s[1])<=12 and int(s[0])+int(s[1])!=0:
    print("AMBIGUOUS")
  else:
    print("YYMM")
if 10*int(s[0])+int(s[1])<=12 and int(s[0])+int(s[1])!=0:
  if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
s = input()
s_list=list(s)
s_len=len(s_list)
s_first=int(s_list[0]+s_list[1])
s_second=int(s_list[2]+s_list[3])
if s_first<13: #MMYY case
    if s_second<13:
        print('AMBIGOUS')
    else:
        print('MMYY')

else: #YYMM case
    if s_second==0:
        print('NA')
    else:
        print('YYMM')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

def main():
    s = input()
    start = int(s[0:2])
    end = int(s[2:4])
    if start == 0 and (end > 0 and end <= 12):
        print("YYMM")
        return
    if end == 0 and (start > 0 and start <= 12):
        print("MMYY")
        return
    if end == 0 and start == 0:
        print("NA")
        return
    if end <= 12 and (start <= 12):
        print("AMBIGUOUS")
    elif (end <= 12) and start > 12:
        print("YYMM")
    elif end > 12 and (start <= 12):
        print("MMYY")
    elif end > 12 and start > 12:
        print("NA")
    else:
        print("NA")
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

suuji=int(input())

d=suuji%1000%100%10
c=int((suuji%1000%100-d)/10)
b=int((suuji%1000-10*c-d)/100)
a=int((suuji-100*b-10*c-d)/1000)
zenhan=10*a+b
kouhan=10*c+d

if (zenhan>=1 and zenhan <=12) and (kouhan==0 or kouhan>=13):
    print("MMYY")

if (kouhan>=1 and kouhan <=12) and (zenhan==0 or zenhan>=13):
    print("YYMM")
    
if (zenhan>=1 and zenhan <=12) and (kouhan>=1 and kouhan<=12):
    print("AMBIGUOUS")
    
if zenhan==0 or kouhan==0:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
N0 = int(S[:2])
N1 = int(S[2:4])

if(1 <= N0 and N0 <= 12):
    j0 = 1
else:
    j0 = 0

if(1 <= N1 and N1 <= 12):
    j1 = 1
else:
    j1 = 0

if(j0 == 1 and j1 == 0):
    print('YYMM')
elif(j0 == 0 and j1 == 1):
    print('MMYY')
elif(j0 == 1 and j1 == 1):
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-

s = input()
if int(s[:2]) > 12 and int(s[2:len(s)]) > 12\
        or s[2:len(s)] == "00":
        print("NA")
elif int(s[:2]) > 12 or int(s[2:len(s)]) > 0:
        print("YYMM")
elif int(s[2:len(s)]) <= 12 :
        print("MMYY")
else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S=int(input())
if S%100==0 or S//100==0 or (S%100>12 and S//100>12):
    print('NA')
elif S%100>12:
    print('MMYY')
elif S//100>12:
    print('YYMM')
elif S%100<=12 or S//100<=12:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s=input()
if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
  if 10*int(s[0])+int(s[1])<=12:
    print("AMBIGUOUS")
  else:
    print("YYMM")
if 10*int(s[0])+int(s[1])<=12 and int(s[0])+int(s[1])!=0:
  if 10*int(s[2])+int(s[3])<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S=int(input())

a=S/100
b=S%100

if(a>12 and b>12):
    print("NA")

elif(a==0 and b==0):
    print("NA")

elif(a>12 and 1<=b<=12):
        print("YYMM")

elif(1<=a<=12 and b>12):
        print("MMYY")

elif(1<=a<=12 and 1<=b<=12):
        print('AMBIGUOU')

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
n =  input()
f = n[:2]
a = n[2:]
#print(f,a)
month = ['01','02','03','04','05','06','07','08','09','10','11','12']
#print(type(f))
if   (f in month) & (a in month):
  print('AMBIGUOUS')
elif (f in month):
  print('MMYY')
else:
#  a in month:
  print('YYMM')

Submission status: Wrong Answer

Solution code:
import sys


def main():
    S = sys.stdin.readline().rstrip()

    s1, s2 = int(S[:2]), int(S[2:])
    if s1 < 1 or s2 < 1:
        print("NA")
    elif s1 > 19 and s2 > 13:
        print("NA")
    elif s2 > 13 and s1 > 19:
        print("NA")
    elif s1 > 13 and s2 < 13:
        print("YYMM")
    elif s1 < 13 and s2 > 13:
        print("MMYY")
    else:
        print("AMBIGUOUS")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = input()

YY = int(S[0]) * 10 + int(S[1])
MM = int(S[2]) * 10 + int(S[3])

if YY == 0 or MM == 0:
  print("NA")
  exit(0)
elif MM <= 12 and YY <= 12:
  print("AMBIGUOUS")
  exit(0)

if MM >= 13 and YY >= 13:
  if MM == YY:
    print("NA")
    exit(0)
  
if MM > 12 and YY < 12:
  print("YYMM")
elif YY > 12 and MM < 12:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = list(input())
f = int(''.join(s[:2]))
b = int(''.join(s[2:]))

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

Submission status: Wrong Answer

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

def main():
    S = input()

    aa = int(S[:2])
    bb = int(S[2:])

    # print(aa,bb)
    if aa > 12 and bb > 12:
        print("NA")
    elif aa <= 12 and aa != 0 and bb <= 12 and bb != 0:
        print("AMBIGUOUS")
    elif aa <= 12 and aa != 0:
        print("MMYY")
    elif bb <= 12 and bb != 0:
        print("YYMM")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

s = int(input())

s /= 100

sita, ue  = math.modf(s)
sita = sita*100


if (1 <= ue) & (12 >= ue):
    if (1 <= sita) & (12 >= sita):
        print("AMBIGUOUS")
    
    else:
        print("YYMM")

elif (1 <= sita) & (12 >= sita):
    if (1 <= ue) & (12 >= ue):
        print("AMBIGUOUS")
    
    else:
        print("MMYY")
    
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input();
first = s[0:2]
second = s[2:4]

first = int(first)
second = int(second)

if first == 0 or second == 0:
    print("NA")

else:
    if first < 13:
        if second < 13:
            print("AMBIGUOUS")
        else:
            print("MMYY")

    else:
        if second < 13:
            print("YYMM")
        else:
            print("NA")

Submission status: Wrong Answer

Solution code:
s = list(input())
if s[0] == "0":
    s[0] = ''
if s[2] == "0":
    s[2] = ''
x = int(s[0]+s[1])
y = int(s[2]+s[3])



if (x <= 12 and x >= 1) and (y >= 0 and y <=12):
    print("AMBIGOUS")

elif(x >0 and (y >= 1 and y <= 12)):
    print("YYMM")

elif(y >0 and (x >= 1 and x <= 12)):
    print("MMYY")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
A = int(S[0:2])
B = int(S[2:4])

if A == 0 & B == 0:
    print('NA')
elif 0 <= A <= 12:
    if 1 <= A <= 12& 1 <= B <= 12 :
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif 0 <= B <= 12:
    if 1 <= B <= 12 & 1 <= A <= 12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

bef = int(S[:2])
aft = int(S[2:])

ansb = ''
ansa = ''

if bef == 0 or aft == 0:
    ans = 'NA'
elif bef > 31:
    if aft > 31:
        ans = 'NA'
    elif 12 < aft <= 31:
        ans = 'YYMM'
    elif aft <= 12:
        ans = 'YYMM'
elif 12 < bef <= 31:
    if aft > 31:
        ans = 'MMYY'
    elif 12 < aft <= 31:
        ans = 'AMBIGUOUS'
    elif aft <= 12:
        ans = 'YYMM'
elif bef <= 12:
    if aft > 31:
        ans = 'MMYY'
    elif 12 < aft <= 31:
        ans = 'AMBIGUOUS'
    elif aft <= 12:
        ans = 'AMBIGUOUS'

print(ans)

Submission status: Wrong Answer

Solution code:

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

if (s1 <= 0) and (s2 > 12): # 0013
    print("NA")
elif (s2 <= 0) and (s1 > 12):  # 1300
    print("NA")
elif (s1 <= 0) and (s2 <= 0): # 0000
    print("NA")
elif (s1 > 12) and (s2 > 12): # 1313
    print("NA")
elif s2 > 12: # 0513
    print("MMYY")
elif s1 > 12: # 1305
    print("YYMM")
else: #0505
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def ans (n):
	a = int(n[:2])
	b = int(n[2:])
	if a == 0 : return 'NA'
	if b == 0 : return 'NA'
	if a<=12 and b<=12:
		return 'AMBIGUOUS'
	if a<=12:
		return 'MMYY'
	if b<=12 :
		return 'YYMM'
	return 'NA'

s = input()
print(ans(s))

Submission status: Wrong Answer

Solution code:
s = str(input())
first = int(s[0:2])
last = int(s[2:5])
is_yymm = False
is_mmyy = False

if first >= 1:
    if first <= 12:
        if last >= 1:
            if last <= 12:
                is_mmyy = True
                is_yymm = True
            else:
                is_mmyy = True
    if last >= 1 and last <= 12:
        is_yymm = True

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

Submission status: Wrong Answer

Solution code:
S = str(input())
S_list = list(S)


S12 = int(S_list[0]+S_list[1])
S34 = int(S_list[2]+S_list[3])

flagYYMM = 0
flagMMYY = 0


if S12 == 00 or S34 == 00:
    print("NA")
    exit()

if S34 <= 12:
    flagYYMM = 1

if S12 <= 12:
    flagMMYY = 1

if flagYYMM == 1 and flagMMYY == 1:
    print("AMBIGUOUS")

elif flagYYMM == 1:
    print("YYMM")

elif flagMMYY == 1:
    print("MMYY")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S=int(input())

a=S/100
b=S%100

if(a>12 and b>12):
    print("NA")

elif(a==0 and b==0):
    print("NA")

elif(a>12 and 0<=b<=12):
    if(1<=b<=12):
        print("YYMM")

elif(0<=a<=12 and b>12):
    if(1<=a<=12):
        print("MMYY")

elif(0<=a<=12 and 0<=b<=12):
    if(1<=b<=12 and 1<=a<=12):
        print('AMBIGUOU')

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# 入力
s = input()
pre = int(s[0:2])
post = int(s[2:len(s)])

# 計算と出力
if (pre == 0) and (post == 0) :
    print("NA")
elif (pre <= 12) and (post <= 12) :
    print("AMBIGUOUS")
elif (pre <= 12) and (post > 12) :
    print("MMYY")
elif (pre > 12) and (post <= 12) :
    print("YYMM")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
S=str(input())
s=list(S)
# print(S[0:2])
# print(S[3:4])
s1 = int(''.join(S[0:2]))
s2 = int(''.join(S[2:4]))
# print(s1)
# print(s2)

stmp1=""
if s1 <=12 and s1 > 0:
    stmp1='MM'
elif (s1 > 0):
    stmp1='YY'
else:
    stmp1='NA'

stmp2=""
if s2 <=12 and s2 > 0:
    stmp2='MM'
elif (s2 > 0):
    stmp2='YY'
else:
    stmp2='NA'

if(stmp1=='NA' or stmp2=='NA')or(stmp1=='YY' and stmp2=='YY'):
    print('NA')
elif(stmp1=='MM' and stmp2=='MM'):
    print('AMBIGUOUS')
else:
    print(stmp1+stmp2)

Submission status: Wrong Answer

Solution code:
def solve():
    S= input()
    ue = int(S[:2])
    sita = int(S[2:])

    if 1 <= sita <= 12 and not(1 <= ue <= 12):
        print("YYMM")
    elif (not (1 <= ue <= 12)) and 1 <= sita <= 12:
        print("MMYY")
    elif (not (1 <= ue <= 12)) and (not (1 <= sita <= 12)):
        print("NA")
    else:
        print("AMBIGUOUS")
if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

n = str(input())

l = [int(x) for x in list(str(n))]

#存在しない
if len(l)!=4:
    print("NA")
elif l[0]*10 + l[1] > 12 and l[2]*10 + l[3] > 12:
    print("NA")
elif (l[0] + l[1] ==0 and l[2] + l[3] == 0) or (l[0]*10 + l[1] > 12 and l[2] + l[3] == 0) or (l[0] + l[1] ==0 and l[2]*10 + l[3] > 12):
    print("NA")
elif l[0]*10 + l[1] <= 12 and l[2]*10 + l[3] <= 12:
    print("AMBIGUOUS")
elif l[0]*10 + l[1] <= 12 and l[2]*10 + l[3] > 12:
    print("MMYY")
elif l[0]*10 + l[1] > 12 and l[2]*10 + l[3] <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
s_1 = int(S[:2])
s_2 = int(S[2:])


def judge(n):
    if 0 < n < 13:
        return 0
    elif 0 < n:
        return 1
    else:
        return 2

if judge(s_1) == 0:
    if judge(s_2) == 0:
        print("AMBIGUOUS")
    elif judge(s_2) == 1:
        print("MMYY")
    else:
        print("NA")
elif judge(s_1) == 1:
    if judge(s_2) == 0:
        print("YYMM")
    else:
        print("NA")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S_i = input()

S1 = int(S_i[:2])
S2 = int(S_i[2:5])

p1 = "N"
p2 = "A"

#print(S1, S2)

if S1 > 0 and S2 > 0 :
    if S1 <= 12 :
        p1 = ("MM")
    else :
        p1 = ("YY")

    if S2 <= 12 :
        p2 = ("MM")
    else :
        p2 = ("YY")

else : ans = ("NA")

if (p1 == "MM" and p2 == "MM") :
    ans = ("AMBIGUOUS")
elif (p1 == "YY" and p2 == "YY") :
    ans = "NA"
else : ans = p1 + p2

print(ans)

Submission status: Wrong Answer

Solution code:
S=int(input())
if S%100==0 or S//100==0:
    print('NA')
elif S%100>12:
    print('MMYY')
elif S//100>12:
    print('YYMM')
elif S%100<=12 or S//100<=12:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()

n1 = int(n[:2])
n2 = int(n[2:])

def date(n1, n2):
    if n1 >= 13 and n2 == 0:
        return 'NA'
    if n1 <= 12 and n2 == 0:
        return 'MMYY'
    if n1 == 0 and n2 >= 13:
        return 'NA'
    if n1 == 0 and n2 <= 12:
        return 'YYMM'
    if n1 >= 13 and n2 >= 13:
        return 'NA'
    if n1 >= 13 and n2 <= 12:
        return 'YYMM'
    if n1 <= 12 and n2 >= 13:
        return 'MMYY'
    if n1 <= 12 and n2 <= 12:
        return 'AMBIGUOUS'


print(date(n1, n2))

Submission status: Wrong Answer

Solution code:
S=int(input())

a=S/100
b=S%100

if(a>12 and b>12):
    print("NA")

elif(a==0 and b==0):
    print("NA")

elif(a>12 and 0<=b<=12):
    if(1<=b<=12):
        print("YYMM")

elif(0<=a<=12 and b>12):
    if(1<=a<=12):
        print("MMYY")

elif(0<=a<=12 and 0<=b<=12):
    if(1<=b<=12 and 1<=a<=12):
        print('AMBIGUOU')

Submission status: Wrong Answer

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

if a==0 and b==0:
    print('NA')

if a<13 and b<13 and a>0 and b>0:
    print('AMBIGUOUS')

elif a<13 and a>0:
        print('MMYY')

elif b<13 and b>0:
        print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = s[:2]
b = s[2:]
 
m = [False, False]
y = [False, False]
 
if a in ["0"+str(i) for i in range(1, 10)]+["10","11","12"]:
    m[0] = True
if b in ["0"+str(i) for i in range(1, 10)]+["10","11","12"]:
    m[1] = True
if a in ["0"+str(i) for i in range(10)]+[str(i) for i in range(10, 100)]:
    y[0] = True
if b in ["0"+str(i) for i in range(10)]+[str(i) for i in range(10, 100)]:
    y[1] = True

if all(m+y):
    print("AMBIGUOUS")
elif y[0] and (not m[0]) and m[1]:
    print("YYMM")
elif m[0] and (not y[0]) and y[1]:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
YY = int(s[0] + s[1])
MM = int(s[2] + s[3])
if 0 < YY < 13 and 0 < MM < 13:
    print("AMBIGUOUS")
elif YY != 00 and 0 < MM < 13:
    print("YYMM")
elif 0 < YY < 13 and str(MM) != "00":
    print("MMYY")
elif YY <= 0 or 13 <= YY and MM <= 0 or 0 <= MM:
    print("NA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# 入力
s = input()
pre = int(s[0:2])
post = int(s[2:len(s)])

# 計算と出力
if (pre == 0) or (post == 0) :
    print("NA")
elif (pre <= 12) and (post <= 12) :
    print("AMBIGUOUS")
elif (pre <= 12) and (post > 12) :
    print("MMYY")
elif (pre > 12) and (post <= 12) :
    print("YYMM")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
if 10*int(s[2])+int(s[3])<=12:
  if 10*int(s[0])+int(s[1])>=13 and int(s[2])+int(s[3])!=0:
    print("YYMM")
  elif 10*int(s[0])+int(s[1])<=12 and int(s[2])+int(s[3])!=0 and int(s[0])+int(s[1])!=0:
    print("AMBIGUOUS")
if 10*int(s[0])+int(s[1])<=12:
  if 10*int(s[2])+int(s[3])>=13 and int(s[0])+int(s[1])!=0:
    print("MMYY")
  elif 10*int(s[2])+int(s[3])<=12 and int(s[0])+int(s[1])!=0 and int(s[2])+int(s[3])!=0:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()

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

if A == 0 or B == 0:
  print('NA')

elif A > 12 and B > 12:
  print('NA')

elif A < 13 and B < 13:
  print('AMBIGUOUS')

elif A > 12:
  print('YYMM')

else:
  print('MMYY')

Submission status: Wrong Answer

Solution code:
# your code goes here\
s = input()
op = ''
first = s[0:2]
second = s[2:4]
if (0 < int(first) <= 12):
	op += 'MM'
elif (12 < int(first)):
	op += 'YY'
if (0 < int(second) <= 12):
	op += 'MM'
elif (12 < int(second)):
	op += 'YY'

if (len(s) != 4 or (first == '00' or second == '00') or op == 'MMMM'):
	op = 'NA'
elif (op == 'YYYY'):
	op = 'AMBIGUOUS'
print(op)