Problem:


Score : 200 points

Problem Statement

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

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

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

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

Constraints

S is a digit sequence of length 4.

Input

Input is given from Standard Input in the following format:

S

Output

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

Sample Input 1

1905

Sample Output 1

YYMM

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

Sample Input 2

0112

Sample Output 2

AMBIGUOUS

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

Sample Input 3

1700

Sample Output 3

NA

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



Sample input:
1905


Sample output:
YYMM

Submission status: Wrong Answer

Solution code:
S = input()

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

def is_month(ss):
    if ss > 12:
        return False
    else:
        return True

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

Submission status: Wrong Answer

Solution code:
s=input()
lhs=int(s[0])*10+int(s[1])
rhs=int(s[2])*10+int(s[3])
# print(lhs,rhs)
if 0<lhs<=12 and 0<rhs<=12:
    print('ANBIGUOUS')
elif 0<lhs<=12:
    print('MMYY')
elif 0<rhs<=12:
    print('YYMM')
else:
    print('NAN')

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()

ue = int(s[0]+s[1])
sita = int(s[2]+s[3])

if ue == 0 and sita == 0:
    print('NA')
elif ue == 0 and sita > 0 and sita <= 12:
    print('YYMM')
elif sita == 0 and ue > 0 and ue <= 12:
    print('MMYY')
elif sita <= 12 and ue <= 12:
    print('AMBIGUOUS')
elif sita <= 12 and ue > 12:
    print('YYMM')
elif ue <= 12 and sita > 12:
    print('MMYY')
elif ue > 12 and sita > 12:
    print('NA')

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    a = s[:2]
    b = s[2:]
    ap = 0 < int(a) < 100
    am = int(a) < 13
    bp = 0 < int(b) < 100
    bm = int(b) < 13
    if ap and am and bp and bm:
        print('AMBIGUOUS')
    elif ap and am and bp and not bm:
        print('MMYY')
    elif ap and not am and bp and bm:
        print('YYMM')
    else:
        print('NA')


main()

Submission status: Wrong Answer

Solution code:
def check(M_1, M_2):
    M_1 = int(M_1)
    M_2 = int(M_2)
    MM = M_1 * 10 + M_2
    if 1 <= MM <= 12:
        return True
    else:
        return False


S = input()
ans = [0, 0]
if check(S[0], S[1]):
    ans[0] += 1
if check(S[2], S[3]):
    ans[1] += 1

if ans == [0, 0]:
    print("NA")
elif ans == [0, 1]:
    print("YYMM")
elif ans == [1, 0]:
    print("MMYY")
elif ans == [1, 1]:
    print("AMBIGIOUS")

Submission status: Wrong Answer

Solution code:
S = input()

S1 = S[0:2]
S2 = S[2:4]

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

def is_YY(s):
  if 0 <= int(s) <= 99:
    return(True)
  else:
    return(False)

if (not is_MM(S1) and not is_YY(S1)) or (not is_MM(S2) and not is_YY(S2)):
  print("NA")
elif is_YY(S1) and is_MM(S1) and is_YY(S2) and is_MM(S2):
  print("AMBIGUOUS")
elif is_YY(S1) and is_MM(S2):
  print("YYMM")
elif is_YY(S2) and is_MM(S1):
  print("MMYY")

Submission status: Wrong Answer

Solution code:
a=input()
a=[i for i in a]
x=int(a[0]+a[1])
y=int(a[2]+a[3])
cy=0
cm=0
if 0<x<=13 and y<=99:
    cm+=1
if x<=99 and 0<y<=13:
    cy+=1
if cy==1:
    if cm==1:
        print("AMBIGUOUS")
    else:
        print("YYMM")
elif cm==1:
    print("MMYY")
else:
    print("NA")

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

Submission status: Wrong Answer

Solution code:
c = int(input())

a = int (c / 100)
b = c % 100
if 0 < a <13:
    if 0 < b <13:
        print('AMBIGOUS')
    else:
        print('MMYY')
