Problem:


Score : 200 points

Problem Statement

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

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

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

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

Constraints

S is a digit sequence of length 4.

Input

Input is given from Standard Input in the following format:

S

Output

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

Sample Input 1

1905

Sample Output 1

YYMM

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

Sample Input 2

0112

Sample Output 2

AMBIGUOUS

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

Sample Input 3

1700

Sample Output 3

NA

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



Sample input:
1905


Sample output:
YYMM

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
a = s[:2]
b = s[2:4]
a = int(a)
b = int(b)
ok_a = True
ok_b = True
if a == 0 or b == 0:
    print('NA')
    exit()
if a > 12: ok_a = False
if b > 12: ok_b = False
if ok_a == 1 and ok_b == 1: print('AMBIGUOUS')
elif ok_a == 1 and ok_b == 0: print('MMYY')
elif ok_a == 0 and ok_b == 1: print('YYMM')
else: print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
ans = 0
for i in range(0,3,2):
  if s[i] == "0" and s[i+1] == "0":
    break
  elif s[i] == "0":
    ans += i+1
  elif (s[i] == "1" and s[i+1] == "0") or (s[i] == "1" and s[i+1] == "1") or (s[i] == "1" and s[i+1] == "2"):
    ans += i+1
if ans == 1:
  print("MMYY")
elif ans == 3:
  print("YYMM")
elif ans == 4:
  print("AMBIGUOUS")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)

#a = int(input())
#b = list(map(int, input().split()))
#n, m = map(int, input().split())
s = input()
#s,t = input().split()
#a = [int(input()) for _ in range(n)]
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

l = [i for i in range(13)]
l = [str(i) if len(str(i))==2 else '0'+str(i) for i in l]

if s[:2] not in l and s[2:] not in l:
    print('NA')
elif s[:2] not in l and s[2:] in l:
    print('YYMM')
elif s[:2] in l and s[2:] not in l:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
print("{} {}".format(s[0:2],s[2:4]))
s1 = int(s[0:2])
s2 = int(s[2:4])

s1m = False
s1y = False
s2m = False
s2y = False
if s1 <= 12 and s1 >= 1:
  s1y = True
  s1m = True
elif s1 > 12 or s1 == 0:
  s1y = True
  
if s2 <= 12 and s2 >= 1:
  s2y = True
  s2m = True
elif s2 > 12  or s2 == 0:
  s2y = True

if s1y and s2y and s1m and s2m:
  print("AMBIGUOUS")
elif s1y and s2m :
  print("YYMM")
elif s2y and s1m :
  print("MMYY")
else :
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

s1 = int(s[0:2])
s2 = int(s[2:4])

s1m = False
s1y = False
s2m = False
s2y = False
if s1 <= 12 and s1 >= 1:
  s1y = True
  s1m = True
elif s1 > 12 :
  s1y = True
  
if s2 <= 12 and s2 >= 1:
  s2y = True
  s2m = True
elif s2 > 12 :
  s2y = True

if s1y and s2y and s1m and s2m:
  print("AMBIGUOUS")
elif s1y and s2m :
  print("YYMM")
elif s2y and s1m :
  print("MMYY")
else :
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

first_two = int(S[:2])
last_two = int(S[-2:])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())
a = s % 100
b = ((s-a) % 100)
if a <= 31 and b <= 12:
  print("YYMM")
elif a <= 12 and b <= 31:
  print("MMYY")
elif  a <= 12 and b <= 31 and a <= 31 and b <= 12:
  print("AMBIGUOUS")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
def is_y(s):
    if s[0] == "0":
        return True
    elif (s[0] == "1") and (s[1] == "0" or s[1] == "1" or s[1] == "2"):
        return True
    else:
        return False

def is_0(s):
    if s[0] == "0" and s[1] == "0":
        return True
    else:
        return False


s = list(input())
a = [s[0], s[1]]
b = [s[2], s[3]]





if is_0(a) or is_0(b):
    print("NA")
elif is_y(a) and is_y(b):
    print("AMBIGUOUS")
elif is_y(a) and (not is_y(b)):
    print("YYMM")
elif (not is_y(a)) and is_y(b):
    print("MMYY")
else:
  	print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def is_y(s):
    if s[0] == "0":
        return True
    elif (s[0] == "1") and (s[1] == "0" or s[1] == "1" or s[1] == "2"):
        return True
    else:
        return False

def is_0(s):
    if s[0] == "0" and s[1] == "0":
        return True
    else:
        return False


s = list(input())
a = [s[0], s[1]]
b = [s[2], s[3]]


if is_0(a) or is_0(b):
    print("NA")
