Problem:


Score : 200 points

Problem Statement

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

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

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

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

Constraints

S is a digit sequence of length 4.

Input

Input is given from Standard Input in the following format:

S

Output

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

Sample Input 1

1905

Sample Output 1

YYMM

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

Sample Input 2

0112

Sample Output 2

AMBIGUOUS

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

Sample Input 3

1700

Sample Output 3

NA

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



Sample input:
1905


Sample output:
YYMM

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:

ans=""
S=input()
s1=S[:2]
s2=S[2:]
n1=int(s1)
n2=int(s2)

if (n1>12 and n2>12) or (n1==0 or n2==0):
    ans="NA"
elif n1>12 and n2<=12:
    ans="YYMM"
elif n1<=12 and n2>12:
    ans="MMYY"
elif n1<=12 and n2<=12:
    ans="AMBIGUOS"


print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(4):
    S[i] = int(S[i])

mae = S[0] * 10 + S[1]
usiro = S[2] * 10 + S[3]

if mae <= 12 and usiro <= 12 and mae != 0 and usiro != 0:
    print("AMBIGUOUS")
elif mae <= 12 and usiro > 12 and mae != 0:
    print("MMYY")
elif usiro <= 12 and mae > 12 and usiro != 0:
    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 aft <= 31:
        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 > 12:
        ans = 'MMYY'
    elif aft <= 12:
        ans = 'AMBIGUOUS'

print(ans)

Submission status: Wrong Answer

Solution code:
s=int(input())
a=(s-s%1000)+(s%1000-s%100)
b=s%100
if 100<=a<=1200 and 1<=b<=12:
  print('AMBIGUOUS')
elif 100<=a<=1200 and b>12:
  print('MMYY')
elif a>1200 and 1<=b<=12:
  print('YYMM')
elif a>1200 and b>12:
  print('NA')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
N = input()
first_half = int(N[:2])
latter_half = int(N[3:])
if first_half > 12:
    if latter_half > 0 and latter_half <= 12:
        print('YYMM')
    else:
        print('NA')
elif first_half > 0 and first_half <= 12:
    if latter_half > 0  and latter_half <= 12:
        print('AMBIGUOUS')
    elif latter_half > 12:
        print('MMYY')
    else:
        print('NA')
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 = input()

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

ansb = ''
ansa = ''
print(bef,aft)

if bef == 0 or aft == 0:
    ans = 'NA'
elif bef > 31:
    if aft > 31:
        ans = 'NA'
    elif aft <= 31:
        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 > 12:
        ans = 'MMYY'
    elif aft <= 12:
        ans = 'AMBIGUOUS'