else:
    if 0 < b <13:
        print('YYMM')
    else:
        print('NA')

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")
    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
print(a, b)

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=str(input())
if(int(s[:2])>12 and int(s[2:])<=12 and int(s[2:])>0):
	print("YYMM")
elif(int(s[2:])>12 and int(s[:2])<=12  and int(s[:2])>0):
	print("MMYY")
elif(int(s[2:])<=12 and int(s[:2])<=12 and int(s[2:])>0 and int(s[:2])==0):
	print("MMYY")
elif(int(s[2:])<=12 and int(s[:2])<=12 and int(s[2:])==0 and int(s[:2])>0):
	print("YYMM")
elif(int(s[2:])<=12 and int(s[:2])<=12 and int(s[2:])>0 and int(s[:2])>0):
	print("AMBIGUOUS")
else:
	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) and bb <= 12:
    print("YYMM")
elif ff <= 12 and (bb > 12 or bb==0):
    print("MMTT")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

top = int(s[0]) * 10 + int(s[1])
btm = int(s[2]) * 10 + int(s[3])

if top > 12 and btm > 12:
    print("NA")
    exit(0)

if top <= 12 and btm <= 12:
    print("AMBIGUOUS")
elif top > 12:
    print("YYMM")
elif btm > 12:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
# N = int(input())
# N, K = map(int, input().split())
# A = list(map(int, input().split()))

S = input()

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

F_YY = (F != 0)
B_YY = (B != 0)
F_MM = (1 <= F <= 12)
B_MM = (1 <= B <= 12)

if F_YY and F_MM and B_YY and B_MM:
    print("AMBIGUOUS")
elif (not F_YY and not F_MM) or (not B_YY and not B_MM) or (not F_YY and not B_YY) or (not F_MM and not B_MM):
    print("NA")
elif not B_YY or not F_MM:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
tmp = s[:2]
tmp2 = s[2:]

if (int(tmp) > 12 and int(tmp2) > 12) or (int(tmp2) == 0 or int(tmp) == 0):
    print("NA")
elif int(tmp) > 12 and 0 < int(tmp2):
    print("YYMM")
elif int(tmp) > 0 and int(tmp2) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    head2 = int(S[:2])
    tail2 = int(S[2:])
    head_is_mm = False
    if 1 <= head2 <= 12:
        head_is_mm = True
    tail_is_mm = False
    if 1 <= tail2 <= 12:
        tail_is_mm = True
    result = 'NA'
    if head_is_mm and head_is_mm:
        result = 'AMBIGUOUS'
    elif head_is_mm:
        result = 'MMYY'
    elif tail_is_mm:
        result = 'YYMM'
    print(result)


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=int(input())
a=S%100
b=(S-a)/100
if 1<=a<=12:
  if 1<=b<=12:
    print('AMBIGUOUS')
  elif 13<=b<=99:
    print('YYMM')
  else:
    print('NA')
elif 13<=a<=99:
    if 1<=b<=12:
      print('MMYY')
    else:
      print('NA')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
def ismonth(month):
    return 0 < month < 13


S = input()

former = int(S[:2])
latter = int(S[2:])

if not (ismonth(former) and ismonth(latter)):
    ans = "NA"

elif ismonth(former) and ismonth(latter):
    ans = "AMBIGUOUS"

elif ismonth(former):
    ans = "MMYY"

elif ismonth(latter):
    ans = "YYMM"

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

s = input()


before = int(s[0:2])
after = int(s[2:4])

before_year = False
after_year = False
before_m = False
after_m = False

if before > 12:
    before_year = True
else: before_m = True

if after > 12:
    after_year = True
else: after_m = True

if before==0 or after==0:
    print('NA')
elif before_year==True and after_year==True:
    print('NA')
elif before_m==True and after_m==True:
    print('AMBIGUOUS')
