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:
import sys

s = input()

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

##YYMM
if ((former > 12) and (latter <= 12)):
    print('YYMM')
    sys.exit()

##MMYY
if ((former <= 12) and (latter > 12)):
    print('MMYY')
    sys.exit()

##AMBIGUOUS
if ((former <= 12) and (latter <= 12)):
    print('AMBIGUOUS')
    sys.exit()

##NA
if ((former > 12) and (latter > 12)):
    print('NA')
    sys.exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import datetime
S = input()
yymm = False
mmyy = False

try:
    datetime.date(int(S[:2]), int(S[2:4]), 1)
    yymm = True
except:
    pass

try:
    datetime.date(int(S[2:4]), int(S[:2]), 1)
    mmyy = True
except:
    pass
  
if yymm:
    if mmyy:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    if mmyy:
        print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
low = int(S) % 100
high = (int(S) - low) / 100

if high == 0:
  print('NA')
elif 1 <= high <= 12:
  if low == 0:
    print('NA')
  elif 1 <= low <= 12:
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if low == 0:
    print('NA')
  elif 1 <= low <= 12:
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

Solution code:
#YYMM or MMYY or AMBIGUOUS or NA

inputLine = input()

firstPart = int(inputLine[0:2])
secondPart = int(inputLine[3:5])

#initialization
naFlag = False
firstPartYear = False
firstPartAmb = False
secondPartYear = False
secondPartAmb = False

# firstPartの属性判定
if firstPart < 0:
    naFlag = True

elif firstPart == 0:
    firstPartYear = True
    
elif firstPart < 13:
    firstPartAmb = True
    
else: 
    firstPartYear = True
    
# secondPartの属性判定
if secondPart < 0:
    naFlag = True

elif secondPart == 0:
    secondPartYear = True
    
elif secondPart < 13:
    secondPartAmb = True
    
else: 
    secondPartYear = True
    
if naFlag:
    print('NA')

elif secondPartYear:
    if firstPartYear:
        print('NA')
    elif firstPartAmb:
        print('MMYY')

elif secondPartAmb:
    if firstPartYear:
        print('YYMM')
    elif firstPartAmb:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
## YYMM or MMYY or AMBIGUOUS or NA
## YY: なんでもok
## MM: 01~12
## MMの個数によって条件分岐すればok

s = input()
pre = int(s[:2])
last = int(s[2:])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i=input()
a,b=int(i[:2]),int(i[-2:])
if a<13 and b<13:
    print ("AMBIGUOUS")
if a<13 and b>=13:
    print ("MMYY")
if a>=13 and b<13:
    print ("YYMM")
if a>12 and b>12:
    print ("NA")

Submission status: Wrong Answer

Solution code:
s=str(input())
a=int(s[:2])
b=int(s[2:])
if a==0 or a>=13:
    astr='YY'
else:
    astr='MM'

if b==0 or a>=13:
    bstr='YY'
else:
    bstr='MM'

ans=astr+bstr
 
if ans=='YYYY':
    print('NA')
elif ans=='MMMM':
    print('AMBIGUOUS')
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
s=str(input())
a=int(s[:2])
b=int(s[2:])
if a==0 or a>=13:
    astr='YY'
else:
    astr='MM'

if b==0 or a>=13:
    bstr='YY'
else:
    bstr='MM'

ans=astr+bstr
 
if ans=='YYYY':
    print('NA')
elif ans=='MMMM':
    print('AMBIGUOS')
else:
    print(ans)

Submission status: Wrong Answer

Solution code:

numbers = input('')

first_numbers = int(numbers[0] + numbers[1])
second_numbers = int(numbers[2] + numbers[3])

if first_numbers > 12 and second_numbers > 12:
  print('NA')
elif first_numbers > 12:
  if second_numbers == 0 or second_numbers > 12:
    print('NA') 
  else:
    print('YYMM') 
elif second_numbers > 12:
  if first_numbers == 0 or first_numbers > 12: 
    print('NA') 
  else:
    print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:

numbers = input('')

first_numbers = int(numbers[0] + numbers[1])
second_numbers = int(numbers[2] + numbers[3])

if first_numbers > 12 and second_numbers > 12:
  print('NA')
elif first_numbers > 12:
  if second_numbers == 0:
    print('NA') 
  else:
    print('YYMM') 
elif second_numbers > 12:
  if first_numbers == 0: 
    print('NA') 
  else:
    print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

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

if 12<a:
    if 0<b<=12:
        a='MMYY'
    else:
        a='NA'

elif 0<a<=12:
    if 0<b<=12:
        a='AMBIGUOUS'
    elif 12<b:
        a='YYMM'

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if b > 12 and c > 12 or b == 0 or c == 0 or b > 31 or c > 31:
    print('NA')
elif b > 12:
    print('YYMM')
elif c > 12:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

if a==0 or b==0:
    print('NA')
elif a>=1 and a<=12 and b>=1 and b<=12:
    print('AMBIGUOS')
elif a>=1 and a<=12 and b>=13:
    print('MMYY')
elif a>=13 and b>=1 and b<=12:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
S = list(input())
S_divide = [S[0]+S[1],S[2]+S[3]]
S_divide = list(map(int, S_divide))
a = S_divide[0]
b = S_divide[1]
while True:
    if 0 < a < 13 and b > 12:
        print('MMYY')
    elif 0 < b < 13 and a > 12:
        print('YYMM')
    elif 0 < a < 13 and 0 < b < 13:
        print('AMBIGUOUS')
    else:
        print('NA')
    break

Submission status: Wrong Answer

Solution code:
S = list(input())
S_divide = [S[0]+S[1],S[2]+S[3]]
S_divide = list(map(int, S_divide))
a = S_divide[0]
b = S_divide[1]
while True:
    if 0 < a < 13 and b > 12:
        print('MMYY')
    elif 0 < b < 13 and a > 12:
        print('YYMM')
    elif 0 < a < 13 and b < 13:
        print('AMBIGUOUS')
    else:
        print('NA')
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A = str(input())
B =int(A[0:1])
C =int(A[2:4])
print(A)
print(B)
print(C)

if B >=1 and B<=12:
    B_mm = True
else:
    B_mm = False

if C >=1 and C<=12:
    C_mm = True
else:
    C_mm = False

if B >=0 and B<=99:
    B_yy = True
else:
    B_yy = False

if C >=0 and C<=99:
    C_yy = True
else:
    C_yy = False

if B_yy == True and C_mm == True and B_mm ==True and C_yy ==True :
    print('AMBIGUOUS')
elif B_yy == True and C_mm == True:
    print('YYMM')
elif  C_yy == True and B_mm == True:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
A = str(input())
B =int(A[0:1])
C =int(A[2:4])
print(A)
print(B)
print(C)

if B >=1 and B<=12:
    B_mm = True
else:
    B_mm = False

if C >=1 and C<=12:
    C_mm = True
else:
    C_mm = False

if B >=0 and B<=99:
    B_yy = True
else:
    B_yy = False

if C >=0 and C<=99:
    C_yy = True
else:
    C_yy = False

if B_yy == True and C_mm == True and B_mm ==True and C_yy ==True :
    print('AMBIGUOUS')
elif B_yy == True and C_mm == True:
    print('YYMM')
elif  C_yy == True and B_mm == True:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
A = input()
B =int(A[0:2])
C =int(A[3:4])

if B >=1 and B<=12:
    B_mm = True
else:
    B_mm = False

if C >=1 and C<=12:
    C_mm = True
else:
    C_mm = False

if B >=0 and B<=99:
    B_yy = True
else:
    B_yy = False

if C >=0 and C<=99:
    C_yy = True
else:
    C_yy = False

if B_yy == True and C_mm == True and B_mm ==True and C_yy ==True :
    print('AMBIGUOUS')
elif B_yy == True and C_mm == True:
    print('YYMM')
elif  C_yy == True and B_mm == True:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
A = input()
B =int(A[0:2])
C =int(A[3:4])

