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()
if S[:2] == "00" or S[2:] == "00":
    print('NA')
elif int(S[:2]) > 12 and int(S[2:]) > 12:
    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")
else:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
S = input()
s1 = int(S[:2])
s2 = int(S[2:])
if 0<s1<=12 and 0<s2<=12:
  print('AMBIGUOUS')
elif 0<s2<=12:
  print('YYMM')
elif 0<s1<=12 and 0<s2:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

AA = S[:2]
BB = S[2:]
a = []
for i in range(1, 13):
    if 1 <= i <= 9:
        a.append('0' + str(i))
    else:
        a.append(str(i))

if not AA in a and not BB in a:
    print('WA')
elif AA in a and BB in a:
    print('AMBIGUOUS')
elif AA in a:
    print('MMYY')
else:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
ls=list(input())
first=[ls[0],ls[1]]
second=[ls[2],ls[3]]

if ls[0]=="0":
    del first[0]
if ls[2]=="0":
    del second[0]

a=int("".join(first))
b=int("".join(second))

def can_be_month(n):
    if n>=1 and n<=12:
        return True
    else:
        return False

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def solve(s):
    if int(s[0:2]) == 0 or int(s[2:4]) == 0:
        print("NA")
        return 0
    if int(s[0:2]) > 12 and int(s[2:4]) > 12:
        print("NA")
        return 0
    if int(s[0:2]) < 13 and int(s[2:4]) < 13:
        print("AMBIGUOUS")
        return 0
    if int(s[2:4]) < 13:
        print("YYMM")
        return 0
    if int(s[0:2]) < 13:
        print("MMYY")
        return 0


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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
former = s[:2]
latter = s[2:]

# print(former)
# print(latter)

def isYear(s):
    num = int(s)
    if 0 < num:
        return True
    else:
        return False

def isMonth(s):
    num = int(s)
    if 0 < num < 13:
        return True
    else:
        return False

if (isYear(former) and isMonth(former) and isYear(latter) and isMonth(latter)):
    print('AMBIGUOUS')
elif (isYear(former) and isMonth(latter)):
    print('YYMM')
elif (isYear(latter) and isMonth(former)):
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

AA = S[:2]
BB = S[2:]
a = []
for i in range(1, 13):
    if 1 <= i <= 9:
        a.append('0' + str(i))
    else:
        a.append(str(i))
print(a)

if not AA in a and not BB in a:
    print('WA')
elif AA in a and BB in a:
    print('AMBIGUOUS')
elif AA in a:
    print('MMYY')
else:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
#coding: utf-8
S = input()
year = 19
month = 12
if 0 < int(S[:2]) <= month:
	if 0 < int(S[2:]) <= month:
		print("AMBIGUOUS")
	elif 0 < int(S[2:]) <= year:
		print("MMYY")
	else:
	    print("NA")
elif 0 < int(S[:2]) <= year:
	if 0 < int(S[2:]) <= month:
		print("YYMM")
	else:
	    print("NA")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
S = raw_input().strip()
a, b = S[0:2], S[2:]

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

ia = int(a)
ib = int(b)

if ia >= 1 and ia <= 12 and ib >=1 and ib <= 12:
    print('AMBIGUOUS')


if ia >= 1 and ia <= 12 and ib > 12:
    print('MMYY')

if ia > 12 and ib <= 12:
    print('YYMM')

print('NA')

Submission status: Wrong Answer

Solution code:
def can_be_month(n):
    if 0 < int(n) < 13:
        return True
    return False


S = input()

if not S:
    print('NA')
elif can_be_month(S[:2]) and can_be_month(S[2:]):
    print('AMBIGUOUS')
elif can_be_month(S[:2]):
    print('MMYY')
elif can_be_month(S[2:]):
    print('YYMM')

Submission status: Wrong Answer

Solution code:
s = input()
def YY(s):
    if 1<= int(s) <= 99:
        return True
    return False

def MM(s):
    if 1<=int(s)<=12:
        return True
    return False

if YY(s[:2]) and MM(s[2:]):
    if MM(s[:2]) and YY(s[2:]):
        print("AMBIGUOUS")
    else:
        print("YYMM")
        
