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:
def resolve(head, tail):
    if head <= 0 or tail <= 0:
        print('NA')
    elif head > 12 and tail > 12:
        print('NA')
    elif head > 12 and tail <= 12:
        print('YYMM')
    elif head <= 12 and tail > 12:
        print('MMYY')
    elif head <= 12 and tail <= 12:
        print('AMBIGUOUS')


if __name__ == "__main__":
    S = input()
    head = int(S[:2])
    tail = int(S[2:])

    resolve(head, tail)

Submission status: Wrong Answer

Solution code:
def resolve(head, tail):
    if head <= 0 or tail <= 0:
        print('NA')
    elif head > 12 and tail > 12:
        print('NA')
    elif head > 12 and tail <= 12:
        print('YYMM')
    elif head <= 12 and tail > 12:
        print('MMYY')
    elif head <= 12 and tail <= 12:
        print('AMBIGUOUS')


if __name__ == "__main__":
    S = input()
    head = int(S[0:2])
    tail = int(S[3:4])

    resolve(head, tail)

Submission status: Wrong Answer

Solution code:
S = input()
head = int(S[0:2])
tail = int(S[3:4])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

before, after = int(S[:2]), int(S[2:])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
ff = S[0:2]
ll = S[2:4]
ff = int(ff)
ll = int(ll)
print(ff)
print(ll)
if 0 < ff <= 12 and 0 < ll <= 12:
  print('AMBIGUOUS')
elif 0 < ll <= 12:
  print('YYMM')
elif 0 < ff <= 12:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 27 14:45:50 2019

@author: 吉田和博
"""


def Mcheck(n):
    if(0<n<13):
        return 0
    else:
        return 1
    
def Ycheck(n):
    if(n==0):
        return 1
    else:
        return 0


S=input()
f=int(S[0])*10+int(S[1])
s=int(S[2])*10+int(S[3])

if(Mcheck(f)==0):
    if(Mcheck(s)==0):
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if(Mcheck(f)==0):
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 27 14:45:50 2019

@author: 吉田和博
"""


def Mcheck(n):
    if(0<n<13):
        return 0
    else:
        return 1
    
def Ycheck(n):
    if(n==0):
        return 1
    else:
        return 0


S=input()
f=int(S[0])*10+int(S[1])
s=int(S[2])*10+int(S[3])

if(Mcheck(f)==0):
    if(Ycheck(s)==0):
        if(Ycheck(f)==0):
            if(Mcheck(s)==0):
                print("AMBIGUOUS")
            else:
                print("MMYY")
        else:
            if(Mcheck(s)==0):
                print("AMBIGUOUS")
            else:
                print("MMYY")
    else:
        if(Mcheck(s)==0):
            if(Ycheck(f)==0):
                print("AMBIGUOUS")
            else:
                print("AMBGIOUS")
        else:
            print("NA")
