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:
#B
s = list(input())
left = int(s[0])*10+int(s[1])
right = int(s[2])*10+int(s[3])
print(left,right)
if 0 < left <= 12:
    if 0 < right <= 12:
        print("AMBIGUOUS")
    else:
        print('MMYY')
elif 0 < right <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
if (s[0]=="0" and s[1]!="0") or (s[0]=="1" and int(s[1])<=2):
    if (s[2]=="0" and s[3]!="0") or (s[2]=="1" and int(s[3])<=2):
        print("AMBIGOUS")
    else:
        print("MMYY")
elif (s[2]=="0" and s[3]!="0") or (s[2]=="1" and int(s[3])<=2):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
if (s[0]=="0" and s[1]!="0") or (s[0]=="1" and int(s[1])<=2):
    if (s[2]=="0" and s[1]!="0") or (s[2]=="1" and int(s[3])<=2):
        print("AMBIGOUS")
    else:
        print("MMYY")
elif (s[2]=="0" and s[3]!="0") or (s[2]=="1" and int(s[3])<=2):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

upper = int(s[:2])
lower = int(s[2:4])

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

Submission status: Wrong Answer

Solution code:
s = input()

upper = int(s[:2])
lower = int(s[2:4])

if upper > 12:
    if lower > 12 or lower <= 0: print('NA')
    else: print('YYMM')
elif upper <= 0:
    if lower <= 12: print('YYMM')
    else: print('NA')
else:
    if lower > 12: print('MMYY')
    else: print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()

upper = int(s[:2])
lower = int(s[2:4])

if upper > 12:
    if lower > 31 or lower <= 0: print('NA')
    else: print('YYMM')
elif upper <= 0:
    if lower <= 31: print('YYMM')
    else: print('NA')
else:
    if lower > 12: print('MMYY')
    else: print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()

upper = int(s[:2])
lower = int(s[2:4])

if upper > 12:
    if lower > 31 or lower <= 0: print('NA')
    else: print('YYMM')
elif upper <= 0:
    if lower <= 31: print('YYMM')
    else: print('NA')
else:
    if lower > 31: print('MMYY')
    else: print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()

upper = int(s[:2])
lower = int(s[2:4])

if upper > 12:
    if lower > 31 or lower <= 0: print('NA')
    else: print('YYMM')
else:
    if upper <= 0: print('NA')
    elif lower > 31: print('MMYY')
    else: print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()

upper = int(s[:2])
lower = int(s[2:4])

if upper <= 0 or lower <= 0:
    print('NA')
    exit()

if upper > 12:
    if lower > 31: print('NA')
    else: print('YYMM')
else:
    if lower > 31: print('MMYY')
    else: print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()

upper = int(s[:2])
lower = int(s[2:4])

if upper == 0 or lower == 0:
    print('NA')
    exit()

if upper > 12:
    if lower > 31: print('NA')
    else: print('YYMM')
else:
    if lower > 31: print('MMYY')
    else: print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = int(input())

f = S // 100
b = S % 100

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

Submission status: Wrong Answer

Solution code:
s = input()

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

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

Submission status: Wrong Answer

Solution code:
s = input()

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

print(a,b)

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

Submission status: Wrong Answer

Solution code:
s = input()

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

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

Submission status: Wrong Answer

Solution code:
y=["01","02","03","04","05","06","07","08","09","10","11","12"]
s=input()
if s[:1] in y:
  if s[2:] in y:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if s[2:] in y:
    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 b > 12:
    print("MMYY")
  else:
    print("NA")
elif a > 12:
  if 1 <= b <= 12:
    print("YYMM")
  else:
    print("NA")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

former = S[:2]
later = S[2:]

if int(later) == 0 or int(former) == 0:
    print('NA')
elif int(former) < 13 and int(later) < 13:
    print('AMBIGUOUS')
elif int(former) > 12 and int(later) < 13:
    print('YYMM')
elif int(former) < 13 and int(later) > 12:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

former = S[:2]
later = S[2:]

if int(later) == 0 or int(former) == 0:
    print('NA')
elif int(former) > 12 and int(later) < 13:
    print('YYMM')
elif int(former) < 13 and int(later) > 12:
    print('MMYY')
elif int(former) < 13 and int(later) < 13:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s= str(input())
s1, s2, s3, s4 = [int(i) for i in s]
if (s1 == 0 and 1 <= s2 and s2 <= 9) or (s2 == 1 and 0 <= s2 and s2 <= 2):
    if (s3 == 0 and 1 <= s4 and s4 <= 9) or (s3 == 1 and 0 <= s4 and s4 <= 2):
        print("AMBIGUOUS")
    
    else:
        print("MMYY")