elif MM(s[:2])  and YY(s[2:]):
    if YY(s[:2]) and MM(s[2:]):
        print("AMBIGUOUS")
    else:
        print("MMYY")
        
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
S1 = int(S[:2])
S2 = int(S[2:])
s_dic = {'1':'YYMM', '2':'MMYY', '3':'AMBIGUOUS', '4':'NA'}
if (S1 == 0 and S2 > 12) or (S1 > 12 and S2 == 0) or (S1 > 12 and S2 > 12) or (S1 == 0 and S2 == 0):
    print(s_dic['4'])
elif S1 > 12:
    print(s_dic['1'])
elif S2 > 12:
    print(s_dic['2'])
else:
    print(s_dic['3'])

Submission status: Wrong Answer

Solution code:
S = input()
f = int(S[:2])
l = int(S[3:5])

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
S = stdin.readline().rstrip()
if int(S[:2]) > 12:
    if 1 <= int(S[2:]) <= 12:
        print('YYMM')
    else:
        print('NA')
else:
    if 1 <= int(S[2:]) <= 12:
        print('AMBIGUOUS')
    elif 13 <= int(S[2:]):
        print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
def isYear(s):
    try:
        s_int = int(s)
        if s_int == 0:
            return False
        else:
            return True
    except ValueError:
        return False


def isMonth(s):
    try:
        s_int = int(s)
        if s_int == 0 or s_int > 12:
            return False
        else:
            return True
    except ValueError:
        return False


if __name__ == '__main__':
    s = input()
    # MMは01-12 YY 01-99
    yy_1 = isYear(s[0:2])
    mm_1 = isMonth(s[0:2])
    yy_2 = isYear(s[2:4])
    mm_2 = isMonth(s[2:4])
    yymm = yy_1 and mm_2
    mmyy = mm_1 and yy_2
    if yymm and mmyy:
        print("AMBIGUOUS")
    elif yymm:
        print("YYMM")
    elif mmyy:
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

s12 = int(S[:2])
s34 = int(S[3:])
# dic_mmdd = {1:31, 2:29, 3:31, 4:30, 5:31, 6:30, 7:31, 8:31, 9:30, 10:31, 11:30, 12:31}

if s34 >=1 and s34 <= 12:
    yymm = True
else:
    yymm = False

if s12 >=1 and s12 <= 12:
    mmyy = True
else:
    mmyy = False

if yymm and mmyy:
    ans = 'AMBIGUOUS'
elif yymm:
    ans = 'YYMM'
elif mmyy:
    ans = 'MMYY'
else:
    ans = 'NA'

print(ans)

Submission status: Wrong Answer

Solution code:
a = input()
q, mod =divmod(int(a), 100)
if q < 13 :
  if mod < 13:
    print("AMBIGUOUS")
  else : print("MMYY")
else:
  if mod < 13:
    print("YYMM")
  else : print("NA")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
S = input()
yymm = 0
mmyy = 0
amb = 0
na = 0
if int(S[0:2]) <= 12:
    if int(S[2:4]) <= 12:
        if int(S[2:4]) > 0:
            amb = 1
            print('AMBIGUOUS')
        else:
            na = 1
            print('NA')
    else:
        mmyy = 1
        print('MMYY')
else:
    if (int(S[2:4]) <= 12) and (int(S[2:4]) > 0):
        yymm = 1
        print('YYMM')
    else:
        na = 1
        print('NA')

Submission status: Wrong Answer

Solution code:
S = list(input())

S1 = int(''.join(S[0:2]))
S2 = int(''.join(S[2:4]))

S1_state = [0,0]
S2_state = [0,0]
if (S1 > 0 and S1 < 13):
  S1_state[1] = 1
if S1 > 0:
  S1_state[0] = 1
if (S2 > 0 and S2 < 13):
  S2_state[1] = 1
if S2 > 0:
  S2_state[0] = 1

if S1_state[0] and S1_state[1] and S2_state[0] and S2_state[1]:
  print('AMBIGUOUS')
elif S1_state[0] and S2_state[1]:
  print('YYMM')
elif S1_state[1] and S2_state[0]:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def main(s):
    big = int(s / 100)
    small = s % 100

    if 1 <= big <= 12 and 1 <= small <= 12:
        print("AMBIGUOUS")
    elif 1 <= big <= 12 and 12 < small:
        print("MMYY")
    elif 12 < big and 1 <= small <= 12:
        print("YYMM")
    else:
        print("NA")
        