else:
     if(Mcheck(s)==0):
            if(Ycheck(f)==0):
                print("YYMM")
            else:
                print("YYMM")
     else:
            print("NA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 27 14:45:50 2019

@author: 吉田和博
"""


def Mcheck(n):
    if(0<n<13):
        return 0
    else:
        return 1
    
def Ycheck(n):
    if(n==0):
        return 1
    else:
        return 0


S=input()
f=int(S[0])*10+int(S[1])
s=int(S[2])*10+int(S[3])

if(Mcheck(f)==0):
    if(Ycheck(s)==0):
        if(Ycheck(f)==0):
            if(Mcheck(s)==0):
                print("AMBIGUOUS")
            else:
                print("MMYY")
        else:
            print("MMYY")
    else:
        if(Mcheck(s)==0):
            if(Ycheck(f)==0):
                print("AMBIGUOUS")
            else:
                print("AMBGIOUS")
        else:
            print("NA")
else:
     if(Mcheck(s)==0):
            if(Ycheck(f)==0):
                print("YYMM")
            else:
                print("YYMM")
     else:
            print("NA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon May 27 14:45:50 2019

@author: 吉田和博
"""


def Mcheck(n):
    if(0<n<13):
        return 0
    else:
        return 1
    
def Ycheck(n):
    if(n==0):
        return 1
    else:
        return 0


S=input()
f=int(S[0])*10+int(S[1])
s=int(S[2])*10+int(S[3])

if(Mcheck(f)==0):
    if(Ycheck(s)==0):
        if(Ycheck(f)==0):
            if(Mcheck(s)==0):
                print("AMBIGUOUS")
            else:
                print("MMYY")
        else:
            print("MMYY")
    else:
        if(Mcheck(s)==0):
            if(Ycheck(f)==0):
                print("AMBIGUOUS")
            else:
                print("MMYY")
        else:
            print("NA")
else:
     if(Mcheck(s)==0):
            if(Ycheck(f)==0):
                print("YYMM")
            else:
                print("YYMM")
     else:
            print("NA")

Submission status: Wrong Answer

Solution code:
def Mcheck(n):
    if(0<n<13):
        return 0
    else:
        return 1
    
def Ycheck(n):
    if(n==0):
        return 1
    else:
        return 0


S=input()
f=int(S[0])*10+int(S[1])
s=int(S[2])*10+int(S[3])

if(Mcheck(f)==0):
    if(Ycheck(s)==0):
        if(Ycheck(f)==0):
            if(Mcheck(s)==0):
                print("AMBIGUOUS")
            else:
                print("MMYY")
        else:
            print("MMYY")
    else:
        if(Mcheck(s)==0):
            if(Ycheck(f)==0):
                print("YYMM")
            else:
                print("NA")
        else:
            print("NA")
else:
     if(Mcheck(s)==0):
            if(Ycheck(f)==0):
                print("YYMM")
            else:
                print("NA")
     else:
            print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()

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

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

Submission status: Wrong Answer

Solution code:
s=input()

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

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

Submission status: Wrong Answer

Solution code:
S = int(input())
l = int(S/100)
r = int(S%100)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
n = [int(N[:2]), int(N[2:])]
a = ['YYMM', 'MMYY', 'AMBIGUOUS', 'NA']
if n[0] > 12 or n[0] == 0:
  del a[1]
  del a[2]
  if n[1] > 12 or n[1] == 0:
    del a[0]
elif n[1] > 12 or n[1] == 0:
  del a[0],a[2]
else:
  a = a[2]
print(a[0])

Submission status: Wrong Answer

Solution code:
N = input()
n = [int(N[:2]), int(N[2:])]
a = ['YYMM', 'MMYY', 'AMBIGUOUS', 'NA']
if n[0] > 12:
    if n[1] == 0:
        print(a[3])
    else:
        print(a[0])
elif n[1] > 12:
    if n[0] == 0:
        print(a[3])
    else:
        print(a[1])
else:
    print(a[2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c = input()
f = int(c[:2])
e = int(c[2:]) 

if (0<f<13):
    print("MMYY")
    if(0<e<13):
        print("AMBIGUOUS")
else:
    if(0<e<13):
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
c = input()
f = int(c[:2])
e = int(c[2:]) 

if (1<f<13):
    print("MMYY")
    if(1<e<13):
        print("AMBIGUOUS")
else:
    if(1<e<13):
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
c = input()
f = int(c[:2])
e = int(c[2:]) 

if (1<f<13):
    print("MMYY")
    if(1<e<13):
        print("AMBIGUOUS")
elif (1<e<13):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
c = input()
f = int(c[:2])
e = int(c[2:]) 

if ((1 <= f <=12) and  e >= 13):
    print("MMYY")
elif(f>=13 and (1<= e <= 12)):
    print("YYMM")
elif((f>=13 and e >= 13) or ((f==0 and e >= 13) or (f>= 13 and e == 0))):
    print("NA")
elif(f<=12 and e <= 12):
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
dic = {1,3,5,7,8,10,12}

s = input()


y1 = int(s[:2])
m1 = int(s[2:])

fl = 0
fl2 = 0
#print(y1,m1)
if y1>0:
    if m1>0 and m1<=12:
        fl = 1
if m1>0:
    if y1>0 and y1<=12:
        fl2 = 1


if fl==0 and fl2==0:
  print("NA")
else:
  if fl*fl2==1:
      print("AMBIGUOUS")
  else:
        if fl==1:
            print("YYMM")
        else:
            if fl2==1:
                print("MMYY")
            else:
                print("NA")

Submission status: Wrong Answer

Solution code:
dic = {1,3,5,7,8,10,12}

s = input()


y1 = int(s[:2])
m1 = int(s[2:])

fl = 0
fl2 = 0

if y1>0:
    if m1>0 and m1<=12:
        fl = 1
if m1>0:
    if y1>0 and y1<=12:
        fl2 = 1


if fl==0 and fl2==0:
  print("NA")
else:
  if fl==0:
    print("MMYY")
  elif fl2==0:
    print("YYMM")
  else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
dic = {1,3,5,7,8,10,12}

s = input()


d1 = int(s[:2])
m1 = int(s[2:])

fl = 0

if m1>0 and m1<=12:
  if m1 in dic:
    if d1>=1 and d1<=31:
      fl = 1
  else:
    if m1 == 2:
      if d1>=1 and d1<=29:
        fl = 1
    else:
      if d1>=1 and d1<=30:
        fl = 1
d1,m1 = m1,d1

fl2 = 0

if m1>0 and m1<=12:
  if m1 in dic:
    if d1>=1 and d1<=31:
      fl2 = 1
  else:
    if m1 == 2:
      if d1>=1 and d1<=29:
        fl2 = 1
    else:
      if d1>=1 and d1<=30:
        fl2 = 1
if fl==0 and fl2==0:
  print("NA")
else:
  if fl==0:
    print("MMYY")
  elif fl2==0:
    print("YYMM")
  else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
def checkMM(i):
    if i >= 1 and i <= 12:
        result = 1
    else:
        result = 0
    return result

def checkYY(i):
    if i >= 0 and i <= 99:
        result = 1
    else:
        result = 0
    return result


s = input()

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

result = 'NA'

if checkMM(s1) and checkYY(s2):
    result = 'MMYY'

if checkYY(s1) and checkMM(s2):
    if result == 'MMYY':
        result = 'AMBIGUOUS'
    else:
        result = 'YYMM'

print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

ZEN = int(S[:2])
KOU = int(S[2:])
MM = list(range(1,13))
YY = list(range(25))

if ZEN in MM and KOU in MM:
    print("AMBIGUOUS")
elif ZEN in MM and KOU in YY:
    print("MMYY")
elif ZEN in YY and KOU in MM:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

if int(s[:2]) >= 13 and int(s[2:]) >= 13:
    print('NA')

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

Submission status: Wrong Answer

Solution code:
s = input()

if (int(s[:2]) >= 13 and int(s[2:]) >= 13) or s[:2] == '00' or s[2:] == '00':
    print('NA')

elif int(s[2:]) >= 13:
    print('MMYY')
elif int(s[:2]) >= 13:
    print('YYMM')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
s=input()
year=int(s[:2])
month=int(s[2:])
judge_YYMM=False
judge_MMYY=False
if 0<=year and 1<=month<=12:
        judge_YYMM=True
        if 0<=month and 1<=year<=12:
                judge_MMYY=True
if judge_MMYY and judge_YYMM:
        print("AMBIGUOUS")
elif judge_YYMM and judge_MMYY==False:
        print("YYMM")
elif judge_MMYY and judge_YYMM==False:
        print("MMYY")
else:
     print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
year=int(s[:2])
month=int(s[2:])
judge_YYMM=False
judge_MMYY=False
judge_YYMM==True if 1<=month<=12 else judge_YYMM==False
judge_MMYY==True if 1<=year<=12 else judge_MMYY==False
if judge_YYMM:
        if judge_MMYY:
                print("AMBIGUOUS")
        else:
                print("YYMM")
else:
        if judge_MMYY:
                print("MMYY")
        else:
                print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
year=int(s[:2])
month=int(s[2:])
judge_YYMM=False
judge_MMYY=False
if 0<year and 0<month<=12:
        judge_YYMM=True
        if 0<month and 0<year<=12:
                judge_MMYY=True
if judge_MMYY and judge_YYMM:
        print("AMBIGUOUS")
elif judge_YYMM and judge_MMYY==False:
        print("YYMM")
elif judge_MMYY and judge_YYMM==False:
        print("MMYY")
else:
     print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
year=s[:2]
month=s[2:]
if year=="00" or month=="00":
        print("WA")
elif year!="00" and "00"<month<="12":
        print("YYMM")
else:
        print("AMBIGUOUS")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = int(input())

a = int(s/100)
b = s % 100

fa, fb = False, False
if a in range(1, 13):
    fa = True

if b in range(1, 13):
    fb = True

if fa and fb:
    print('AMBIGUOUS')
elif fa and not fb:
    print('MMYY')
elif not fb and fa:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = int(input())

a = int(s/100)
b = s % 100

fa, fb = False, False
if a in range(1, 13):
    fa = True

if b in range(1, 13):
    fb = True

if fa and fb:
    print('AMBIGUOUS')
elif fa and not fb:
    print('MMYY')
elif not fb and fa:
    print('YYMM')
else:
    print('NO')

Submission status: Wrong Answer

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

if S1 <= 12 and S2 <= 12:
	print('AMBIGUOUS')
elif S1 <= 12:
	print('MMYY')
elif S2 <= 12:
	print('YYMM')
else:
	print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
a = int(s[:2])
b = int(s[2:])
f_yymm = False
f_mmyy = False

if 1 <= a <= 12:
  f_yymm = True
if 1 <= b <= 12:
  f_mmyy = True
    
if f_yymm and f_mmyy:
  print("AMBIGUOUS")
elif f_yymm and (not f_mmyy):
  print("YYMM")
elif (not f_yymm) and f_mmyy:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
a = list(input())

A = a[0]+a[1]
B = a[2]+a[3]

if A == "00" or int(A) > 12:
  if B == "00" or int(B) > 12:
    print("NA")
  else:
    print("YYMM")
else:
  if B == "00" or int(B) > 12:
    print("MMYY")
  else:
    print("AMBIGOUS")

Submission status: Wrong Answer

Solution code:
S = input()
flag1 = True
flag2 = True
num = int(S)

if S.startswith("00") or S.endswith("00"):
    flag1 = False
    flag2 = False
if num // 100 > 12:
    flag1 = False
if num % 100 > 12:
    flag2 = False
    
if flag1 == True and flag2 == True:
    print("AMBIGUOUS")
elif flag1 == False and flag2 == False:
    print("NA")
elif flag1 == False:
    print("YYMM")
else:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
s = list(input())
s = [int(i) for i in s]

former = s[0] * 10 + s[1]
latter = s[2] * 10 + s[3]

formflg = 0
lattflg = 0


if former <= 12:
	formflg = 1
	
if latter <= 12:
	lattflg = 1
	

if formflg + lattflg == 0:
	print("NA")
elif formflg + lattflg == 2:
	print("AMBIGUOUS")
elif formflg == 1:
	print("MMYY")
elif lattflg == 1:
	print("YYMM")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = list(input())
a,b = int(n[0]+n[1]),int(n[2]+n[3])
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")

Submission status: Wrong Answer

Solution code:
n = list(map(int,input()))
a,b = n[0]+n[1],n[2]+n[3]
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")

Submission status: Wrong Answer

Solution code:
s = input()
head = int(s[:2])
tail = int(s[2:])

head_is_month = False
head_is_year = False
tail_is_month = False
tail_is_year = False
if head <= 12 and head >= 1:
    head_is_month = True
if head >= 1:
    head_is_year = True
if tail <= 12 and tail >= 1:
    tail_is_month = True
if tail >= 1:
    tail_is_year = True

YYMM = False
MMYY = False
if head_is_year and tail_is_month:
    YYMM = True
if tail_is_year and head_is_month:
    MMYY = True

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

Submission status: Wrong Answer

Solution code:
s = int(input())
 
a = int(s / 100) #百の位と千の位
b = s - a*100 #下二桁

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

Submission status: Wrong Answer

Solution code:
s = int(input())
 
a = int(s / 100) #百の位と千の位
b = s - a*100 #下二桁

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

Submission status: Wrong Answer

Solution code:
s = int(input())

a = int(s / 100) #百の位と千の位
b = s - a*100 #下二桁

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# Your code here!
n=input()
a=int(str(n[0]+n[1]))
b=int(str(n[2]+n[3]))
if 0<a<=12:
    if b>12: 
        print("MMYY")
    else:
        print("AMBIGUOUS")
else:
    if 0<b<=12:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input_str = input()[:4]
head = int(input_str[:2])
foot = int(input_str[2:4])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input_str = input()
head = int(input_str[:2])
foot = int(input_str[2:4])

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

Submission status: Wrong Answer

Solution code:
S = input()

head, tail = int(S[0:2]), int(S[2:4])

if 1 <= head <= 12 and 1<= tail <= 12:
    print('AMBIGOUS')
elif 1<=head<=12 and 0<=tail<=99:
    print('MMYY')
elif 0<=head<=99 and 1<=tail<=12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

head, tail = S[0:2], S[2:4]

if 00 <= int(head) <= 99:
    r1 = 'Y'
    if 1 <= int(head)  <= 12:
        r1 = 'A'

if 00 <= int(tail) <= 99:
    r2 = 'Y'
    if 1 <= int(tail)  <= 12:
        r2 = 'A'

mode = (r1, r2)
if mode == ('Y', 'A'):
    print('YYMM')
elif mode == ('A', 'Y'):
    print('MMYY')
elif mode == ('A', 'A'):
    print('AMBIGOUS')
else:
    print('NA')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
input_str = input()
head = int(input_str[:2])
foot = int(input_str[2:4])

if head < 13:
	if foot > 12:
		print('MMYY')
	elif foot >= 0:
		print('AMBIGUOUS')
	else:
		print('NA')
else:
	if foot < 13 and foot > 0:
		print('YYMM')
	else:
		print('NA')

Submission status: Wrong Answer

Solution code:
input_str = input()
head = int(input_str[:2])
foot = int(input_str[2:4])

if head < 13:
	if foot > 12:
		print('MMYY')
	elif foot > 0:
		print('AMBIGUOUS')
	else:
		print('NA')
else:
	if foot < 13 and foot > 0:
		print('YYMM')
	else:
		print('NA')

Submission status: Wrong Answer

Solution code:
input_str = input()
head = int(input_str[:2])
foot = int(input_str[2:4])

if head < 13:
	if foot > 12:
		print('MMYY')
	elif foot > 0:
		print('AMBIGUOUS')
	else:
		print('NA')
else:
	if foot < 12 and foot > 0:
		print('YYMM')
	else:
		print('NA')

Submission status: Wrong Answer

Solution code:
input_str = input()
head = int(input_str[:2])
foot = int(input_str[2:4])

if head < 12:
	if foot > 12:
		print('MMYY')
	elif foot > 0:
		print('AMBIGUOUS')
	else:
		print('NA')
else:
	if foot < 12 and foot > 0:
		print('YYMM')
	else:
		print('NA')

Submission status: Wrong Answer

Solution code:
S = input()

s1 = S[0] + S[1]
s2 = S[2] + S[3]


if int(s1) > 12 and int(s2) > 12 or int(s1) == 0 or int(s2) == 0:
    print("NA")

elif 1 <= int(s1) <= 12 and int(s2) > 12:
    print("MMYY")

elif 1 <= int(s2) <= 12 and int(s1) > 12:
    print("YYMM")

else:
    print("AMBIGUOUS")