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:
# -*- 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('AMBIGUOUS')
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()
a,b = int(S[:2]), int(S[2:])
if a > 12 and b <= 12 and b != 0:
  print('YYMM')
elif a <= 12 and b > 12 and a != 0:
  print('MMYY')
elif a <= 12 and b <= 12 and a != 0  and b != 0:
  print('AMBIGUOUS')
else:
  print('NA')

Submission status: Wrong Answer

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

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

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

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 b > 0 and a > 0:
  print("MMYY")
elif b<=12 and b> 0 and a> 0:
  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 or BB) != 0:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
if int(S[:2]) == 0 or int(S[2:]) == 0:
    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:
import itertools
import math

def judY(y):
    if  0<y and y < 20:
        return True
    else:
        return  False

def judM(m):
    if  0<m and m <=12:
        return True
    else:
        return  False



s1 = input()
zenhan = int (s1[0:2])
kohan  = int(s1[2:])

zenhanY = False
zenhanM = False
kohanY = False
kohanM = False
if judY(zenhan):
    zenhanY = True

if judM(zenhan):
    zenhanM = True

if judM(kohan):
    kohanM = True

if judY(kohan):
    kohanY = True


YYMM = False
MMYY = False
if zenhanY and kohanM:
    YYMM = True

if zenhanM and kohanY:
    MMYY = True

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

Submission status: Wrong Answer

Solution code:
S=int(input())
A=S//100
B=S%100
#print(A,B)

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = input()

left = S[0:2]
right = S[2:4]
if left[0] == "0": left = left[1]
if right[0] == "0":right = right[1]
left, right = int(left), int(right)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
order = input()
pre = order[:2]
back = order[2:]

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

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("AMBIGUOUS")
elif top > 12:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
S = list(input())

a, b = int(str(''.join(S[:2]))), int(str(''.join(S[2:])))
if a == 0 or b == 0:
  print('NA')
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:
s = input()

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

if fst > 12 and snd <= 12 and 0 < snd:
    print("YYMM")
elif snd > 12 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:
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("MMYY")
elif B<=12 and A>12:
    print("YYMM")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s1 = s[0] * 10 + s[1]
s2 = s[2] * 10 + s[3]

ans = 0
if (1 <= s1 <= 12 and 1 <= s2 <=99):
    ans += 1
if (1 <= s2 <= 12 and 1 <= s1 <=99):
    ans += 2

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

Submission status: Wrong Answer

Solution code:
S = input()

mae = S[0:2]
ush = S[2:4]

mon = {"01","02","04","05","06","07","08","09","10","11","12"}

if (mae in mon) and (ush in mon):
    print("AMBIGUOUS")
if (mae not in mon) and (ush in mon):
    print("YYMM")
if (mae in mon) and (ush not in mon):
    print("MMYY")
if (mae not in mon) and (ush not in mon):
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = 0
b = 0
if S[0] == 0:
    a = int(S[1])
else:
    a = int(S[0:2])
if S[2] == 0:
    b = int(S[3])
else:
    b = int(S[2:])
    
fa = ''
fb = ''
    
if a == 0:
    fa = 'n'
elif a <= 12:
    fa = 'm'
else:
    fa = 'y'
    
if b == 0:
    fb = 'n'
elif b <= 12:
    fb = 'm'
else:
    fb = 'y'
    
if fa == 'm' and fb == 'y':
    print('MMYY')
elif fa == 'y' and fb == 'm':
    print('YYMM')
elif fa == 'm' and fb == 'm':
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

S = input()

a = int(S[:2])
b = int(S[2:])
#print(a,b)

am = ay = bm = by = False
if 1 <= a <= 12:
    am = True
if 1 <= b <= 12:
    bm = True
if a != 0:
    ay = True
if b != 0:
    by = True

#print(am,ay,bm,by)

if am and bm and ay and by:
    print('AMBIGUOUS')
elif am and by:
    print('MMYY')
elif bm and ay:
    print('YYMM')
else:
    print('NA')

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if 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]) == 0:
    print("NA")
elif int(S[0]+S[1]) == 0 and int(S[2]+S[3]) > 12:
    print("NA")
elif int(S[0]+S[1]) > 12:
    print("YYMM")
elif int(S[2]+S[3]) > 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:

s = input()
mae = int(s[:2])
ato = int(s[2::])

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

Submission status: Wrong Answer

Solution code:
S = input()
suuji = int(S)

mae = suuji // 100
ushiro = suuji % 100

if mae == 0 or ushiro == 0:
    print("NA")
else:
    if mae <= 12:
        if ushiro <= 12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if ushiro <= 12:
            print("YYMM")
        else:
            print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  s=S()
  a=s[:2]
  b=s[2:]
  if a=='00' or int(b)>12:
    print('NA')
  elif int(a)>12 and b=='00':
    print('NA')
  elif int(a)>12 and int(b)>12:
    print('NA')
  elif int(a)<=12 and int(b)>12:
    print('MMYY')
  elif int(a)>12 and int(b)<=12:
    print('YYMM')
  else:
    print('AMBIGUOUS')

main()
# print(main())

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

X = [x for x in input()]
A = int(''.join(X[:2]))
B = int(''.join(X[2:]))

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

Submission status: Wrong Answer

Solution code:
s = input()

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

def isYear(x):
    return x > 0

def isMonth(x):
    return x > 0 and x <= 12

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

Submission status: Wrong Answer

Solution code:
S = input()
A = S[:2]
B = S[2:]
if A[0] == "0":
    A = A[1]

if B[0] == "0":
    B = B[1]

A = int(A)
B = int(B)

if A > 0 and B > 0:
    if A < 13 and B < 13:
        ans = "AMBIGUOUS"
    else:
        if A > 12:
            ans = "YYMM"
        else:
            ans = "MMYY"
else:
    ans = "NA"

print(ans)

Submission status: Wrong Answer

Solution code:
#B問題
S=list(str(input()))
mae=S[0]+S[1]
ato=S[2]+S[3]
intmae=int(mae)
intato=int(ato)
if intmae >= 13 and intato >= 13:
    print("NA")
elif intmae <= 12 and intato <= 12:
    if intmae > 0 and intato > 0:
        print("AMBIGUOUS")
    elif intmae == 0:
        print("YYMM")
    else:
        print("MMYY")
else:
    if intmae <= 12:
        if intmae != 0:
            print("MMYY")
        else:
            print("NA")
    else:
        if intato != 0:
            print("YYMM")
        else:
            print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = input()
zenhan = int(S[:2])
kouhan = int(S[2:])
if zenhan == 0 or kouhan == 0:
    print('NA')
elif zenhan > 12 and kouhan > 12:
    print('NA')
elif zenhan <= 12 and kouhan <= 12:
    print('AMBIGUOUS')
elif zenhan <= 12 and kouhan > 12:
    print('MMYY')
elif zenhan > 12 and kouhan <= 12:
    print('YYMM')

Submission status: Wrong Answer

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

if l==0 or r==0:
    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 = int(input())
sd = s%100
su = s//100
if sd > 14 or sd == 0 :
    if su > 14 or su == 0:
        print("NA")
    else :
        print("MMYY")
else :
    if su > 14 or su == 0 :
        print("YYMM")
    else :
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
read = input
s = read()
a, b = map(int , [s[:2], s[3:]])
YYMM = False
MMYY = False
if 1 <= b and b <= 12:
    YYMM = True
if 1 <= a and a <= 12:
    MMYY = True
if YYMM and MMYY :
    print('AMBIGUOUS')
elif YYMM and not MMYY:
    print('YYMM')
elif not YYMM and MMYY:
    print('MMYY')
else :
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def YY(a):
    if a != 0:
        return True
    else: return False

def MM(a):
    if 0 < a <13:
        return True
    else:
        return False

if MM(a) and YY(b):
    if YY(a) and MM(b):
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif YY(a) and MM(b):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
a = S[0:2]
b = S[2:4]
print(a)
print(b)


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


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

Submission status: Wrong Answer

Solution code:
S = list(input())

p = S[0]+S[1]
q = S[2]+S[3]
if int(p)*int(q) == 0:
    print('NA')
    exit()
if int(p) > 12:
    if int(q) > 12:
        print('NA')
    else:
        print('YYMM')
else:
    if int(q) > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
zenhan = int(s[0:2])
kouhan = int(s[2:])

if zenhan > 12:
    if kouhan > 12 or kouhan==0:
        print("NA")
    else:
        print("YYMM")