if __name__ == '__main__':
    try:
        s = int(input().strip())
        main(s)
    except EOFError:
        pass

Submission status: Wrong Answer

Solution code:
s = int(input())

flag1 =  0<= s/100 <=12
flag2 =  0<= s%100 <= 12

ans = ""
if flag1 and flag2:
    ans = "AMBIGUOUS"
elif not flag1 and flag2 and s %100 != 0:
    ans = "YYMM"
elif flag1 and not flag2 and s/100!=0:
    ans = "MMYY"
else:
    ans = "NA"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import datetime as dt
S = input()
pre = int(S[0:2])
aft = int(S[2:4])

# yymm
try:
    dt.date(pre, aft, 1)
    flg_yymm = 1
except:
    flg_yymm = 0

# mmyy
try:
    dt.date(aft, pre, 1)
    flg_mmyy = 1
except:
    flg_mmyy = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
S1 = int(S[0] + S[1])
S2 = int(S[2] + S[3])
if  S1 == 0 or S2 == 0:
    print("NA")
elif S2 <= 12 and S1 <= 12:
    print("AMBIGUOUS")
elif S2 <= 12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s=list(input())
ss=s[:3]
sss=s[3:]
x=int("".join(ss))
y=int("".join(sss))
if x==0 and y==0:
    print("NA")
if x>=13 and y==0:
    print("NA")
if x==0 and y>=13:
    print("NA")
if x>=13 and y>=13:
    print("NA")
if 1<=x<=12 and 1<=y<=12:
    print("AMBIGUOUS")
elif 1<=x<=12 :
    print("MMYY")
elif 1<=y<=12:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
S = raw_input()
s1 = int(S[2:])
s2 = int(S[:2])
print(s2,s1)
if(s1 == 0 or s1 > 12):
	s1 = 0
else:
	s1 = 1
if(s2 == 0 or s2 > 12):
	s2 = 0
else:
	s2 = 1
if(s1 == 0 and s2 == 0):
	print("NA")
elif(s1 == 0 and s2 == 1):
	print("MMYY")
elif(s1 == 1 and s2 == 0):
	print("YYMM")
else:
	print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
if int(S[0]+S[1])>12:
    print("YYMM")
elif int(S[0]+S[1])>0:
    if int(S[2]+S[3])>12:
        print("MMYY")
    else:
        print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
S12 = int(S[:2])
S34 = int(S[2:])

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

Submission status: Wrong Answer

Solution code:
def check(c):
	if(48<=ord(c)<=57):
		return True
	return False

S=input()

if( (not check(S[0])) or (not check(S[1])) or (not check(S[2])) or (not check(S[3]))):
	print("NA")
else:
	v1=int(S[:2])
	v2=int(S[2:])

	y1=(v1>0)
	m1=(12>=v2>0)
	b1=y1 and m1

	m2=(12>=v1>0)
	y2=(v2>0)
	b2=y2 and m2

	if(b1 and b2):
		print("AMBIGUOUS")
	elif(b1):
		print("YYMM")
	elif(b2):
		print("MMYY")
	else:
		print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

ff = int(s[:2])
bb = int(s[2:])

if (ff > 12 or ff==0) and (bb > 12 or bb==0) :
    print("NA")
elif (ff > 12 or ff==0):
    print("YYMM")
elif (bb > 12 or bb==0):
    print("MMTT")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
a = input()
mae = int(a[:2])
usiro = int(a[2:])

if(mae >12):
    if(1 <=usiro <= 12):
        print('YYMM')
    else:
        print('NA')
elif(usiro > 12):
    if(1<= mae <=12):
        print('MMYY')
    else:
        print('NA')
elif(1<= mae <= 12):
    if(1<= usiro <=12):
        print('AMBIGOUS')

Submission status: Wrong Answer

Solution code:
import sys

S = input()

if int(S[2:]) in range(1, 13):
    if int(S[:2]) in range(1, 13):
        print('AMBIGOUS')
        sys.exit()
    else:
        print('YYMM')
        sys.exit()
elif int(S[:2]) in range(1, 13):
    print('MMYY')
    sys.exit()
else:
    print('NA')

Submission status: Wrong Answer

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

S = int(input())

s1 = S / 100
s2 = S % 100

mm_s1 = False
mm_s2 = False
output = ''

if s1 > 0 and s1 <= 12:
    mm_s1 = True