elif before_year==True and after_m==True:
    print('YYMM')
elif before_m==True and after_year==True:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

if 0 < AA and AA <= 12 and 12 < BB:
    print('MMYY')
elif 0 < BB and BB <= 12 and 12 < AA:
    print('YYMM')
elif AA <= 12 and BB <= 12 and ((AA != 0 and BB == 0) or (BB != 0 and AA == 0) or (AA != 0 and BB != 0)):
    print('AMBIGUOUS')
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 or n2m:
    print(s)
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = list(input())

a, b = int(str(''.join(S[:2]))), int(str(''.join(S[2:])))
if a == 0 and b == 0:
  print('NA')
elif a == 0 and b <= 12:
  print('YYMM')
elif a <= 12 and b == 0:
  print('MMYY')
elif a <= 12 and b <= 12:
  print('AMBIGUOUS')
elif a <= 12 and b > 12:
  print('MMYY')
elif a > 12 and b <= 12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
mm = ['01','02','03','04','05','06','07','08','09','10','11','12']
s = input()
a,b = s[:2], s[2:]

if a == '00' or b == '00':
    print('NA')
elif a in mm and b in mm:
    print('AMBIGUOUS')   
elif a in mm:
    print('MMYY')
else:
    print('YYMM')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[:2])
b = int(S[2:])
if 0 < a < 13:
    if 0 < b < 123:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 0 < b < 13:
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

fst = int(s[0:2])
snd = int(s[2:4])

if fst > 12 or fst == 0 and snd <= 12 and 0 < snd:
    print("YYMM")
elif snd > 12 or snd == 0 and fst <= 12 and 0 < fst:
    print("MMYY")
elif fst <= 12 and snd <= 12 and 0 < fst and 0 < snd:
    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 'MMYY'
	if a>12 and b<=12 :
		return 'YYMM'
	return 'AMBIGUOUS'

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
input_int = lambda:int(input())
input_ints = lambda:map(int,input().split())
input_ints_list = lambda:list(input_ints())
input_str = lambda:input()
input_strs = lambda:input().split()
input_lines = lambda n,input_func:[input_func() for _ in range(n)]

import importlib
import_module = lambda module_name:importlib.import_module(module_name)

init_array_1dim = lambda value,n:[value]*n # 1次元配列を生成
init_array_2dim = lambda value,n,m:[init_array_1dim(value,n) for _ in range(m)] # 2次元配列を生成

gcd_base = lambda value1,value2:import_module('fractions').gcd(value1,value2) # 最大公約数（2値)
gcd = lambda lst:import_module('functools').reduce(gcd_base,lst) # 最大公約数（リスト）
lcm_base = lambda value1,value2:(value1*value2)//gcd_base(value1,value2) # 最小公倍数(2値)
lcm = lambda lst:import_module('functools').reduce(lcm_base,lst,1) # 最小公倍数(リスト)

permutations = lambda lst,n:import_module('itertools').permutations(lst,n) # 順列
combinations = lambda lst,n:import_module('itertools').combinations(lst,n) # 組み合わせ
product = lambda lst1,lst2:import_module('itertools').product(lst1,lst2) # 二つのリストの直積

round = lambda value:round(value) # 四捨五入
ceil = lambda value:import_module('math').ceil(value) # 切り上げ
floor = lambda value:import_module('math').floor(value) # 切り捨て

# キュー
init_q = lambda lst: import_module('collections').deque(lst)
q_pop = lambda q: q.popleft() # 先頭から取り出し
q_push = lambda q,value:q.appendleft(value) # 先頭に追加（値）
q_pushlist = lambda q,lst:q.extendleft(lst) # 先頭に追加（リスト）
q_append = lambda q,value:q.append(value) # 末尾に追加（値）
q_appendlist = lambda q,lst:q.extend(lst) # 末尾に追加（リスト）