if B >=1 and B<=12:
    B_mm = True
else:
    B_mm = False

if C >=1 and C<=12:
    C_mm = True
else:
    C_mm = False

if B >=0 and B<=99:
    B_yy = True
else:
    B_yy = False

if C >=0 and C<=99:
    C_yy = True
else:
    C_yy = False

if B_yy == True and C_mm == True and B_mm ==True and C_yy ==True :
    print('AMBIGUOUS')
elif B_yy == True and C_mm == True:
    print('YYMM')
elif  C_yy == True and B_mm == True:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
A = input()
B =int(A[0:2])
C =int(A[3:4])

if B >=1 and B<=12:
    B_yy = True
else:
    B_yy = False

if C >=1 and C<=12:
    C_yy = True
else:
    C_yy = False

if B >=0 and B<=99:
    B_mm = True
else:
    B_mm = False

if C >=0 and C<=99:
    C_mm = True
else:
    C_mm = False

if B_yy == True and C_mm == True and B_mm ==True and C_yy ==True :
    print('AMBIGUOUS')
elif B_yy == True and C_mm == True:
    print('YYMM')
elif  C_yy == True and B_mm == True:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
A = input()
B =int(A[:1])
C =int(A[2:])

if B >=1 and B<=12:
    B_yy = True
else:
    B_yy = False

if C >=1 and C<=12:
    C_yy = True
else:
    C_yy = False

if B >=0 and B<=99:
    B_mm = True
else:
    B_mm = False

if C >=0 and C<=99:
    C_mm = True
else:
    C_mm = False

if B_yy == True and C_mm == True and B_mm ==True and C_yy ==True :
    print('AMBIGUOUS')
elif B_yy == True and C_mm == True:
    print('YYMM')
elif  C_yy == True and B_mm == True:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys 

S = sys.stdin.readline()

def is_mmyy(s):
    former, latter = int(S[0:2]), int(S[2:])
    if (former >= 1 and former <= 12) and (latter >= 1 and latter <= 99):
        return True
    return False

def is_yymm(s):
    former, latter = int(S[0:2]), int(S[2:])
    if (former >= 1 and former <= 99) and (latter >= 1 and latter <= 12):
        return True
    return False


# MMYY && YYMM
if is_mmyy(S) and is_yymm(S):
    print("AMBIGUOUS")
# MMYY
elif is_mmyy(S) and not is_yymm(S):
    print("MMYY")
# YYMM
elif is_yymm(S) and not is_mmyy(S):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import sys

S = sys.stdin.readline()

def is_mmyy(s):
    former, latter = int(S[0:2]), int(S[2:])
    if (former >= 1 and former <= 12) and (latter >= 1 and latter <= 99):
        return True
    return False

def is_yymm(s):
    former, latter = int(S[0:2]), int(S[2:])
    if (former >= 1 and former <= 99) and (latter >= 1 and latter <= 12):
        return True
    return False


# MMYY && YYMM
if is_mmyy(S) and is_yymm(S):
    print("AMBIGUOUS")
# MMYY
elif is_mmyy(S):
    print("MMYY")
# YYMM
elif is_yymm(S):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
n1 = int(S[:2])
n2 = int(S[2:])

if 0 < n1 < 13 and 0 < n2 < 13:
    print('AMBIGUOUS')
elif 0 < n1 < 13 and 0 < n2 < 100:
    print('MMYY')
elif 0 < n2 < 13 and 0 < n1 < 100:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import sys

S = sys.stdin.readline()

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

def is_year(n):
    if n >= 1 and n <= 99:
        return True
    return False


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

mf = is_month(former)
yl = is_year(latter)

yf = is_year(former)
ml = is_month(latter)

if (mf and yl) and (yf and ml):
    print("AMBIGUOUS")
elif mf and yl:
    print("MMYY")
elif yf and ml:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
n1 = int(S[:2])
n2 = int(S[2:])
if n1 == 0 and n2 > 12:
    print('NA')
    exit()