if s2 > 0 and s2 <= 12:
    mm_s2 = True

if mm_s1 == True and mm_s2 == True:
    output = 'AMBIGUOUS'
elif mm_s1 == True and mm_s2 == False:
    output = 'MMYY'
elif mm_s1 == False and mm_s2 == True:
    output = 'YYMM'
else:
    output = 'NA'

print (output)

Submission status: Wrong Answer

Solution code:
#YYMM, MMYY, AMBIGUOUS, NA
S = str(input())

s0 = int(S[0:2])
s1 = int(S[2:])

if s0>12:#YYMM or NA
    if s1>12:
        ans="NA"
    else:
        ans="YYMM"
elif s1>12:#MMYY
    ans="MMYY"
else:
    ans="AMBIGUOUS"
    
print(ans)

Submission status: Wrong Answer

Solution code:
S = map(int, list(raw_input()))

large_num = S[0]*10 + S[1]
min_num = S[2]*10 + S[3]

if large_num <= 0 or min_num <= 0: print 'NA'
elif large_num <= 12 and min_num <= 12: print 'AMBIGUOUS'
elif large_num <= 12: print 'MMYY'
elif min_num <= 12: print 'YYMM'
else: print 'NA'

Submission status: Wrong Answer

Solution code:
S = int(input())

before = S % 100
after = S //100

if after == 0 or before == 0:
  print("NA")
elif after >=31 or before >= 31:
  print("NA")
if before <= 12 and after <= 12:
  print("AMBIGUOUS")
elif before <= 12 and after > 12 and after <= 31:
  print("YYMM")
elif before > 12 and before <= 31 and after <= 12:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
l = list(input())

ab = l[0] + l[1]
cd = l[2] + l[3]

if ab[0] == "0":
    ab = ab[1]
if cd[0] == "0":
    cd = cd[1]

ab = int(ab)
cd = int(cd)
if ab < 13 and cd < 13 and ab != 0 and cd != 0:
    print("AMBIGUOUS")
elif ab < 13 and cd < 13 and cd != 0:
    print("AMBIGUOUS")
elif ab < 13 and cd < 13 and ab != 0:
    print("AMBIGUOUS")
elif ab >= 13 and cd < 13 and cd != 0:
    print("YYMM")
elif cd >= 13 and ab < 13 and ab != 0:
    print("MMYY")
elif ab >= 13 and cd == 0:
    print("NA")
elif cd >= 13 and ab == 0:
    print("NA")

Submission status: Wrong Answer

Solution code:
def judge(Y):
    year = int(Y)
    former = year/100
    latter = year%100
    if(former >= 1 and former <= 12):
        if(latter >= 1 and latter <= 12):
            return("AMBIGUOUS")
        elif(latter == 0 or latter > 12):
            return("MMYY")
    elif(former == 0 or former > 12):
        if(latter >= 1 and latter <= 12):
            return("YYMM")
        elif(latter == 0 or latter > 12):
            return("NA")
    else:
        return("NA")

S = input()
print(judge(S))

Submission status: Wrong Answer

Solution code:
S = int(input())
a = int(S / 100)
b = S - a*100
if 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()
s1 = int(S[:2])
s2 = int(S[2:])

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

Submission status: Wrong Answer

Solution code:
S = input()
lead = int(S[:2])
back = int(S[2:])
answer = ""
if(lead == 0 or back == 0 or (lead > 12 and back > 12)):
    answer = "NA"
elif(lead > 12):
    answer = "YYMM"
elif(back > 12):
    answer = "MMYY"
else:
    answer = "AMBIGUOUS"
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def isY(num):
    if num == 0:
        return False

    return True

def isM(num):
    if num <= 12 and num >= 1:
        return True

    return False


line = input()
first = int(line[:2])
second = int(line[2:])

ans = "NA"

if isY(first) and isM(second):
    ans = "YYMM"

if isM(first) and isY(second):
    if ans == "YYMM":
        ans = "AMBIGUOUS"
    else:
        ans = "YYMM"



    
if (first == 00) or (second == 00):
    ans = "NA"
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
fo = int(s[0] + s[1])
la = int(s[2] + s[3])
fism = fo < 13
lism = la < 13
if fism and lism:
    ans = "AMBIGUOUS"
if fism and not lism:
    ans = "MMYY"
if not fism and lism:
    ans = "YYMM"