print(ans)

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] + l[1] > 12 and l[2] + l[3] == 0) or (l[0] + l[1] ==0 and l[2] + 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()
strdata=list(s)
data=list(map(int,strdata))
FF=10*data[0]+data[1]
LL=10*data[2]+data[3]
if 12<FF and LL<13 and 0<LL and FF<=19:
    print("YYMM")
elif 12<LL and FF<13 and 0<FF:
    print("MMYY")
elif FF<13 and LL<13 and 0<FF and 0<LL:
    print("AMBIGUOUS")
else:
    print("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") or (p1 == "YY" and p2 == "YY"):
    ans = ("AMBIGUOUS")
else : ans = p1 + p2

print(ans)

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'):
    print('NA')
elif(stmp1=='MM' and stmp2=='MM'):
    print('AMBIGUOUS')
else:
    print(stmp1+stmp2)

Submission status: Wrong Answer

Solution code:
S = str(input())
F = int(S[0:2])
T = int(S[2:4])

def Greaterthan12(x):
    if x > 12:
        return 0
    else:
        return 1
        
Fjudge = Greaterthan12(F)
Tjudge = Greaterthan12(T)
if Fjudge == 0:
    if Tjudge == 0:
        print("NA")
    else:
        print("YYMM")
else:
    if Tjudge == 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()

x = int(s[:2])
y = int(s[2:])

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
input = sys.stdin.readline
ymo = input()

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

ans = ""
#00
if a == 0 and b ==0:
    ans = "NA"

#YYMMのみ
elif (a > 12 or a == 0) and b < 13:
    ans = "YYMM"

#MMYYのみ
elif a < 13 and (b > 12 or b == 0):
    ans = "MMYY"

#どっちも
elif a <13 and b < 13:
    ans = "AMBIGUOUS"

else :
    ans = "NA"

print(ans)

Submission status: Wrong Answer

Solution code:

def main():
    s = input()
    start = int(s[0:2])
    end = int(s[2:4])
    if start == 0 or end == 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()

s1 = int(S[:2])
s2 = int(S[2:])


def is_yymm(i1, i2):
    return (0 < i1 < 100) and (0 < i2 < 13)


def is_mmyy(i1, i2):
    return (0 < i1 < 13) and (0 < i2 < 100)


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

Submission status: Wrong Answer

Solution code:
S = list(input())

left = int(''.join(S[0:2]))
right = int(''.join(S[2:4]))
print(left)
print(right)

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

Submission status: Wrong Answer

Solution code:
n=input()
n1=n[:2]
n2=n[2:]
A=int(n1)
B=int(n2)
if A==0 or B==0:
    print("NA")
elif A<13:
    if B<13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if B<13:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:

ans=""
S=input()
s1=S[:2]
s2=S[2:]
n1=int(s1)
n2=int(s2)

print(str(n1)+" "+str(n2))

if (n1>12 and n2>12) or (n1==0 or n2==0):
    ans="NA"
elif n1>12 and n2<=12:
    ans="YYMM"
elif n1<=12 and n2>12:
    ans="MMYY"
elif n1<=12 and n2<=12:
    ans="AMBIGUOS"


print(ans)

Submission status: Wrong Answer

Solution code:
s=int(input())
a=(s-s%1000)+(s%1000-s%100)
b=s%100
if 100<=a<=1200 and 1<=b<=12:
  print('AMBIGUOUS')
elif 100<=a<=1200 and b>12:
  print('MMYY')
elif a>=1200 and 1<=b<=12:
  print('YYMM')
elif a>=1200 and b>12:
  print('NA')
else:
  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 and s2 <= 1:
        print("NA")
    if s1 <= 1 and 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()
s1 = int(s[:2])
s2 = int(s[2:])

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys
input = sys.stdin.readline
ymo = input()

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

ans = ""
#00
if a == 0 and b ==0:
    ans = "NA"

#YYMMのみ
elif a > 12 and (b < 13 or b == 0):
    ans = "YYMM"

#MMYYのみ
elif (a < 13 or a == 0) and b > 12:
    ans = "MMYY"

#どっちも
elif a <13 and b < 13:
    ans = "AMBIGUOUS"

else :
    ans = "NA"

print(ans)

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')):
	op = 'NA'
elif (op == 'YYYY'):
	op = 'AMBIGUOUS'
print(op)

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:
def solve():
    S= input()
    ue = int(S[:2])
    sita = int(S[2:])

    if (ue > 13 or ue == 0) and (sita > 13 or sita == 0):
        print("NA")
        exit()
    if (ue < 1 or ue > 13) and 1 <= sita <= 12:
        print("YYMM")
        exit()
    if 1 <= ue <= 12 and ( sita > 13 or sita < 1):
        print("MMYY")
        exit()
    if 1 <= ue <= 12 and 1 <= sita <= 12:
        print("AMBIGUOUS")
        exit()
    print("NA")
if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
def solve():
    s = input()
    if len(str(s)) != 4:
        raise Exception('Error')
    sl = list(str(s))
    st = int("".join(sl[:2]))
    end = int("".join(sl[3:4]))
    if st > 0 and st <= 12 and end > 0 and end <= 12:
        print('AMBIGUOUS')
    elif st > 0 and st <= 12 and (end == 0  or end > 12):
        print('MMYY')
    elif (st == 0 or st > 12) and end > 0 and end <= 12:
        print('YYMM')
    else:
        print('NA')

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

s = 0
t = 0

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

Submission status: Wrong Answer

Solution code:
S = input()


def check_yy(a, b):
    if a == "0":
        if b == "0":
            return True
    if a == "1":
        if b in ["3", "4", "5", "6", "7", "8", "9"]:
            return True
    return False


if check_yy(S[0], S[1]):
    if check_yy(S[2], S[3]):
        print("NA")
    else:
        print("YYMM")
elif check_yy(S[2], S[3]):
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S_i = input()

S1 = int(S_i[:2])
S2 = int(S_i[3: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")
else : ans = p1 + p2

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

f = S[:2]
e = S[2:]

front = int(f)
end = int(e)

if front > 12:
    if end > 12 or end == 00:
        print("NA")
    else:
        print("YYMM")

elif front != 00:
    if end > 12:
        print("MMYY")
    elif end == 00:
        print("NA")
    else:
        print("AMBIGUOUS")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
ans = ''
fmt = input()
n1 = int(fmt[:2])
n2 = int(fmt[2:])

if n1 == 0 and n2  == 0:
    ans = 'NA'
elif n1 > 12 and n2 > 12:
    ans = 'NA'
elif 0 < n1 <= 12 and 0 < n2 <= 12:
    ans = 'AMBIGUOUS'
elif n2 > 12 or n2 == 0:
    ans = 'MMYY'
else:
    ans = 'YYMM'
print(ans)

Submission status: Wrong Answer

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

MM = ["%02d"%i for i in range(1, 12+1)]

# 月のフォーマットの可能性
if s1 in MM:
    if s2 in MM:
        print("AMBIGIOUS")
    else:
        print("MMYY")
else:
    if s2 in MM:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
ans = ''
if '00' in S:
    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:
s = input()
f = int(s[0]+s[1])
b = int(s[2]+s[3])
if (f <= 12) & (f >= 1):
    if (b <= 12) & (b >= 1):
        print("AMBIGUOUS")
    elif (b <= 99) & ((b >= 13)or(b == 0)):
        print('MMYY')
    else:
        print('NA')
else:
    if (b <= 12) & ((b >= 1)or(b == 0)):
        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")
  else:
    print("NA")
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")
  else:
    print("NA")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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 >= 13 and n2 >= 13:
        return 'NA'
    if n1 >= 13 and n2 <= 13:
        return 'YYMM'
    if n1 <= 12 and n2 >= 13:
        return 'MMYY'
    if n1 <= 12 and n2 <= 13:
        return 'AMBIGUOUS'


print(date(n1, n2))

Submission status: Wrong Answer

Solution code:
def solve():
    s = input()
    sl = list(str(s))
    st = int("".join(sl[:2]))
    end = int("".join(sl[3:4]))
    if st > 0 and st <= 12 and end > 0 and end <= 12:
        print('AMBIGUOUS')
    elif st > 0 and st <= 12 and (end == 0  or end > 12):
        print('MMYY')
    elif (st == 0 or st > 12) and end > 0 and end <= 12:
        print('YYMM')
    else:
        print('NA')

if __name__ == '__main__':
    solve()

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 > 0 and s2 < 13:
        print("YYMM")
    elif s1 < 13 and s2 > 0:
        print("MMYY")
    else:
        print("AMBIGUOUS")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = list(input())

left = int(''.join(S[0:2]))
right = int(''.join(S[2:4]))

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

Submission status: Wrong Answer

Solution code:
S=list(input())
XXYY=[]
l=' '
for i in range(2):
    l+=S[i]
XXYY.append(int(l))
l=' '
for i in range(2,4):
    l+=S[i]
XXYY.append(int(l))

ans=[]
if XXYY[0]>12:
    if XXYY[1]<=12 and XXYY[1]>0:
        ans.append("YYMM")
    else:
        ans.append("NA")
elif XXYY[0]<=12 and XXYY[0]>0:
    if XXYY[1]>12:
        ans.append("MMYY")
    elif XXYY[1]<=12 and XXYY[1]>0:
        ans.append("AMBIGUOUS")
    else:
        ans.append("NA")
else:
     ans.append("NA")
print(ans[0])

Submission status: Wrong Answer

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

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

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

if a == 0:
	if b > 12:
		print("NA")
	if b <= 12:
		print("YYMM")

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:
        print("YYMM")
elif int(s[2:len(s)]) > 12:
        print("MMYY")
else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S=input()
mozi_1=int(S[0:2])
mozi_2=int(S[2:4])
if 1<=mozi_1<=12 and 1<=mozi_2<=12:print("AMBIGUOUS")
elif 1<=mozi_1<=12 and 13<=mozi_2<=99 or mozi_2==0:print("MMYY")
elif 1<=mozi_2<=12 and 13<=mozi_1<=99 or mozi_1==0:print("YYMM")
else:print("NA")

#print(mozi_1)
#print(mozi_2)

Submission status: Wrong Answer

Solution code:
s = input()
f = int(s[0]+s[1])
b = int(s[2]+s[3])
if (f <= 12) & (f >= 1):
    if (b <= 12) & (b >= 1):
        print("AMBIGUOUS")
    elif (b <= 99) & (b >= 13):
        print('MMYY')
    else:
        print('NA')
else:
    if (b <= 12) & (b >= 1):
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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

if a<13 and b<13:
    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 = list(input())
if s[0] == 0:
    a = int(s[1])
else:
    a = int(s[0]+s[1])
if s[2] == 0:
    b = int(s[2])
else:
    b = int(s[2]+s[3])

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

Submission status: Wrong Answer

Solution code:
def is_mm(target):
    n = int(target)
    print(n)
    return 1 <= n <= 12


def get_result(first2_is_mm, last2_is_mm):
    if first2_is_mm and last2_is_mm:
        return "AMBIGUOUS"
    if not first2_is_mm and not last2_is_mm:
        return "NA"
    if first2_is_mm:
        return "MMYY"
    return "YYMM"


s = str(input())
first2, last2 = ((i + j) for (i, j) in zip(s[::2], s[1::2]))
print(get_result(is_mm(first2), is_mm(last2)))

Submission status: Wrong Answer

Solution code:
def solve():
    s = input()
    sl = list(str(s))
    st = int("".join(sl[:2]))
    end = int("".join(sl[3:4]))
    if st > 0 and st <= 12 and end > 0 and end <= 12:
        print('AMBIGUOUS')
    elif st > 0 and st <= 12 and (end == 0  or end > 12):
        print('YYMM')
    elif (st == 0 or st > 12) and end > 0 and end <= 12:
        print('MMYY')
    else:
        print('NA')

if __name__ == '__main__':
    solve()

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:
    print("AMBIGUOUS")
  else:
    print("NA")
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:
    print("AMBIGUOUS")
  else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

pre = int(s[:2])
post = int(s[2:])

na = False

if 0<pre and pre < 13:
    pre_able_month = True
elif pre == 0:
    na = True
else:
    pre_able_month = False

if 0<post and post<13:
    post_able_month = True
elif post == 0:
    na = True
else:
    post_able_month = False

if na:
    print("NA")
else:
    if pre_able_month and post_able_month:
        print("AMBIGUOUS")
    elif pre_able_month and not(post_able_month):
        print("MMYY")
    elif not(pre_able_month) and post_able_month:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:

def main():
    S = input()

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

    if A != 0 and B <= 12 and B != 0 and A <= 12:
        print("AMBIGUOUS")

    elif (A != 0 and B <= 12) and B != 0:
        print("YYMM")

    elif (B != 0 and A <= 12) and A != 0:
        print("MMYY")

    elif (A == 0 and B <= 12):
        print("YYMM")

    elif (B == 0 and A <= 12):
        print("MMYY")

    else:
        print("NA")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = input()

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

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

Submission status: Wrong Answer

Solution code:
S = input()

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

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

Submission status: Wrong Answer

Solution code:
S = input()
ans = ''
if S.count('0') == 2:
    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:
judge_num = input()

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

if(bef <= 12 or aft <= 12):
  print("AMBIGUOUS")
elif(bef <= 12):
  print("MMYY")
elif(aft <= 12):
  print("YYMM")
else:
  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 > 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()
s1 = int(s[:2])
s2 = int(s[2:])


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

Submission status: Wrong Answer

Solution code:
s = list(str(input()))
A = int(s[0]+s[1])
B = int(s[2]+s[3])
if A > 12:
    if B > 12:
        ans = "NA"
    elif B == 0:
        ans = "NA"
    else:
        ans = "YYMM"
elif A == 0:
    ans = "NA"
elif 0 < A <= 12:
    if B > 12:
        ans = "MMYY"
    elif B == 0:
        ans = "NA"
    else:
        ans = "AMBIGUOUS"
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
bef=int(s[0])*10+int(s[1])
aft=int(s[2])*10+int(s[3])

ans=''
if 0<aft<13 and 0<bef<13:
  ans='AMBIGUOUS'
elif (100>aft>12 or aft==0) and 0<bef<32:
  ans='MMYY'
elif (100>bef>12 or bef==0) and 0<aft<32:
  ans='YYMM'
else:
  ans='NA'
print(ans)

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)

if MM < 12 and YY < 12:
  print("AMBIGUOUS")
  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(map(str, input()))
YY = s[0] + s[1]
MM = s[2] + s[3]
a = int(s[0]+s[1])
b = int(s[2]+s[3])
if a <= 12 and b <= 12:
  print('AMBIGUOS')
elif a > 12 and b <= 12 and b != 0:
  print('YYMM')
elif a <= 12 and b >12 and a != 0:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s=int(input())
a=(s-s%1000)+(s%1000-s%100)
b=s%100
if a<=1200 and 1<=b<=12:
  print('AMBIGUOUS')
elif a<=1200 and b>12:
  print('MMYY')
elif a>=1200 and 1<=b<=12:
  print('YYMM')
elif a>12 and b>12:
  print('NA')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

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

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

Submission status: Wrong Answer

Solution code:
n=input()
n1=n[:2]
n2=n[3:]
A=int(n1)
B=int(n2)
if A==0 or B==0:
    print("NA")
elif A<13 and A>0:
    if B<13 and B>0:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if B<13 and B>0:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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


def check(s):
    if s == "00":
        return "n"
    elif s[0] == "0" or s == "11" or s == "12":
        return "my"
    else:
        return "y"


t1 = check(s1)
t2 = check(s2)

if t1 == "n" or t2 == "n":
    print("NA")
elif t1 == "y":
    if t2 == "y":
        print("NA")
    else:
        print("YYMM")
else:
    if t2 == "y":
        print("MMYY")
    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
import random

s = input()

# list = ["00", "01","02","03","04","05","06","07","08","09","10","11","12","13","14"]

# for i in range(100):
    # s = f"{random.choice(list)}{random.choice(list)}"
s1 = int(s[:2])
s2 = int(s[2:])

print(s)

if len(s) != 4:
    print("NA 1")
elif (s1 == 0) or (s2 == 0):
    print("NA 2")
elif (s1 > 12) and (s2 > 12):
    print("NA 3")
elif s2 > 12:
    print("MMYY")
elif s1 > 12:
    print("YYMM")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = str(input())
li = [(i+j) for (i,j) in zip(S[::2],S[1::2])]
if int(li[0]) == 00 or int(li[1]) == 00:
    print('NA')
elif int(li[0]) <= 12 and int(li[1]) <= 12:
    print('AMBIGUOUS')
elif int(li[0]) >= 13 and int(li[1]) <= 12:
    print('YYMM')
elif int(li[0]) <= 12 and int(li[1]) >= 13:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
ans = ''
fmt = input()
n1 = int(fmt[:2])
n2 = int(fmt[2:])

if n1 == 0 or n2  == 0:
    ans = 'NA'
elif n1 > 12 and n2 > 12:
    ans = 'NA'
elif n1 <= 12 and n2 <= 12:
    ans = 'AMBIGUOUS'
elif n2 > 12:
    ans = 'MMYY'
else:
    ans = 'YYMM'
print(ans)