if n1 > 12 and n2 == 0:
    print('NA')
    exit()

if n1 < 13 and n2 < 13:
    print('AMBIGUOUS')
elif n1 < 13:
    print('MMYY')
elif n2 < 13:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
n1 = int(S[:2])
n2 = int(S[2:])
if n1 == 0 or n2 == 0:
    print('NA')
    exit()

if n1 < 13 and n2 < 13:
    print('AMBIGUOUS')
elif n1 < 13:
    print('MMYY')
elif n2 < 13:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
def determin_format(A, B):
    if 0<= A <= 12:
        if 0 <= B <= 12:
            return "AMBIGUOUS"
        else:
            return "MMYY"
    
    else:
        if 0 < B <= 12:
            return "YYMM"
        else: 
            return  "NA"

S = input()

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

print(determin_format(A,B))

Submission status: Wrong Answer

Solution code:
def determin_format(A, B):
    if 0<= A <= 12 and 0 <= B <= 12:
        return "AMBIGUOUS"
    
    elif 0 < A <= 12:
        return "MMYY"
    
    elif 0 < B <= 12:
        return "YYMM"
    
    else: 
        return  "NA"

S = input()

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

print(determin_format(A,B))

Submission status: Wrong Answer

Solution code:
def inpl(): return list(map(int, input().split()))

S = input()

if int(S[:2]) <= 12:
    if 1 <= int(S[2:]) <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1 <= int(S[2:]) <= 12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
def determin_format(A, B):
    if 0 <= A <= 12 and 0 <= B <= 12:
        return "AMBIGUOUS"
    
    elif 0 < A <= 12:
        return "MMYY"
    
    elif 0 < B <= 12:
        return "YYMM"
    
    else: 
        return  "NA"

S = input()

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

print(determin_format(A,B))

Submission status: Wrong Answer

Solution code:
def determin_format(A, B):
    if 0 <= A <= 12 and 0 <= B <= 12:
        return "AMBIGUOUS"
    
    elif 0 < A <= 12:
        return "MMYY"
    
    elif 0 < B <= 12:
        return "YYMM"
    
    else: 
        return  "NA"

S = input()

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

determin_format(A,B)

Submission status: Wrong Answer

Solution code:

s = input()

a = 10*int(s[0])+int(s[1])
b = 10*int(s[2])+int(s[3])

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:
def isMM(s):
  n = int(s)
  if 0 < n <13:
    return True
  return False

s = raw_input()
s1 = s[:2]
s2 = s[2:]
ans = "NA"
if isMM(s2):
  if isMM(s1):
    ans = "AMBIGUOUS"
  else:
    ans = "YYMM"
else:
  if isMM(s2):
    ans = "MMYY"
    
print ans

Submission status: Wrong Answer

Solution code:
def isMM(s):
  n = int(s)
  if 0 < n <13:
    return True
  return False

s = raw_input()
s1 = s[:2]
s2 = s[2:]
ans = "NA"
if isMM(s2):
  if isMM(s1):
    ans = "AMBIGUOUS"
  else:
    ans = s2 + s1
print ans

Submission status: Wrong Answer

Solution code:
s = input()

a = 10*int(s[0])+int(s[1])
b = 10*int(s[2])+int(s[3])


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

Submission status: Wrong Answer

Solution code:
a = input()

if 0 < int(a[:2]) and int(a[:2]) <= 12:
    if 0 < int(a[2:]) and int(a[2:]) <= 12:
        print("AMBIGUOUSS")
    else:
        print("MMYY")

elif 0 < int(a[2:]) and int(a[2:]) <= 12:
    if 0 < int(a[:2]) and int(a[:2]) <= 12:
        print("AMBIGUOUSS")
    else:
        print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
a = input()

if 0 < int(a[:2]) and int(a[:2]) <= 12:
    if 0 < int(a[2:]) and int(a[2:]) <= 12:
        print("AMBIGUOUSS")
    else:
        print("MMYY")