if not fism and not lism:
    ans = "NA"
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    S = list(input())

    Y = int(''.join(S[:2]))
    M = int(''.join(S[2:]))


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

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()

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

if x > 12:
    if y > 12:
        print("NA")
    elif y >= 1:
        print("YYMM")
    else:
        print("NA")
elif x >= 1:
    if y > 12:
        print("MMYY")
    elif y >= 1:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if y > 12:
        print("NA")
    if y >= 1:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
s = input()
front = int(s[0:2])
back = int(s[2:])

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

Submission status: Wrong Answer

Solution code:
def is_m(n):
    return 1 <= n & n <= 12


def is_y(n):
    return n != 0

s=input()
h=int(s[0:2])
t=int(s[2:4])

if is_m(h) & is_m(t) & is_y(h) & is_y(t):
    print('AMBIGUOUS')
elif is_m(h) & is_y(t):
    print('MMYY')
elif is_y(h) & is_m(t):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S=int(input())

if S>1200 and S%100>12 or S<100 or S%100==0:
    print('NA')
elif S>1200 and S%100<=12:
    print('YYMM')
elif S<=1200 and S%100>12:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = str(input())

N1 = int(S[:2])
N2 = int(S[2:])

if 0<N1<=12 :
    if 0<N2<=12:
        print( "AMBIGUOUS")
    elif 0<N2:
        print("MMYY")
    else:
        print("NA")


elif 0<=N1:
    if 0<N2<=12:
        print("YYMM")
    else:
        print("NA")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
def main():
    N = input()
    F = int(N[0:2])
    L = int(N[2:])
    FisYY = (F>=0 and F<=99)
    FisMM = (F>=1 and F<=12)
    LisYY = (L>=0 and L<=99)
    LisMM = (L>=1 and L<=12)
    if (FisYY and LisMM and FisMM and LisYY):
        print('AMBIGUOUS')
    elif (FisYY and LisMM):
        print('YYMM')
    elif (LisYY and LisMM):
        print('MMYY')
    else:
        print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()

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

def check(s1, s2):
    if 1 <= s1 <= 12 and 1 <= s2 <= 12:
        return 'AMBIGUOUS'
    if 1 <= s1 <= 12 and s2 != 0:
        return 'MMYY'
    if 1 <= s2 <= 12 and s1 != 0:
        return 'YYMM'
    return 'NA'

print(check(s1, s2))

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()


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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = int(input())
a = S//100
b = S%100
isyymm = 0
ismmyy = 0
if a>0 and b>0 and a<=19 and b<=19:
    if a<=12:
        ismmyy = 1
    if b<=12:
        isyymm = 1

ans = ['NA','YYMM','MMYY','AMBIGUOUS']
print(ans[isyymm+ismmyy*2])

Submission status: Wrong Answer

Solution code:
S = input()
S1 = int(S[0:2])
S2 = int(S[2:4])

flag_year = {}
flag_month = {}

flag_YYMM = True
flag_MMYY = True

if S1 == 0:
    flag_YYMM = False
    flag_MMYY = False
elif S1 >= 13:
    flag_MMYY = False

if S2 == 0:
    flag_YYMM = False
    flag_MMYY = False
elif S2 >= 13:
    flag_YYMM = False

if flag_YYMM == True and flag_MMYY == True:
    print("AMBIGUOUS")
elif flag_YYMM == True:
    print("YYMM")
elif flag_MMYY == True:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
is_yy = lambda x: 1 <= int(x) <= 99
is_mm = lambda x: 1 <= int(x) <= 12

one = False
another = False

a = is_yy(s[:2])
b = is_mm(s[2:])

if a and b:
    one = True

a = is_mm(s[:2])
b = is_yy(s[2:])

if a and b:
    another = True

if one and another:
    print('AMBIGUOUS')
elif one:
    print('YYMM')
elif another:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
A=int(S[:2])
B=int(S[3:])
YM=MY=False
if 0<A and 0<B<=12:
    YM=True
if 0<A<=12 and 0<B:
    MY=True

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
S = input()

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

if 0 <= bef and bef <= 12 and 1 <= aft and aft <= 12:
    print("AMBIGUOUS")
elif 0 <= bef and bef <= 99 and 1 <= aft and aft <= 12:
    print("YYMM")