else:
    if (s3 == 0 and 1 <= s4 and s4 <= 9) or (s3 == 1 and 0 <= s4 and s4 <= 2):
        print("YYMM")
    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7


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

a = (1 <= int(s[:2]) <= 12)
b = (1 <= int(s[2:]) <= 12)

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7


s = input()
if s[:2] == '00' or s[2:] == '00':
    print('NA')
    exit()
    
a = (1 <= int(s[:2]) <= 12)
b = (1 <= int(s[2:]) <= 12)

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

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    up = int(s[0:2])
    lo = int(s[-2:])
    if can_month(up):
        if can_month(lo):
            print('AMBIGUOUS')
        else:
            print('MMYY')

    else:
        if can_month(lo):
            print('YYMM')
        else:
            print('AMBIGUOUS')


def can_month(v):
    if v > 0 and v <= 12:
        return True
    else:
        return False

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!="00":
  print("AMBIGUOUS")

elif int(af)<=12:
  if af=="00" and int(be)<=12:
    print("MMYY")
  else:
    print("YYMM")
    
elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
  
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!="00":
  print("AMBIGUOUS")

elif int(af)<=12:
  if af=="00":
    print("NA")
  else:
    print("YYMM")
    
elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
  
else:
  print("NA")

Submission status: Wrong Answer

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

if 0<S[0]*10+S[1]<=12 and 0<S[2]*10+S[3]<=12:
    print('AMBIGUOUS')
elif 0<S[0]*10+S[1]<=12 and S[2]*10+S[3]>=13:
    print('MMYY')
elif 0<S[2]*10+S[3]<=12 and S[0]*10+S[1]>=13:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12:
  print("AMBIGUOUS")

elif int(af)<=12:
  if af=="00":
    print("NA")
  else:
    print("YYMM")
    
elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
  
else:
  print("NA")

Submission status: Wrong Answer

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

if (S[0]==0 and S[2]==0) or (S[0]==0 and S[2]==1 and S[3]<=2) or (S[2]==0 and S[0]==1 and S[1]<=2):
    print('AMBIGUOUS')
elif 0<S[0]*10+S[1]<=12 and S[2]*10+S[3]>=13:
    print('MMYY')
elif 0<S[2]*10+S[3]<=12 and S[0]*10+S[1]>=13:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
be=s[:2]
af=s[2:]

if int(be)<=12 and int(af)<=12:
  print("AMBIGUOUS")

elif int(af)<=12:
  if af=="00":
    print("NA")
  else:
    print("YYMM")
    
elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
  
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
be=s[:2]
af=s[2:]

if int(af)<=12:
  if af=="00":
    print("NA")
  else:
    print("YYMM")
    
elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
    
elif int(be)<=12 and int(af)<=12:
  print("AMBIGUOUS")
  
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
be=s[:2]
af=s[2:]

if int(be)>=13 and int(af)<=12:
  if af=="00":
    print("NA")
  else:
    print("YYMM")
elif int(be)<=12 and int(af)>=13:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
elif int(be)<=12 and int(af)<=12:
  print("AMBIGUOUS")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:

S = input()
l = S[:2]
r = S[2:]

lcnt = 0
rcnt = 0
if 0 < int(l) <= 12 and 0 < int(r):
    lcnt = 1
if  0 < int(r) <= 12 and 0 < int(l):
    rcnt = 1
if lcnt and rcnt:
    print('AMBIGUOUS')
    exit()
elif lcnt:
    print('MMYY')
    exit()
elif rcnt:
    print('YYMM')
    exit()
else:
    print('NA')

Submission status: Wrong Answer

Solution code:

S = input()
l = S[:2]
r = S[2:]

lcnt = 0
rcnt = 0
if 0 < int(l) <= 12 and 0 < int(r):
    lcnt = 1
if  0 < int(r) <= 12 and 0 < int(l):
    rcnt = 1
if lcnt and rcnt:
    print('AMBIGUOUS')
    exit()
elif lcnt:
    print('MMYY')
elif rcnt:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    s = int(input())
    f = s/100
    b = s%100

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

main()

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    l = int(S[:2])
    r = int(S[2:])
    
    if l == 0 or r == 0:
        return 'NA'
    if l >= 20 or r >= 20:
        return 'NA'

    if 12 < l <= 19 and r <= 12:
        return 'YYMM'
    elif l <= 12 and r <= 19:
        return 'MMYY'
    elif l <= 12 and r <= 12:
        return 'AMBIGUOUS'
    else:
        return 'NA'