# プライオリティキュー
init_heap = lambda a:import_module('heapq').heapify(a)
heap_push = lambda a,v:import_module('heapq').heappush(a,v)
heap_pop = lambda a:import_module('heapq').heappop(a) # 最小値を取り出す

def solution():
    # ここに実装
    S = input_str()

    month_1 = False
    if '01'<=S[:2]<='12':month_1 = True
    month_2 = False
    if '01'<=S[2:]<='12':month_2 = True
    
    if month_1 and month_2:
        print('AMBIGUOUS')
        return
    if month_1:
        print('MMYY')
        return
    if month_2:
        print('YYMM')
        return
    print('NA')

if __name__ == '__main__':
    solution()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = list(input())

A = int("".join(s[:2]))
B = int("".join(s[2:]))

if A <= 12 and B <= 12 and A >= 1 and B >= 1:
    print('AMBIGUOUS')
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())

if S>1200 and S%100>12:
    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 = int(input())
a = S//100
b = S%100
isyymm = 0
ismmyy = 0
if a>0 and b>0:
    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()
p = S[0:2]
q = S[2:4]

p = int(p)
q = int(q)

p_year_flag = 0
p_month_flag = 0
q_year_flag = 0
q_month_flag = 0

if 1 <= p and p <= 12:
    p_month_flag = 1

if 1 <= p and p <= 99:
    p_year_flag = 1
    
if 1 <= q and q <= 12:
    q_month_flag = 1
    
if 1 <= q and q <= 99:
    q_year_flag = 1

YYMM_flag = 0
MMYY_flag = 0

if p_year_flag == 1 and q_month_flag == 1:
    YYMM_flag = 1
if p_month_flag == 1 and q_year_flag == 1:
    MMYY_flag = 1
    
if YYMM_flag == 1 and MMYY_flag == 1:
    print('AMBIGUOUS')
    
elif YYMM_flag == 1:
    print('YYMM')
    
elif MMYY_flag == 1:
    print('MMYY')
    
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
H, L = map(int, [S[0:2], S[2:4]])

if H > 12 and (12 >= L >= 1):
    print('YYMM')
elif L > 12 and (12 >= H >= 1):
    print('MMYY')
elif (12 >= L >= 1) and (12 >= H >= 1):
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()


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

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

Submission status: Wrong Answer

Solution code:
s = input()
fir = int(s[:2])
sec = int(s[2:])

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

Submission status: Wrong Answer

Solution code:
s = input()

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

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()
u = int(s[0] + s[1])
l = int(s[2] + s[3])

if l == 0 or u == 0:
    print('NA')

elif 0 < l and l < 13:

    if 0 < u and u < 13:
        print('AMBIGUOUS')
    else:
        print("YYMM")


elif 0 < u and u < 13:
    print("MMYY")

Submission status: Wrong Answer

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

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 and bb <= 12:
    print("YYMM")
elif ff <= 12 and bb > 12:
    print("MMTT")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
x=input()
aa=x[:2]
bb=x[3:]
aa=int(aa)
bb=int(bb)
if 0<aa<=12 and 0<=bb<=12:
	print("MMYY")
if 0<=aa<=12 and 0<bb<=12:
	print("YYMM")
if 0<aa<=12 and 0<bb<=12:
	print("AMBIGUOUS")
elif 0<aa<=12:
	print("MMYY")
elif 0<bb<=12:
	print("YYMM")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

AA = int(S[:2])
BB = int(S[2:])

if 0 < AA and AA <= 12 and 12 < BB:
    print('MMYY')
elif 0 < BB and BB <= 12 and 12 < AA:
    print('YYMM')
elif AA <= 12 and BB <= 12 and (AA != 0 and BB == 0) or (BB != 0 and AA == 0) or (AA != 0 and BB != 0):
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

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



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

Submission status: Wrong Answer

Solution code:
a=input()
a=[i for i in a]
x=int(a[0]+a[1])
y=int(a[2]+a[3])
cy=0
cm=0
if 0<x<=13 and y<=19:
    cm+=1