elif 0 <= bef and bef <= 12 and 0 <= aft and aft <= 99:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

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

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:
    print("AMBIGUOUS")
elif first <= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S =input()
A = S[:2]
B = S[2:]
A_right = 0
B_right = 0
if int(A) > 1 and int(A) < 13:
  A_right = 1
if int(B) > 1 and int(B) < 13:
  B_right = 1
if A_right == 0 and B_right == 0:
  print('NA')
elif A_right == 1 and B_right == 0:
  print('MMYY')
elif A_right == 0 and B_right == 1:
  print('YYMM')
elif A_right == 1 and B_right == 1:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
former, latter = int(s[:2]), int(s[2:])

if 1 <= former <= 12 and 1 <= latter <= 12:
  print('AMBIGUOUS')
elif 1 <= former <= 12 and (latter == 0 or 13 <= latter <= 99):
  print('MMYY')
elif (latter == 0 or 13 <= former <= 99) and 1 <= latter <= 12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
import sys

s = sys.stdin.readline()

n1 = int(s[:3])
n2 = int(s[3:])

n1m = n1 >= 1 and n1 <= 12
n2m = n2 >= 1 and n2 <= 12

if n1m and n2m:
    print('AMBIGUOUS')
elif n1m:
    print('MMYY')
elif n2m:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
ans = 0
#print(S[0:2], S[2:], int(S[0:2]), int(S[2:]))
if(0 < int(S[0:2]) and int(S[0:2]) <= 12) and (0 < int(S[2:]) and (int(S[2:]) <= 99)):
    ans += 1
if(0 < int(S[2:]) and int(S[2:]) <= 12) and (0 < int(S[0:2]) and (int(S[0:2]) <= 99)):
    ans += 2

if ans == 1:
    print('MMYY')
if ans == 2:
    print('YYMM')
if ans == 3:
    print('AMBIGUOUS')
if ans == 0:
    print('NA')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
S = input()
s1 = int(S[:2])
s2 = int(S[2:])
if 0<s1<=12 and 0<s2<=12:
  print('AMBIGUOUS')
elif 0<s1<=12 and 0<s2:
  print('MMYY')
elif 0<s1 and 0<s2<=12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())

if s//100 is 0 or s%100 is 0:
  print("NA")
elif s//100 < 13:
  
  if s%100 < 13:
    print("AMBIGUOUS")
  else:
    print("MMYY")
elif s%100 < 13:
    print("YYMM")
else: print("NA")

Submission status: Wrong Answer

Solution code:
#coding: utf-8
S = input()
year = 19
month = 12
if 0 < int(S[:2]) <= month:
	if 0 < int(S[2:]) <= month:
		print("AMBIGUOUS")
	elif 0 < int(S[2:]) <= year:
		print("MMYY")
	else:
	    print("NA")
elif 0 < int(S[:2]) <= year:
	if 0 < int(S[2:]) <= month:
		print("YYMM")
	elif 0 < int(S[2:]) <= year:
	    print("AMBIGUOUS")
	else:
	    print("NA")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
import numpy as np

#v = [int(d) for d in input().split()]
v= list(str(input()))


li = list(np.array_split(v,2))

mae = int(''.join(li[0]))
usiro = int(''.join(li[1]))

ma = 0
usi = 0

if int(usiro) >= 1:
    if int(usiro) <= 12:
        usi = 1
    else:
        usi = 2

if int(mae) >= 1:
    if int(mae) <= 12:
        ma = 1
    else:
        ma = 2
if usi == 0:
    print('NA')
    exit()
if mae == 0:
    print('NA')
    exit()
if usi ==1 & mae ==1:
    print('AMBIGUOUS')
if usi == 1 & mae == 2:
    print('YYMM')
if usi == 2 & mae == 1:
    print('MMYY')
if usi == 2 & mae == 2:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

S=int(input())
y=S//100
m=S%100


if y==0 or m==0 :
    print("NA")
elif y>=13 and m>=13:
    print("NA")
elif y>=13 :
    print("YYMM")
elif m>=13:
    print("MMYY")
else:
    print("AMBIGUOUS")

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 and aa != 0 and bb != 0:
        print("AMBIGUOUS")
    elif aa > 12 and bb != 0:
        print("YYMM")
    elif bb > 12 and aa != 0:
        print("MMYY")
    else:
        print("NA")


if __name__ == '__main__':
    main()