elif is_y(a) and is_y(b):
    print("AMBIGUOUS")
elif is_y(a) and (not is_y(b)):
    print("YYMM")
elif (not is_y(a)) and is_y(b):
    print("MMYY")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def is_y(s):
    if s[0] == "0":
        return True
    elif (s[0] == "1") and (s[1] == "0" or s[1] == "1" or s[1] == "2"):
        return True
    else:
        return False

def is_0(s):
    if s[0] == "0" and s[1] == "0":
        return True
    else:
        return False

s = list(input())
a = [s[0], s[1]]
b = [s[2], s[3]]

if is_0(a) or is_0(b):
    print("NA")
elif is_y(a) and is_y(b):
    print("AMBIGUOUS")
elif is_y(a) and (not is_y(b)):
    print("YYMM")
elif (not is_y(a)) and is_y(b):
    print("MMYY")

Submission status: Wrong Answer

Solution code:
def is_y(s):
    if s[0] == "0":
        return True
    elif (s[0] == "1") and (s[1] == "0" or s[1] == "1" or s[1] == "2"):
        return True
    else:
        return False

def is_0(s):
    if s[0] == "0" and s[1] == "0":
        return True
    else:
        return False

s = list(input())
a = [s[0], s[1]]
b = [s[2], s[3]]

if is_0(a) and is_0(b):
    print("NA")
elif is_y(a) and is_y(b):
    print("AMBIGUOUS")
elif is_y(a) and (not is_y(b)):
    print("YYMM")
elif (not is_y(a)) and is_y(b):
    print("MMYY")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
try:
    s1=(input(''))
    if len(s1)!=4:
        raise ValueError
    
    check=list((s1))
    assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12)
    if int(check[0]+check[1])<=12:
        print("MMYY")
    elif int(check[2]+check[3])<=12:
        print("YYMM")
except AssertionError:
    if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12:
        print("AMBIGUOUS")
    else:
        print("NA")
except ValueError:
    print("More than four digits")

Submission status: Wrong Answer

Solution code:
try:
    s1=(input(''))
    if len(s1)==4:
        check=list((s1))
    assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12)
    if int(check[0]+check[1])<=12:
        print("MMYY")
    elif int(check[2]+check[3])<=12:
        print("YYMM")
except AssertionError:
    if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12:
        print("AMBIGUOUS")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
try:
    s1=(input(''))
    if len(s1)==4:
        check=list((s1))
    assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12)
    if int(check[0]+check[1])<=12:
        print("MMYY")
    elif int(check[2]+check[3])<=12:
        print("YYMM")
except AssertionError:
    if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12:
        print("AMBIGUOS")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
A = 15
B = 200

if A >= 13:
  price = B
elif 6 <= A <= 12:
  price = B/2
else:
  price = 0

print(price)

Submission status: Wrong Answer

Solution code:
# 126 B

s = input()

fir = int(s[:2])
sec = int(s[2:])

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

Submission status: Wrong Answer

Solution code:
def main():
    inp=input()
    ch1=int(inp[0:2])
    ch2=int(inp[2:])
    if inp[0]==0:
        ch1=int(inp[1])
    if inp[2]==0:
        ch2=int(inp[-1])
    if ch1<=12 and ch1>=1:
        if ch2<=12 and ch2>=1 and ch2<=12 and ch2>=1:
            print("AMBIGUOUS")
            return
        elif ch2<=12 or ch2>=1:
            print("MMYY")
            return
    if ch1>12 or ch1<1:
        if ch2<=12 and ch2>=1:
            print("YYMM")
            return
    else:
        print("NA")
        return
main()

Submission status: Wrong Answer

Solution code:
# 126 B

ent = input()
fir = int(ent[0] + ent[1])
try:
    sec = int(ent[2] + ent[3])
except Exception:
    sec = int(ent[2])


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

Submission status: Wrong Answer

Solution code:
# 126 B

ent = input()
fir = int(ent[0] + ent[1])
sec = int(ent[2] + ent[3])


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

Submission status: Wrong Answer

Solution code:
# 126 B

ent = input()
fir = int(ent[0] + ent[1])
sec = int(ent[2] + ent[3])

mm = False
yy = False

if 1 <= fir <= 12:
    mm = True
if sec > 0:
    yy = True

if (mm and yy) == True:
    print("AMBIGUOUS")
elif mm == True:
    print("MMYY")