if x<=19 and 0<y<=13:
    cy+=1
if cy==1:
    if cm==1:
        print("AMBIGUOUS")
    else:
        print("YYMM")
elif cm==1:
    print("MMYY")
else:
    print("NA")

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 13 <= latter <= 99:
  print('MMYY')
elif 13 <= former <= 99 and 1 <= latter <= 12:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S = list(input())

res = 'NA'
bf = (int(S[0])) * 10 + int(S[1])
af = (int(S[2])) * 10 + int(S[3])

if  0 <= bf and  0 < af < 13:
      res = 'YYMM'
      
if  0 < bf < 13 and  0 < af:
    if res == 'YYMM':
      res = 'AMBIGUOUS'
      
    else:
      res = 'MMYY'
      
print(res)

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

Submission status: Wrong Answer

Solution code:
s = s=input()
left = int(s[:2])
right = int(s[2:])

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

Submission status: Wrong Answer

Solution code:
S = input()

S1 = S[0:2]
S2 = S[2:4]

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

def is_YY(s):
  if 1 <= int(s) <= 99:
    return(True)
  else:
    return(False)

if (not is_MM(S1) and not is_YY(S1)) or (not is_MM(S2) and not is_YY(S2)):
  print("NA")
elif is_YY(S1) and is_MM(S1) and is_YY(S2) and is_MM(S2):
  print("AMBIGUOUS")
elif is_YY(S1) and is_MM(S2):
  print("YYMM")
elif is_YY(S2) and is_MM(S1):
  print("MMYY")

Submission status: Wrong Answer

Solution code:
S = int(input())

f = S//1000*10 + S//100%10
b = S%100//10 + S%10
ans = ''
if (1<= f and f <= 12) and (1<= b and b <= 12):
    ans = 'AMBIGUOUS'
elif (1<=b and b <= 12):
    ans = 'YYMM'
elif (1<=f and f <= 12):
    ans = 'MMYY'
else:
    ans = 'NA'
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
YY = int(S[0:2])
MM = int(S[3:4])

if 0 < YY <= 12 and 0 < MM <= 12:
    print("AMBIGUOUS")
elif 0 <= YY <= 99 and 0 < MM <= 12:
    print("YYMM")
elif 0 < YY <= 12 and 0 <= MM <= 99:
    print("MMYY")
else:
	print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 2019/05/19
# AtCoder Beginner Contest 126 - B

# Input
s = input()

# Calc
mae = int(s[0] * 10) + int(s[1])
ato = int(s[2] * 10) + int(s[3])

if (mae < 1 or mae > 12) and (ato < 1 or ato > 12):
    ans = "NA"
elif (mae >= 1 and mae <= 12) and (ato >= 1 and ato <= 12):
    ans = "AMBIGUOUS"
else:
    if (mae >= 1 and mae <= 12):
        ans = "MMYY"
    else:
        ans = "YYMM"

# Output
print(ans)

Submission status: Wrong Answer

Solution code:
def solve():
    S = [int(_) for _ in raw_input()]
    S12 = S[0] * 10 + S[1]
    S34 = S[2] * 10 + S[3]
    YYMM = False
    MMYY = False
    if S34 >= 1 and S34 <= 12:
        YYMM = True
    if S12 >= 1 and S12 <= 12:
        MMYY = True
    if YYMM:
        if MMYY:
            ret = 'AMBIGUOS'
        else:
            ret = 'YYMM'
    else:
        if MMYY:
            ret = 'MMYY'
        else:
            ret = 'NA'
    print ret

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
S = input()

if 0 < int(S[0:2]) < 99 and 0 < int(S[2:4]) < 13:
    if 0 < int(S[2:4]) < 99 and 0 < int(S[0:2]) < 13:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif 0 < int(S[2:4]) < 99 and 0 < int(S[0:2]) < 13:
    if 0 < int(S[0:2]) < 99 and 0 < int(S[2:4]) < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