print(solve())

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    l = int(S[:2])
    r = int(S[2:])
    
    if l == 0 or r == 0:
        return 'NA'
    
    if 12 < l <= 19 and r <= 12:
        return 'YYMM'
    elif l <= 12 and 12 < r <= 19:
        return 'MMYY'
    elif l <= 12 and r <= 12:
        return 'AMBIGUOUS'
    else:
        return 'NA'

print(solve())

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    l = int(S[:2])
    r = int(S[2:])
    
    if l == 0 or r == 0:
        return 'NA'
    
    if 12 < l <= 20 and r <= 12:
        return 'YYMM'
    elif l <= 12 and 12 < r <= 20:
        return 'MMYY'
    elif l <= 12 and r <= 12:
        return 'AMBIGUOUS'
    else:
        return 'NA'

print(solve())

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

front = int(S[0:2])
rear = int(S[2:4])

if front == 0 or rear == 0:
	print("NA")
	exit()
if front > 12 and rear <= 12:
	print("YYMM")
	exit()
if front <= 12 and rear > 12:
	print("MMYY")
	exit()
if front <= 12 and rear <= 12:
	print("AMBIGUOUS")
	exit()
print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if F > 12 and SE > 12:
  print("NA")
elif F > 12 and 1 <= SE <= 12:
  print("YYMM")
elif 1 <= F <= 12 and SE > 12:
  print("MMYY")
elif 1 <= F <= 12 and 1 <= SE <= 12:
  print("AMBIGUOUS")
elif F == 0 and SE == 0:
  print("NA")
else:
  print("NA")

Submission status: Wrong Answer

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

if F > 12 and SE > 12:
  print("NA")

if F > 12 and SE <= 12:
  print("YYMM")

if F <= 12 and SE > 12:
  print("MMYY")

if F <= 12 and SE <= 12:
  print("AMBIGUOUS")

Submission status: Wrong Answer

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

if F < 12 and SE < 12:
  print("NA")

if F > 12 and SE <= 12:
  print("YYMM")

if F <= 12 and SE > 12:
  print("MMYY")

if F <= 12 and SE <= 12:
  print("AMBIGUOUS")

Submission status: Wrong Answer

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

if 0<a<13 and 0<b<13:
    ans = 'AMBIGUOUS'
elif 0<a<13 and b>12:
    ans = 'MMYY'
elif a>12 and 0<b<13:
    ans = 'YYMM'
else:
    ans = 'NA'

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

S = input()
x, y = int(S[:2]), int(S[2:])
yymm = 1 <= y <= 12
mmyy = 1 <= x <= 12
if yymm and mmyy:
    print('AMBIGUOUS')
elif yymm:
    print('YYMM')
elif mmyy:
    print('mmyy')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = list(input())
ab = int(s[0]+s[1])
cd = int(s[2]+s[3])
ans = ""
if 1 <= ab <= 12 and (cd == 0 or 13 <= cd):
    ans = "MMYY"
elif 1 <= cd <= 12 and (ab == 0 or 13 <= ab):
    ans = "YYNN"
elif 1 <= ab <= 12 and 1 <= cd <= 12:
    ans = "AMBIGUOUS"
else:
    ans = "NA"
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
f, r = int(S[:2]), int(S[2:])
#print(f)
#print(r)
if f > 12 and 0 < r <= 12:
  ans = "YYMM"
elif 0 < f <= 12 and r > 12:
  ans = "MMYY"
elif 0 < r <= 12 and 0 < f <= 12:
  ans = "AMBIGUOUS"
else:
  ans = "NA"
print(ans)

Submission status: Wrong Answer

Solution code:
s = raw_input()

m = [i for i in xrange(1,13)]

y = [i for i in xrange(1,100)]

f2 = int(s[:2])
l2 = int(s[2:])
if (f2 in m and f2 in y) and (l2 in m and l2 in y):
    print "AMBIGUOUS"
elif f2 in m and l2 in y   :
    print "MMYY"
elif f2 in y and l2 in m:
    print "YYMM"
else:
    print "NA"

Submission status: Wrong Answer

Solution code:
s = raw_input()

m = [i for i in xrange(1,13)]

y = [i for i in xrange(1,100)]

f2 = int(s[:2])
l2 = int(s[2:])
if (f2 in m and f2 in y) or (l2 in m and l2 in y):
    print "AMBIGUOUS"