elif yy == True:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())
f = s/100
l = s%100
if 1 <= f and f <= 12:
    if 1 <= l and l <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= l and l <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    S = readline().strip()
    x = int(S[:2])
    y = int(S[2:])

    if 1 <= x <= 12:
        if 1 <= y <= 12:
            print('AMBIGUOUS')
        elif y > 12:
            print('MMYY')
        else:
            print('NA')
    else:
        if 1 <= y <= 12:
            print('YYMM')
        else:
            print('NA')

    return


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
z = input()
x = int(z[:2])
y = int(z[2:])

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

Submission status: Wrong Answer

Solution code:
z = input()
x = int(z[:2])
y = int(z[2:])

if ( x == 0 and y == 0) or ( x> 12 and y > 12):
      print("NA")
elif (x <= 12):
      if (y<= 12):
            print("AMBIGOUS")
      else:
            print("MMYY")
else:
      print("YYMM")

Submission status: Wrong Answer

Solution code:
S = input()

ans = 'NA'
L = int(S[ : 2])
R = int(S[2 :])

if L > 12 and 13 > R > 0:
    ans = 'YYMM'
elif  13 > L > 0 and R > 12:
    ans = 'MMYY'
elif 13 > L > 0 and 13 > R > 0:
    ans = 'AMBIGUOUS'

print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())

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

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

Submission status: Wrong Answer

Solution code:
s = list(input())

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=(input())
s1=int(s[:2])
s2=int(s[2:])
g = ""
if 1<= s1 <=12 and 1<= s2 <= 12:
    g = "AMBIGUOUS"
 
if 0<= s1 <=99 and 1<= s2 <= 12:
    g = "YYMM"
 
if 1<= s1 <=12 and 0<= s2 <= 99:
    g = "MMYY"
 
else:
    g = "NA"

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
c = input()
c = [int(c[0] + c[1]),int(c[2] + c[3])]
g = ""
if c[0] > 12 and c[1] < 13 and c[1] != 0:
    g = "YYMM"
if c[0] < 13 and c[1] > 12 and c[0] != 0:
    g = "MMYY"
if c[0] < 13 and c[1] < 13:
    g = "AMBIGUOUS"
if c[0] < 1 or c[1] < 1 or c[1] > 12 and c[0] > 12:
    g = "NA"
print(g)

Submission status: Wrong Answer

Solution code:
def main():
    s=input()
    s1=int(s[:2])
    s2=int(s[2:])
    yymm = 0 < s1 and 1 <= s2 <= 12
    mmyy = 1 <= s1 <= 12 and 0 < s2
    if yymm and mmyy:
        print("AMBIGUOUS")
    elif yymm:
        print("YYMM")
    elif mmyy:
        print("MMYY")
    else:
        print("NA")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[:2])
s2=int(s[2:])

if 1<=s1<=12 and 1<=s2<=12:
  print("AMBIGUOUS")
elif 0<=s1<=99 and 1<=s2<=12:
  print("YYMM")
elif 1<=s1<=12 and 0<=s2<=99:
  print("MYYY")
else:
  print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
a = int(n[0:2])
b = int(n[2:])
if a > 12 and b > 12:
  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:
n = input()
a = int(n[0:2])
b = int(n[3:])
if a > 12 and b > 12:
  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:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    s = input()[:-1].decode()
    l = int(s[:2])
    r = int(s[2:])
    if l >= 13 and 1 <= r <= 12:
        print('YYMM')
    elif 1 <= l <= 12 and r >= 13:
        print('MMYY')
    elif 1 <= l <= 12 and 1 <= r <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Wrong Answer

Solution code:
S = input()
ls = list(S)
lsa = [ls[0],ls[1]]
lsb = [ls[2],ls[3]]

a = int(''.join(lsa))
b = int(''.join(lsb))

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

Submission status: Wrong Answer

Solution code:
S = input()
ls = list(S)
lsa = [ls[0],ls[1]]
lsb = [ls[2],ls[3]]

a = int(''.join(lsa))
b = int(''.join(lsb))

print(a,b)

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

Submission status: Wrong Answer

Solution code:
S = input()
ls = list(S)
lsa = [ls[0],ls[1]]
lsb = [ls[2],ls[3]]

a = int(''.join(lsa))
b = int(''.join(lsb))

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

Submission status: Wrong Answer

Solution code:
S = input()
ls = list(S)
lsa = [ls[0],ls[1]]
lsb = [ls[2],ls[3]]

a = int(''.join(lsa))
b = int(''.join(lsb))

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

Submission status: Wrong Answer

Solution code:
s = input()
n1 = int(s[0:2])
n2 = int(s[2:4])

flag1 = False
flag2 = False
if n1 >= 1 and n2 >= 1 and n2 <= 12:
    flag1 = True
if n1 >= 1 and n1 <= 12 and n2 >= 1:
    flag2 = True