elif zenhan==0:
    print("NA")
else:
    if kouhan > 12:
        print("MMYY")
    elif kouhan ==0:
        print("NA")
    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = (input())
L1 = int((S[0:2]))
L2 = int(S[2:4])
if L1 == 0 or L2 == 0:
    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:
        ans = 'AMBIGUOUS'
print(ans)

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

Submission status: Wrong Answer

Solution code:
#	!/usr/bin/env python3
#	encoding: UTF-8
#	Modified: <19/May/2019 05:39:47 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:
        print('AMBIGUOUS')
        return
    if a > 12 and b > 12:
        print("NA")
        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 = 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')
else:
    print('YYMM')

Submission status: Wrong Answer

Solution code:

S = input()

a = int(S[0]+S[1])
b = int(S[2]+S[3])

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

Submission status: Wrong Answer

Solution code:
S = input()

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

f1 = 0
f2 = 0
if s1 in range(1, 13) and s2 != 0:
    f1 = 1

if s2 in range(1, 13) and s1 != 0:
    f2 = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))

INF = 1<<29

S = input()

def main():
    FS  = int(S[:2])
    LS = int(S[2:])
    can_yymm = True
    can_mmyy = True
    if FS <= 0:
        return "NA"
    if FS > 12:
        can_mmyy =False
    if LS <= 0:
        return "NA"
    if LS > 12:
        can_yymm =False
    if can_yymm and can_mmyy:
        return "AMBIGUOUS"
    if can_yymm:
        return "YYMM"
    if can_mmyy:
        return "MMYY"
    return "NA"
print(main())

Submission status: Wrong Answer

Solution code:
# coding:utf-8

import math
import re

def main(params):
    n = list(params[0])
    print n
    f = n[0] + n[1]
    s = n[2] + n[3]

    try:
        if (int(f) >= 1 and int(f) <= 12) and (int(s) == 0 or int(s) > 12):
            print "MMYY"
        elif (int(f) >= 1 and int(f) <= 12) and (int(f) >= 1 and int(f) <= 12):
            print "AMBIGUOUS"
        elif (int(s) >= 1 and int(s) <= 12) and (int(f) == 0 or int(f) > 12):
            print "YYMM"
        else:
            print "NA"
    except:
        print "NA"

if __name__ == "__main__":
    cnt = 1 # TODO: edit here
    params = []
    for i in range(cnt):
        param = raw_input()
        params.append(param)
    main(params)

Submission status: Wrong Answer

Solution code:
S=input()
n1,n2=int(S[:2]),int(S[2:])
isy=lambda n: n>0
ism=lambda n: n<13 and n>0
isyymm = (isy(n1) and ism(n2))
ismmyy = (ism(n1) and isy(n2))

if isyymm and ismmyy:
    print("AMBIGUOUS")
elif isyymm:
    print("YYMM")
elif ismmyy:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

s = input()
isUshiroMM = False
if (int(s[2:]) != 0 and int(s[2:]) < 13):
    isUshiroMM = True
isMaeMM = False
if (int(s[0:3]) != 0 and int(s[0:3]) < 13):
    isMaeMM = True
if (isMaeMM):
    if (isUshiroMM):
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if (isUshiroMM):
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    s = int(input())
    y, m = s // 100, s % 100
    if y == 0 or m == 0:
        print('NA')
    elif y > 12:
        print('YYMM')
    elif m > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

def main():
    buf = input()
    S = buf
    first = int(S[0:2])
    second = int(S[2:4])
    if first == 0 or second == 0:
        print('NA')
        return
    elif 1 <= first and first <= 12:
        if 1 <= second and second <= 12:
            print('AMBIGUOUS')
            return
        else:
            print('MMYY')
            return
    elif 1 <= second and second <= 12:
        print('YYMM')
        return
    else:
        print('NA')
        return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()

if '01' <= S[0:2] <= '12' and (S[2:4] >= '13' or S[2:4] == '00'):
    print('MMYY')
elif '01' <= S[2:4] <= '12' and S[0:2] >= '13' or S[0:2] == '00':
    print('YYMM')
elif '01' <= S[0:2] <= '12' and '01' <= S[2:4] <= '12':
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# 入力が10**5とかになったときに100ms程度早い
import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


S = read()[:-1]

flg1, flg2 = False, False