elif f2 in m and l2 in y   :
    print "MMYY"
elif f2 in y and l2 in m:
    print "YYMM"
else:
    print "NA"

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
#print(s[:2],s[2:])
#数値はスライスできないので一旦文字列で受け取って、int型にシフトする
fro=int(s[:2])
ba=int(s[2:])
#print(fro,ba)

#s==前半01~12
if 1<=fro<=12:
    #s==前半01~12かつ後半01~12
    if 1<=ba<=12:
        print("AMBIGUOUS")
    #s==前半00または13以上
    elif ba==0 or ba<=13:
        print("MMYY")
#s==前半00または13以上
elif fro==0 or fro<=13:
    #s==前半00または13以上かつ後半01~12
    if 1<=ba<=12:
        print("YYMM")
    #s==前半00または13以上かつ後半00もしくは13以上
    elif ba==0 or ba<=13:
        print("NA")

Submission status: Wrong Answer

Solution code:
s=input()

#数値はスライスできないので一旦文字列で受け取って、int型にシフトする
fro=int(s[:2])
ba=int(s[2:])
#print(fro,ba)

#s==前半01~12
if 1<=fro<=12:
    #s==前半01~12かつ後半01~12
    if 1<=ba<=12:
        print("AMBIGUOUS")
    #s==前半00または13以上
    elif ba==0 or ba<=13:
        print("MMYY")
#s==前半00または13以上
elif fro==0 or fro<=13:
    print(fro,ba)
    #s==前半00または13以上かつ後半01~12
    if 1<=ba<=12:
        print("YYMM")
    #s==前半00または13以上かつ後半00もしくは13以上
    elif ba==0 or ba<=13:
        print("NA")

Submission status: Wrong Answer

Solution code:
def is_month( n :int ):
  return ( 1 <= n ) and ( n <= 12 )

def judge( first, second ):
  if (first and second):
    return "AMBIGUOUS"
  elif (first and not(second)):
    return "YYMM"
  elif (not( first ) and second):
    return "MMYY"
  else:
    return "NA"

s = input()
first = is_month( int( s[0:2] ))
second = is_month( int( s[2:4] ))
print( judge( first, second ) )

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    str = input()
    YY = []
    MM = []
    YYMM_flg = False
    MMYY_flg = False
    AMB_flg = False
    NA_flg = False

    for i in range(2):
    	YY.append(str[i])

    for i in range(2, 4):
    	MM.append(str[i])

    yy = int(''.join(YY))
    mm = int(''.join(MM))

    if (yy >= 1 and yy <= 12) and (mm >= 1 and mm <= 12):
    	AMB_flg = True
    elif (mm >= 1 and mm <= 12) and (yy != 0 and mm != 0):
    	YYMM_flg = True
    elif (yy >= 1 and yy <= 12) and (yy != 0 and mm != 0):
    	MMYY_flg = True
    else:
    	NA_flg = True

    if AMB_flg:
    	print("AMBIGUOUS")
    elif YYMM_flg:
    	print("YYMM")
    elif MMYY_flg:
    	print("MMYY")
    elif NA_flg:
    	print("NA")


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
ym = [s[i*2:i*2+2] for i in range(2)]

if int(ym[0]) < 13 and int(ym[1]) < 13:
  print("AMBIGUOUS")
elif int(ym[1]) < 13:
  print("YYMM")
elif int(ym[0]) < 13:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def is_mm(s):
	return int(s) >= 1 and int(s) <= 12

def is_yy(s):
	return int(s)>0

def main():
	#a = int(input())
	#b , c = IN()
	s = input()
	is_mmxx=is_mm(s[:2])
	is_yyxx=is_yy(s[:2])
	is_xxmm=is_mm(s[2:])
	is_xxyy=is_yy(s[2:])
	ra = 'AMBIGUOUS'
	rb= 'NA'
	rc='YYMM'
	rd='MMYY'
	if is_mmxx and is_xxyy and is_xxmm and is_yyxx:
		return ra
	elif is_mmxx and is_xxyy:
		return rd
	elif is_yyxx and is_xxmm:
		return rc
	else:
		return rb
		
	
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Wrong Answer

Solution code:
A = str(input())
AC = list(A)
AB = int(A[0] + A[1])
AC = int(A[2] + A[3])

if 1 <= AB <= 12 and 1 <= AC <= 12:
    print("AMBIGUOUS")
elif 1 <= AB <= 12:
    print("YYMM")