if flag1 and flag2:
    print('AMBIGUOUS')
elif flag1:
    print('YYMM')
elif flag2:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
sh = int(s[:2])
se = int(s[2:])
ans = "YYMM" if sh > 12 else ("MMYY" if se > 12 else ("NA" if (sh + se) == 0 else "AMBIGUOUS"))
if sh == 0 or se == 0:
    ans = "NA"
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Submission status: Wrong Answer

Solution code:
import sys, math, itertools, collections, bisect 
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Submission status: Wrong Answer

Solution code:
s = input()

l = int(s[0:2])
r = int(s[2:4])

if l == 00 or r == 00:
    print("NA")
elif l <= 12 and r <= 12:
    print("AMBIGUOUS")
elif l > 12 and r < 13:
    print("YYMM")
elif l < 13 and r > 12:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
import sys
S = str(input())

if (S[0]+S[1]) == "00" or (S[2]+S[3]) == "00":
  print("NA")
  sys.exit()

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

Submission status: Wrong Answer

Solution code:
import math
def ips():return input()
def ip():return int(input())
def inp():return map(int,input().split())
def inpstr():return map(str,input().split())
def linp():return list(map(int,input().split()))
def linpstr():return list(map(str,input().split()))

s=ips()
first=int(s[:2])
second=int(s[2:])
if first<=12 and second<=12 and first>0 and second>0:print("AMBIGUOUS")
elif first<=12 and first>0 and second>12:print("MMYY")
elif first>12 and second<=12 and second>0:print("YYMM")
else:print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
pre, lat = int(S[0:2]), int(S[2:4])
pre_M = 1 <= pre <= 12
lat_M = 1 <= pre <= 12
if pre_M and lat_M:
  print("AMBIGUOUS")
elif pre_M:
  print("MMYY")
elif lat_M:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    a=s[:2]
    b=s[2:]
    if (a=="00" or 12<int(a)<100) and (1<= int(b)<=12):
        print("YYMM")
    elif (1<= int(a)<=12) and (a=="00" or 12<int(b)<100):
        print("MMYY")
    elif ((1<= int(a)<=12) and (0<=int(b)<13) )or ((1<= int(b)<=12) and (0<=int(a)<13)):
        print("AMBIGUOUS")
    else:
        print("NA")
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop

s=input()

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

fa=False
fb=False
if 1 <= a <= 12:
    fa=True
if 1 <= b <= 12:
    fb=True
    
if fa:
    if fb:
        ans="AMBIGUOUS"
    else:
        ans="MMYY"
else:
    if fb:
        ans="YYMM"
    else:
        ans="NA"
    
print(ans)

Submission status: Wrong Answer

Solution code:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop

s=input()

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

fa=False
fb=False
if 1 <= a <= 12:
    fa=True
if 1 <= b <= 12:
    fb=True
    
ans="NA"
if fa and (not fb):
    ans="MMYY"
if (not fa) and fb:
    ans="YYMM"
if fa and fb:
    ans="AMBIGUOUS"
    
print(ans)

Submission status: Wrong Answer

Solution code:

def s0():return input()
def s1():return input().split()
def s2(n):return [input() for x in range(n)]
def s3(n):return [input().split() for _ in range(n)]
def s4(n):return [[x for x in s] for s in s2(n)]
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]
def t3(n):return [tuple(int(x) for x in input().split()) for _ in range(n)]
def p0(b,yes="Yes",no="No"): print(yes if b else no)
# from sys import setrecursionlimit
# setrecursionlimit(1000000)
# from collections import Counter,deque,defaultdict
# import itertools
# import math
# import networkx as nx
# from bisect import bisect_left,bisect_right
# from heapq import heapify,heappush,heappop

s=input()

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

fa=False
fb=False
if 1 <= a <= 12:
    fa=True
if 1 <= b <= 12:
    fb=True
    
if fa and (not fb):
    ans="MMYY"
elif (not fa) and fb:
    ans="YYMM"
elif fa and fb:
    ans="AMBIGUOUS"
else:
    ans="NA"
    
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
F = int(S[:2])
L = int(S[2:])

if (F >= 13 and L >= 13) or (F == 0 and L == 0):
    print('NA')
elif F >= 13 or F == 0:
    print('YYMM')
elif L >= 13 or L == 0:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
F = int(S[:2])
L = int(S[2:])

if (F >= 13 and L >= 13) or (F == 0) or (L == 0):
    print('NA')
elif F >= 13:
    print('YYMM')
elif L >= 13:
    print('MMYY')
else:
    print('AMBIGUOUS')