elif 0 < int(a[2:]) and int(a[2:]) <= 12:
    if 0 < int(a[:2]) and int(a[:2]) <= 12:
        print("AMBIGUOUSS")
    else:
        print("YYMM")
else:
    if 0 < int(a[:2]) and int(a[:2]) <= 12:
        print("MMYY")
    elif 0 < int(a[2:]) and int(a[2:]) <= 12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
YYMM = input()
YY = int(YYMM[:2])
MM = int(YYMM[2:])

if 1 <= YY <= 12 and 1 <= MM <= 12:
    print('AMBIGUOUS')
elif YY > 12 >= MM >= 1:
    print('YYMM')
elif 1 <= YY <= 12 < MM:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
a = int(input())
b = int(a / 100)
b = math.floor(b)
c = int(a % 100)
if b>=1 and b<=12:
    if c>=1 and c<=12:
        print("ANBIGUOUS")
    else:
        print("MMYY")
else:
    if c>=1 and c<=12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
import math
a = int(input())
b = a / 100
b = math.floor(b)
c = a % 100
if b>=1 and b<=12:
    if c>=1 and c<=12:
        print("ANBIGUOUS")
    else:
        print("MMYY")
else:
    if c>=1 and c<=12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
s = int(input())
s1 = s//100
s2 = s%100

if 0<s1<13 and 0<s2<13:
  print('ANBIGUOUS')
elif 0<s1<13:
  print('MMYY')
elif 0<s2<13:
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
FF=int(S[0]+S[1])
LL=int(S[2]+S[3])
f=False
l=False
month=list(range(1,13))


if FF in month:
    f=True
if LL in month:
    l=True

if FF and LL:
    print('AMBIGUOUS')
    exit(0)
if FF:
    print('MMYY')
elif LL:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

n1 = int(N / 100 % 100)
n2 = N % 100

if n1 > 12 and n2 > 0:
    print("YYMM")
elif n2 > 12 and n1 > 0:
    print("MMYY")
elif n1 < 13 and n2 < 13:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import bisect

lis = [1, 13]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tplo == 1:
    if btlo == 1:
        jd = 2
    else:
        jd = 1
else:
    if btlo == 1:
        jd = 0
    else:
        jd = 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(tplo, btlo)
print(judge[jd])

Submission status: Wrong Answer

Solution code:
import bisect

lis = [1, 13]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)

if tp == 1:
    if bt == 1:
        jd = 2
    else:
        jd = 1
else:
    if bt == 1:
        jd = 0
    else:
        jd = 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(judge[jd])

Submission status: Wrong Answer

Solution code:
import bisect

lis = [1, 13]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)


if tp == 0:
    if bt == 1:
        jd = 1
    else:
        jd = 3
elif tp == 1:
    if bt == 1:
        jd = 2
    else:
        jd = 1
else:
    if bt == 1:
        jd = 0
    else:
        jd = 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(judge[jd])

Submission status: Wrong Answer

Solution code:
import bisect

lis = [1, 12]

str = input()
tp = int(str[:2])
bt = int(str[2:])

tplo = bisect.bisect_right(lis, tp)
btlo = bisect.bisect_right(lis, bt)


if tp == 0:
    if bt == 1:
        jd = 3
    else:
        jd = 0
elif tp == 1:
    if bt == 1:
        jd = 2
    else:
        jd = 1
else:
    if bt == 1:
        jd = 0
    else:
        jd = 3

judge = ["YYMM", "MMYY", "AMBIGUOUS", "NA"]
print(judge[jd])

Submission status: Wrong Answer

Solution code:
def canMonth(value):
    return 1 <= value and value <= 12


S = input()

F = int(S[:2])
B = int(S[2:])
fm = canMonth(F)
bm = canMonth(B)

if fm and bm:
    print('ANBIGUOUS')
elif not fm and not bm:
    print('NA')
elif fm:
    print('MMYY')
else:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
N = int(input())

n1 = N / 100 % 100
n2 = N % 100

if n1 == 0 or n2 == 0:
    print("NA")