elif 1 <= AC <= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
A = str(input())
AC = list(A)
AB = int(A[0] + A[1])
AC = int(A[2] + A[3])

if 1 <= AB <= 12 and 1 <= AC <= 12:
    print("AMBIGUOUS")
elif AB > 13:
    print("YYMM")
elif AC > 13:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
A = str(input())
AC = list(A)
AB = int(A[0] + A[1])
AC = int(A[2] + A[3])

if AB > 13:
    if AC == 0:
        print("NA")
    else:
        print("YYMM")
if 1 <= AB <= 12:
    if AC == 0:
        print("NA")
    else:
        print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
N = int(input())

if 199 <= N <= 1299:
    if 9901 <= N <= 9912:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 9901 <= N <= 9912:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S =list(input())

former = int(S[0])*10+int(S[1])
latter = int(S[2])*10+int(S[3])
former_YY=False
former_MM=False
latter_YY=False
latter_MM=False

if former <= 99 and former != 0:
    former_YY = True
    
if former <= 12 and former != 0:
    former_MM = True

if latter <= 99 and latter != 0:
    latter_YY = True

if latter <= 12 and latter != 0:
    latter_MM = True

if former_YY and former_MM and latter_YY and latter_MM:
    print("AMBIGUOUS")
elif former_YY and latter_MM:
    print("YYMM")
elif former_MM and latter_YY:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *


if __name__ == '__main__':
    s = input()
    s1 = int(s[0:2])
    s2 = int(s[2:4])
    f1 = 0
    f2 = 0

    if s1 == 0:
        f1 = 0
    elif s1 >0 and 13 > s1:
        f1 = 1
    else:
        f1 =2

    if s2 == 0:
        f2 = 0
    elif s2 >0 and 13 > s2:
        f2 = 1
    else:
        f2 =2

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

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *


if __name__ == '__main__':
    s = input()
    s1 = int(s[0:2])
    s2 = int(s[2:4])
    f1 = 0
    f2 = 0

    if s1 == 0:
        f1 = 0
    elif s1 >0 and 13 > s1:
        f1 = 1
    else:
        f1 =2

    if s2 == 0:
        f2 = 0
    elif s2 >0 and 13 > s2:
        f2 = 1
    else:
        f2 =2

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

    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *


if __name__ == '__main__':
    s = input()
    s1 = int(s[0:2])
    s2 = int(s[2:4])
    f1 = 0
    f2 = 0

    if s1 == 0:
        f1 = 0
    elif s1 >0 and 13 > s1:
        f1 = 1
    else:
        f2 =2

    if s2 == 0:
        f1 = 0
    elif s2 >1 and 13 > s2:
        f1 = 1
    else:
        f2 =2

    if f1 == 0 and f2 ==0:
        print("NA")
    elif (f1 ==0 and f2 == 2) or (f1 == 1 and f2 ==0) or (f1 == 2 and f2 ==2) :
        print("NA")
    elif (f1 ==0 and f2 == 1) or (f1 == 2 and f2 ==1) :
        print("MMYY")

    elif (f1 ==1 and f2 == 0) or (f1 == 1 and f2 ==2) :
        print("YYMM")

    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import fractions

import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
import numpy as np
from decimal import *


if __name__ == '__main__':
    s = input()
    s1 = int(s[0:2])
    s2 = int(s[2:4])
    f1 = 0
    f2 = 0

    if s1 == 0:
        f1 = 0
    elif s1 >1 and 13 > s1:
        f1 = 1
    else:
        f2 =2

    if s2 == 0:
        f1 = 0
    elif s2 >1 and 13 > s2:
        f1 = 1
    else:
        f2 =2

    if f1 == 0 and f2 ==0:
        print("NA")
    elif (f1 ==0 and f2 == 2) or (f1 == 1 and f2 ==0) or (f1 == 2 and f2 ==2) :
        print("NA")
    elif (f1 ==0 and f2 == 1) or (f1 == 2 and f2 ==1) :
        print("MMYY")

    elif (f1 ==1 and f2 == 0) or (f1 == 1 and f2 ==2) :
        print("YYMM")

    else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    s = input()
    s1 = int(s[0:2])
    s2 = int(s[2:4])
    f1 = 0
    f2 = 0

    if s1 == 0:
        f1 = 0
    elif s1 >1 and 13 > s1:
        f1 = 1
    else:
        f2 =2

    if s2 == 0:
        f1 = 0
    elif s2 >1 and 13 > s2:
        f1 = 1
    else:
        f2 =2

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