#	!/usr/bin/env python3
#	encoding: UTF-8
#	Modified: <19/May/2019 05:43:53 PM>


#	✪ H4WK3yE乡
#	Mohd. Farhan Tahir
#	Indian Institute Of Information Technology (IIIT), Gwalior


import sys


def get_array(): return list(map(int, sys.stdin.readline().split()))


def get_ints(): return map(int, sys.stdin.readline().split())


def input(): return sys.stdin.readline().strip()


def main():
    s = input()
    a = int(s[:2])
    b = int(s[2:])
    if (a > 12 and b > 12) or (a > 12 and b == 0) or (a == 0 and b > 12):
        print('NA')
        return

    if a == 0 and b <= 12 and b > 0:
        print("YYMM")
        return
    if b == 0 and a <= 12 and a > 0:
        print("MMYY")
        return

    if a <= 12 and b <= 12:
        print('AMBIGUOUS')
        return

    if a <= 12 and a != 0:
        print("MMYY")
        return
    if b <= 12 and b != 0:
        print("YYMM")
        return
    print('NA')


if __name__ == "__main__":
    main()

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")
elif x>=13 and y==0:
    print("NA")
elif x==0 and y>=13:
    print("NA")
elif x>=13 and y>=13:
    print("NA")
elif x<=12 and y<=12:
    print("AMBIGUOUS")
elif 1<=x<=12 :
    print("MMYY")
elif 1<=y<=12:
    print("YYMM")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s_in=input()
fore=int(s_in[:2])
aft=int(s_in[2:])

if 1<=fore<=12:
    if 1<=fore<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1<=aft<=12:
        print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
v = input()
h = int(v[0:2])
t = int(v[2:4])
if h == 0 or t == 0:
    print('NA')
elif h > 12:
    if t > 12:
        print('NA')
    else:
        print('YYMM')
else:
    if t > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!python3
import sys

def main():
    s = input()

    head = int(s[:2])
    tail = int(s[2:])

    if head <= 0 or tail <= 0:
        print('NA')
    elif head <=12 and tail <= 12:
        print('AMBIGUOUS')
    elif head <= 12:
        print('MMYY')
    elif tail <= 12:
        print('YYMM')
    else:
        print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#B問題
S =input()
if "00" < S[0:2] <="12" and "13" <= S[2:4] <= "99":
    print("MMYY")
elif "13" <= S[0:2] <= "99" and "00" <S[2:4] <= "12":
    print("YYMM")
elif "00" < S[0:2] <= "12" and "00" < S[2:4] <= "12":
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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")
else:
    if y > 12:
        print("MMYY")
    elif y >= 1:
        print("AMBIGUOUS")
    else:
        print("MMYY")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def is_day(n):
    return n <= 31 and n >= 1

def is_month(n):
    return n <= 12 and n >= 1

s = input()

f, e = s[:2], s[2:]

e_is_month = False
f_is_month = False

if is_month(int(f)):
    f_is_month = True

if is_month(int(e)):
    e_is_month = True

if not f_is_month and e_is_month:
    if is_day(int(f)):
        print("YYMM")
    else:
        print("NA")
elif f_is_month and not e_is_month:
    if is_day(int(e)):
        print("MMYY")
    else:
        print("NA")
else:
    if e_is_month and f_is_month:
        print("AMBIGUOUS")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
s = input()


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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = list(input())
a = int(S[0])*10 + int(S[1])
b = int(S[2])*10 + int(S[3])
flag1 = True
flag2 = True
if a > 13 or a == 0:
    flag1 = False
if b > 13 or b == 0:
    flag2 = False
if flag1 and flag2:
    print("AMBIGUOUS")
elif flag1 and not flag2:
    print("MMYY")
elif not flag1 and flag2:
    print("YYMM")
else:
    print("NA")