elif n1 > 12:
    print("YYMM")
elif n2 > 12:
    print("MMYY")
elif n1 < 12:
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

if(s1 <= 1 and s1 <=12):
  if(s2 <= 1 and s2 <=12):
    print('AMBIGUOUS')
  else:
    print('MMYY')
else:
  if(s2 <= 1 and s2 <=12):
    print('YYMM')
  else:
    print('NA')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# ABC126B - YYMM or MMYY
s = input()
x, y = int(s[:2]), int(s[2:])
if x == 0 or y == 0:
    print("NA")
elif 1 <= x <= 12 and 1 <= y <= 12:
    print("AMBIGUOUS")
elif 1 <= x <= 12 and y <= 31:
    print("MMYY")
elif x <= 31 and 1 <= y <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# ABC126B - YYMM or MMYY
s = input()
x, y = int(s[:2]), int(s[2:])
if 1 <= x <= 12 and 1 <= y <= 12:
    print("AMBIGUOUS")
elif 1 <= x <= 12 and y <= 31:
    print("MMYY")
elif x <= 31 and 1 <= y <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# ABC126B - YYMM or MMYY
s = input()
x, y = int(s[:2]), int(s[2:])
if 1 <= x <= 12 and 1 <= y <= 12:
    print("AMBIGUOUS")
elif 1 <= x <= 12 and 1 <= y <= 31:
    print("MMYY")
elif 1 <= x <= 31 and 1 <= y <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# ABC126B - YYMM or MMYY
s = input()
x, y = int(s[:2]), int(s[2:])
if 1 <= x <= 12 and 1 <= y <= 12:
    print("AMBIGUOUS")
elif 1 <= x <= 12 and 13 <= y <= 31:
    print("MMYY")
elif 13 <= x <= 31 and 1 <= y <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# ABC126B - YYMM or MMYY
s = input()
x, y = int(s[:2]), int(s[2:])
if 1 <= x <= 12 and 1 <= y <= 12:
    print("AMBIGUOUS")
elif 1 <= x <= 12 and 13 <= y:
    print("MMYY")
elif 1 <= y <= 12 and 13 <= x:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())

a = s // 100
b = s % 100

if a * b == 0:
    print('NA')
    exit()

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

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    upper = int(S[:2])
    lower = int(S[2:4])

    if upper > 12 and lower > 12:
        print('NA')

    elif upper > 12 and lower > 0:
        print('YYMM')

    elif lower > 12 and upper > 0:
        print('MMYY')

    elif lower == 0 or upper == 0:
        print('NA')

    else:
        print('AMBIGUOUS')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
#print(s)
m1 = False
m2 = False

s1 = int(s[0:2])
s2 = int(s[2:])
#print(s1, s2)

if 0 < s1 < 13:
  m1 = True

if 0 < s2 < 13:
  m2 = True

if m1 == True and m2 == True:
  print('ANBIGUOUS')
elif m1 == True and m2 == False:
  print('MMYY')
elif m1 == False and m2 == True:
  print('YYMM')
elif m1 == False and m2 == False:
  print('NA')

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    upper = int(S[:2])
    lower = int(S[2:4])
    if upper > 12 and lower > 0:
        print('YYMM')
        return
    elif lower > 12 and upper > 0:
        print('MMYY')
        return
    elif lower is not 0 and upper is not 0:
        print('AMBIGUOUS')
    else:
        print('NA')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    upper = int(S[:2])
    lower = int(S[2:4])
    if upper > 12 and lower > 12:
        print('NA')
        return
    elif upper > 12 and lower > 0:
        print('YYMM')
        return
    elif lower > 12 and upper > 0:
        print('MMYY')
        return
    else:
        print('AMBIGUOUS')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    upper = int(S[:2])
    lower = int(S[2:4])
    if upper > 12 and lower > 12:
        print('NA')
        return
    elif upper > 12:
        print('YYMM')
        return
    elif lower > 12:
        print('MMYY')
        return
    else:
        print('AMBIGUOUS')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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