first = int(S[:3])
last = int(S[3:])

if 0 < first < 13:
    flg1 = True

if 0 < last < 13:
    flg2 = True

if flg1 and flg2:
    print('AMBIGUOUS')
elif flg1 and not flg2:
    print('MMYY')
elif flg2 and not flg1:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
s = [s[0:2], s[2:4]]

if int(s[0]) > 12 and 1 <= int(s[1]) <= 12:
    print('YYMM')
elif int(s[1]) > 12 and 1 <= int(s[0]) <= 12:
    print('MMYY')
elif 1 <= int(s[0]) <= 12 and 1 <= int(s[1]) <= 12:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
pre = int(S[:2])
post = int(S[2:])
preM = pre > 0 and pre < 13
postM = post > 0 and pre < 13
if preM and postM:
  print('AMBIGUOUS')
elif preM:
  print('MMYY')
elif postM:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = list(input())
for i in range(len(s)):
    s[i] = int(s[i])

def f(x,y):
    if x == 0:
        if y == 0:
            return -1
        return 1
    elif x == 1:
        if y <= 2:
            return 1
    return 0

fi = f(s[0],s[1])
se = f(s[2],s[3])

if fi < 0 or se < 0:
    print('NA')
elif fi == 0:
    if se == 0:
        print('NA')
    else:
        print('YYMM')
elif se == 0:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

x, y = int(S[:2]), int(S[2:])
if 1 <= x <= 12 and 1 <= x <= 12:
    print('AMBIGUOUS')
elif 1 <= x <= 12 and 1 <= y:
    print('MMYY')
elif 1 <= y <= 12 and 1 <= x:
    print('YYMM')
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 a <= 12 and 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()
le = int(S[0:2])
ri = int(S[2:4])
if le == 0 or ri == 0:
  print("NA")
elif le <= 12 and ri <= 12:
  print("AMBIGUOUS")
elif le <= 12:
  print("MMYY")
elif ri <= 12:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
S = input()

if S[0:2] > "12":
    if "01" <= S[2:4] <= "12":
        print("YYMM")
    else:
        print("NA")

elif "01" <= S[0:2] <= "12":
    if "01" <= S[2:4] <= "12":
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
n = int(input())
a = n//100
b = n%100
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:
s=input()
a=int(s[:2])
b=int(s[2:])
if 0<a<=12 and 0<b<=12:
    print("AMBIGUOUS")
elif 0<a<=12 and 0<b:
    print("MMYY")
elif 0<b<=12 and 0<a:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S=input()

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

if(f==0 or l==0):
	print("NA")
	exit()


if(f>12 and l<=12):#年はありえない
	print("YYMM")
if(f<=12 and l>12):
	print("MMYY")
if(f<=12 and l<=12):
	print("AMBIGUOUS")
if(f>12 and l>12):
	print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
mae = int(S[:2])
ushiro = int(S[-2:])

if mae == 0 or ushiro == 0:
    print("NA")
else:
    if mae > 12:
        # YYMM
        if ushiro > 12:
            print("NA")
        else:
            print("YYMM")
    else:
        # MMYY
        if ushiro < 13:
            print("AMBIGUOUS")
        else:
            print("MMYY")

Submission status: Wrong Answer

Solution code:
S=input()

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:
x=input()
aa=x[:2]
bb=x[3:]
aa=int(aa)
bb=int(bb)
if aa<=12 and bb<=12:
	print("AMBIGUOUS")
elif aa<=12:
	print("MMYY")
elif bb<=12:
	print("YYMM")
else:
	print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
f1, f2 = False, False
if int(s[3:]) < 13 and int(s[3:]) > 0:
  f1 = True
if int(s[:2]) < 13 and int(s[:2]) > 0:
  f2 = True
if not f1 and not f2:
  print("NA")
elif f1 and f2:
  print("AMBIGUOUS")
elif f1:
  print("YYMM")
else:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  s=S()
  a=s[:2]
  b=s[2:]
  if a=='00' or b=='00':
    print('NA')
  elif int(a)>12 and int(b)>12:
    print('NA')
  elif int(a)<=12 and int(b)>12:
    print('MMYY')
  elif int(a)>12 and int(b)<=12:
    print('YYMM')
  else:
    print('AMBIGUOUS')

main()
# print(main())