TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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`.

Submission attempts (in order):
S = input()
num1 = S[:2]
num2 = S[2:]
if 0 < int(num1) <= 12 and 0 < int(num2) <= 12:
    print("AMBIGUOUS")
elif int(num1) == 0 and 12 < int(num1) <= 99 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")

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()
sf=int(s[:2])
sl=int(s[2:4])
if sf>=13 or sl<=12 and sl>0:
  print('YYMM')
elif 12>=sf>0 and sl==0:
  print('MMYY')
elif sf>12 and sl=0 or sf=0 and sl>12:
  print('AMBIGUOUS')
else:
  print('NA')

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


Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
a = int(s[:2])
b = int(s[2:])

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

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

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
ans = ""
a = int(s[0]+s[1])
b = int(s[2]+s[3])

if a == 0 and b == 0:
    ans = "NA"
elif a > 12 and b == 0:
    ans = "NA"
elif a == 0 and b > 12:
    ans = "NA"
elif a > 12 and b > 12:
    ans = "NA"
elif a < 13 and b < 13 and a != 0 and b != 0:
    ans = "AMBIGUOUS"
else:
    ans = s[2]+s[3]+s[0]+s[1]

print(ans)


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

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

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
import sys


def input():
    return sys.stdin.readline()[:-1]


# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


s = int(input())
YY = s // 100
MM = s % 100
print(YY, MM)
if 1 <= YY <= 12 and 1 <= MM <= 12:
    print("AMBIGUOUS")
elif 0 < MM <= 12:
    print("YYMM")
elif 0 < YY <= 12:
    print("MMYY")
else:
    print("NA")

import sys


def input():
    return sys.stdin.readline()[:-1]


# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


s = int(input())
YY = s // 100
MM = s % 100
print(YY, MM)
if 1 <= YY <= 12 and 1 <= MM <= 12 or 1 <= YY <= 12 and 1 <= MM <= 12:
    print("AMBIGUOUS")
elif 0 < MM <= 12:
    print("YYMM")
elif 0 < YY <= 12:
    print("MMYY")
else:
    print("NA")

import sys


def input():
    return sys.stdin.readline()[:-1]


# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}


s = int(input())
YY = s // 100
MM = s % 100
if 1 <= YY <= 12 and 1 <= MM <= 12:
    print("AMBIGUOUS")
elif 0 < MM <= 12:
    print("YYMM")
elif 0 < YY <= 12:
    print("MMYY")
else:
    print("NA")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
a = int(s[:2])
b = int(s[2:])
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if a<=12 and b<=12:
    print('AMBIGUOUS')
elif 0<a<=12 and 0<b<=days[a]:
    print('YYMM')
elif 0<b<=12 and 0<a<=days[b]:
    print('MMYY')
else:
    print('NA')


s = input()
a = int(s[:2])
b = int(s[2:])
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if a<=12 and b<=12:
    print('AMBIGUOUS')
elif a<=12 and b<=days[a]:
    print('YYMM')
elif b<=12 and a<=days[b]:
    print('MMYY')
else:
    print('NA')



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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()

a = int(s[:2])
b = int(s[2:])
if 0 < a <= 12 and 0 < b <= 12:
  print("AMBIGUOUS")
elif a > 12 or a != 0 and b > 12 or b == 0:
  print("NA")
elif a > 12 and 0 < b <= 12:
  print("YYMM")
elif 0 < a <= 12 and b > 12:
  print("MMYY")

s = input()

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
def solve():
    s = input()
    a = int(s[:2])
    if a == 0 or a > 12:
        x = "YY"
    else:
        x = "MM"
    b = int(s[2:])
    if b == 0 or b > 12:
        y = "YY"
    else:
        y = "MM"
    if x + y == "YYYY":
        print("NA")
    elif x + y == "MMMM":
        print("AMBIGUOUS")
    else:
        print(x + y)


#solve()


a, b = divmod(int(input()), 100)
x = "MM" if 0 < a < 13 else "YY"
y = "MM" if 0 < b < 13 else "YY"
print(x + y if x != y else "NA" if x == "YY" else "AMBIGUOUS")


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
a = input()
b = int(a[:2])
c = int(a[2:])
 
if b > 12 and c > 12:
  print("NA")
elif b > 12 or b == 0: 
  if c < 1:
  	print("NA")
  else:
	print("YYMM")
elif c > 12 or c == 0: 
  if b < 1:
    print("NA")
  else:
    print("MMYY")
else:
  print("AMBIGUOUS")

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
n = input()
a = int(n[0])*10 + int(n[1])
b = int(n[2])*10 + int(n[3])

s = 0
t = 0

if a > 12 or a == 0:
  s = 1
elif b > 12 or b == 0:
  t = 1

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

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

s = 0
t = 0

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



Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
YM=0
MY=0
F=int(X[0] + X[1])
B=int(X[2] + X[3])
if 0<F<=12 :
    MY += 1
else:
    pass

if 0<B<=12 :
    YM += 1
else:
    pass

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

X=input()
YM=0
MY=0
F=int(X[0] + X[1])
B=int(X[2] + X[3])
if 0<F<=12 :
    MY += 1
else:
    pass

if 0<B<=12 :
    YM += 1
else:
    pass

print(YM,MY)

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

X=input()
YM=0
MY=0
F=int(X[0] + X[1])
B=int(X[2] + X[3])
if 0<F<=12 :
    MY += 1
else:
    pass

if 0<B<=12 :
    YM += 1
else:
    pass

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = int(input())
if S[:2] > 12:
    if 13 > S[2:] > 0
        print("YYMM")
    else:
        print("NA")
elif 0 < S[:2] < 13:
    if S[2:] > 12:
        print("MMYY")
    elif 0 < S[2:] < 13:
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:#00xx
    if 0 < S[2:] <13:
        print("YYMM")
    else:
        print("NA")


S = input()
if int(S[:2]) > 12:
    if 13 > int(S[2:]) > 0:
        print("YYMM")
    else:
        print("NA")
elif 0 < int(S[:2]) < 13:
    if int(S[2:]) > 12:
        print("MMYY")
    elif 0 < int(S[2:]) < 13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:#00xx
    if 0 < int(S[2:]) <13:
        print("YYMM")
    else:
        print("NA")

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
import numpy as np
INF = float("inf")


#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
S = list(input())[:-1]
a = 10*int(S[0])+int(S[1])
b = 10*int(S[2])+int(S[3])
    print("NA")
if (a > 12 or a == 0) and (b > 12 or b == 0):
    print("NA")
elif a > 12 or a == 0:
    print("YYMM")
elif b > 12 or b == 0:
    print("MMYY")
else:
    print("AMBIGUOUS")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
import numpy as np
INF = float("inf")


#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
S = list(input())[:-1]
a = 10*int(S[0])+int(S[1])
b = 10*int(S[2])+int(S[3])
if (a > 12 or a == 0) and (b > 12 or b == 0):
    print("NA")
elif a > 12 or a == 0:
    print("YYMM")
elif b > 12 or b == 0:
    print("MMYY")
else:
    print("AMBIGUOUS")

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = list(map(int,list(input()))
a = s[0]*10+s[1]
b = s[2]*10+s[3]
lst = [1,2,3,4,5,6,7,8,9,10,11,12]
if a in lst:
    if b in lst:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if b in lst:
        print('YYMM')
    else:
        print('NA')

s = list(map(int,list(input())))
a = s[0]*10+s[1]
b = s[2]*10+s[3]
lst = [1,2,3,4,5,6,7,8,9,10,11,12]
if a in lst:
    if b in lst:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if b in lst:
        print('YYMM')
    else:
        print('NA')

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s =input()
ym=0
my=0
print(s[0:2])
print(s[2:4])
if 0<int(s[0:2]):
    ym=1
    if int(s[0:2])<=12:
        my=1
if 0<int(s[2:4]):
    my+=1
    if int(s[2:4])<=12:
        ym+=1
        
if ym==2 and my==2:
    print("AMBIGUOUS")    
elif ym==2:
    print("YYMM")
elif my ==2:
    print("MMYY")
else:
    print("NA")

s =input()
ym=0
my=0
d1=int(s[0:2])
d2=int(s[2:4])
#print(d1,d2)

if 0<=d1:
    ym+=1
    if 0<d1<13:
        my+=1

if 0<=d2:
    my+=1
    if 0<d2<13:
        ym+=1
    
if ym==2 and my==2:
    print("AMBIGUOUS")    
elif ym==2:
    print("YYMM")
elif my==2:
    print("MMYY")
else:
    print("NA")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
def judge(s):
    if int(s[0]) == 0:
        if int(s[0]) > 0:
            return 1
        else:
            return 0
    elif int(s[0]) == 1:
        if int(s[1]) <=2:
            return 1
        else:
            return 0
    else:
        return 0

S = input()
tmp = list(S)
first = ''.join([tmp[0],tmp[1]])
second = ''.join([tmp[2],tmp[3]])

flag1 = -1
flag2 = -1


flag1 = judge(second)


flag2 = judge(first)


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

def judge(s):
    if int(s[0]) == 0:
        if int(s[1]) > 0:
            return 1
        else:
            return 0
    elif int(s[0]) == 1:
        if int(s[1]) <=2:
            return 1
        else:
            return 0
    else:
        return 0

S = input()
tmp = list(S)
first = ''.join([tmp[0],tmp[1]])
second = ''.join([tmp[2],tmp[3]])

flag1 = -1
flag2 = -1


flag1 = judge(second)


flag2 = judge(first)


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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
if 0 < int(s[:1]) <= 12 and 0 < int(s[2:]) <= 12:
    print('AMBIGUOUS')
elif 0 < int(s[:1]) <= 12:
    print('MMYY')
elif 0 < int(s[2:]) <= 12:
    print('YYMM')
else:
    print('NA')

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

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

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = input()
if 13 <= int(s[0:2:]) :
    if 1 <= int(s[2::]) <= 12:
        print('YYMC')
    else:
        print('NA')
elif 1 <= int(s[0:2:]) <= 12:
    if  13 <= int(s[2::]) or int(s[2::]) == 0 :
        print('MMYY')
    else:
        print('AMBIGUOUS')
elif int(s[0:2:]) == 0:
    if 1 <= int(s[2::]) <= 12:
        print('YYMM')
    else:
        print('NA')

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()

AA = S[:2]
BB = S[2:]
a = []
for i in range(1, 13):
    if 1 <= i <= 9:
        a.append('0' + str(i))
    else:
        a.append(str(i))
print(a)

if not AA in a and not BB in a:
    print('WA')
elif AA in a and BB in a:
    print('AMBIGUOUS')
elif AA in a:
    print('MMYY')
else:
    print('YYMM')

S = input()

AA = S[:2]
BB = S[2:]
a = []
for i in range(1, 13):
    if 1 <= i <= 9:
        a.append('0' + str(i))
    else:
        a.append(str(i))
if not AA in a and not BB in a:
    print('NA')
elif AA in a and BB in a:
    print('AMBIGUOUS')
elif AA in a:
    print('MMYY')
else:
    print('YYMM')

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
import sys
a=input()
b=a[0]+a[1]
c=a[2]+a[3]
if int(b)==0 or int(c)==0:
  print('NA')
  sys.exit()
else:
  pass
if int(b)>=13 and int(c)>=13:
  print('NA')
elif int(b)>=13 and int(c)<13:
  print('MMYY')
elif int(b)<13 and int(c)>=13:
  print('YYMM')
else:
  print('AMBIGUOUS')
  
  
  

  
s=str(input())
a,b=int(s[:2]),int(s[2:])
f,g= 1<=a and a<=12, 1<=b and b<=12
if f and g:
  print("AMBIGUOUS")
elif f:
  print("MMYY")
elif g:
  print("YYMM")
else:
  print("NA")

  


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = list(input())

s_1 = int(S[0:1])
s_2 = int(S[2:])

YYMM = False
MMYY = False

if 1<=s_2<=12:
    YYMM = True
if 1<=s_1<=12:
    MMYY = True
    
if YYMM and MMYY:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')
else:
    print('NA')

S = input()

s_1 = int(S[0:1])
s_2 = int(S[2:])

YYMM = False
MMYY = False

if 1<=s_2<=12:
    YYMM = True
if 1<=s_1<=12:
    MMYY = True
    
if YYMM and MMYY:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')
else:
    print('NA')

S = input()

s_1 = int(S[0:2])
s_2 = int(S[2:])

YYMM = False
MMYY = False

if 1<=s_2<=12:
    YYMM = True
if 1<=s_1<=12:
    MMYY = True
    
if YYMM and MMYY:
    print('AMBIGUOUS')
elif YYMM:
    print('YYMM')
elif MMYY:
    print('MMYY')
else:
    print('NA')

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
f,e = int(S[:2]),int(S[2:])
if f==0 or e==0 or (f>12 and e>12):
  print('NA')
else:
  if 1<=f<=12 and e>12:
    print('MMYY')
  elif f>12 and 1<=e<=12:
    print('YYMM')
  elif 1<=f<=12, 1<=e<=12
    print('AMBIGUOUS')

S = input()
f,e = int(S[:2]),int(S[2:])
if f==0 of e==0 or (f>12 and e>12):
  print('NA')
  exit()
if 1<=f<=12:
  if e>12:
    print('MMYY')
  elif 1<=e<=12
    print('AMBIGUOUS')
elif f>12:
  if 1<=e<=12:
    print('YYMM')

S = input()
f,e = int(S[:2]),int(S[2:])
if (f > 12 or f == 0) and 0 < e <= 12:
   print('YYMM')
elif 0 < f <= 12 and (e > 12 or e == 0):
   print('MMYY')
elif 0 < f <= 12 and 0 < e <= 12:
   print('AMBIGUOUS')
else:
    print('NA')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()
yy = ["%02d" % i for i in range(100)]
mm = ["%02d" % i for i in range(1, 13)]
print(mm)
yymm = s[:2] in yy and s[2:] in mm
mmyy = s[:2] in mm and s[2:] in yy
print(["NA","MMYY","YYMM","AMBIGUOUS"][yymm*2+mmyy])


s=input()
yy = ["%02d" % i for i in range(100)]
mm = ["%02d" % i for i in range(1, 13)]
yymm = s[:2] in yy and s[2:] in mm
mmyy = s[:2] in mm and s[2:] in yy
print(["NA","MMYY","YYMM","AMBIGUOUS"][yymm*2+mmyy])


Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
def solve_128b(a, b):
    if 1 <= a & a <= 12:
        if 1 <= b & b <= 12:
            return "AMBIGUOUS"
        else:
            return "MMYY"
    else:
        if 1 <= b & b <= 12:
            return "YYMM"
        else:
            return "NA"

s = input()
s1 = int(s[0:2])
s2 = int(s[2:4])
print(solve_128b(s2, s1))

def solve_128b(a, b):
    if 1 <= a & a <= 12:
        if 1 <= b & b <= 12:
            return "AMBIGUOUS"
        else:
            return "MMYY"
    else:
        if 1 <= b & b <= 12:
            return "YYMM"
        else:
            return "NA"

s = int(input())
s2 = int(s / 100)
s1 = s % 100
print(solve_128b(s2, s1))

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
#!/usr/bin/env python3

s = str(input())

s[0:2]

s[2:]


def div(a):
    a = int(a)
    if a <= 12 and a >= 1:
        return True
    else:
        return False


if div(s[0:2]) and div(s[2:]):
    print("AMBIGUOUS")
elif not div(s[0:2]) and not div(s[2:]):
    print("NA")
elif div(s[0:2]):
    print(s)
else:
    print(s[2:]+s[:2])


#!/usr/bin/env python3

s = str(input())

a = s[0:2]

b = s[2:]


def div(a):
    a = int(a)
    if a <= 12 and a >= 1:
        return "BOTH"
    else:
        return "YY"


if div(a) == div(b):
    if div(a) == "YY":
        print("NA")
    else:
        print("AMBIGUOUS")
elif div(a) == "YY":
    print(b+a)
else:
    print(a+b)


#!/usr/bin/env python3

s = str(input())

a = s[0:2]

b = s[2:]


def div(a):
    a = int(a)
    if a <= 12 and a >= 1:
        return "BOTH"
    else:
        return "YY"


if div(a) == div(b):
    if div(a) == "YY":
        print("NA")
    else:
        print("AMBIGUOUS")
elif div(a) == "YY":
    print("YYMM")
else:
    print("MMYY")


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
if (int(S[:2]) == 0 or int(S[2:]) == 0) or (int(S[:2]) > 13 or int(S[2:]) > 13):
    print("NA")
elif int(S[:2]) < 13 and int(S[2:]) < 13:
    print("AMBIGUOUS")
elif int(S[:2]) < 13:
    print("MMYY")
else:
    print("YYMM")

S = input()

#     S = str(i).zfill(4)
#     print(S, end=":")
# print(int(S[:2]), int(S[2:]))
if (int(S[:2]) == 0 and int(S[2:]) == 0) or (int(S[:2]) == 0 and int(S[2:]) >= 13) or (int(S[:2]) >= 13 and 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]) > 0 and int(S[2:]) < 13 and int(S[2:]) > 0:
    print("AMBIGUOUS")
elif int(S[:2]) < 13 and int(S[:2]) > 0:
    print("MMYY")
else:
    print("YYMM")
    
    #     input("STOP")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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")


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")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = list(map(int, input()))

head = s[:1]
tail = s[1:]

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


s = input()

head = int(s[:2])
tail = int(s[2:])

if 0 < head <= 12 and 0 < tail <= 12:
  print("AMBIGUOUS")

elif 0 < head <= 12:
  print("MMYY")
elif 0 < tail <= 12:
  print("YYMM")
elif :
  print("NA")


s = input()

head = int(s[:2])
tail = int(s[2:])

if 0 < head <= 12 and 0 < tail <= 12:
  print("AMBIGUOUS")

elif 0 < head <= 12:
  print("MMYY")

elif 0 < tail <= 12:
  print("YYMM")

else :
  print("NA")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
a=input()
b=int(a[0]+a[1])
c=int(a[2]+a[3])
if b>12 or b==0:
  if c>12 or c==0:
    print("Na")
  elif 1<=c<=12:
    print("YYMM")
if c>12 or c==0:
  if b>12 or b==0:
    print("Na")
  elif 1<=b<=12:
    print("MMYY")
else:
  print("AMBIGUOUS")

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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s = [input()]
f = int(s[0])*10 + int(s[1])
l = int(s[2])*10 + int(s[3])

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


s = [int(i) for i in input()]
f = s[0]*10 + s[1]
l = s[2]*10 + s[3]

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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
F = int(S) // 100
B = int(S) % 100
if (F <= 12 & F > 0) & (B <= 12 & B > 0):
  print("AMBIGUOUS")
elif F <= 12 & F > 0:
  print("MMYY")
elif B <= 12 & B > 0:
  print("YYMM")
else:
  print("NA")

S = input()
F = int(S) // 100
B = int(S) % 100
print(F)
print(B)
if (F <= 12 and F > 0) and (B <= 12 and B > 0):
  print("AMBIGUOUS")
elif F <= 12 and F > 0:
  print("MMYY")
elif B <= 12 and B > 0:
  print("YYMM")
else:
  print("NA")

S = input()
F = int(S) // 100
B = int(S) % 100
if (F <= 12 and F > 0) and (B <= 12 and B > 0):
  print("AMBIGUOUS")
elif F <= 12 and F > 0:
  print("MMYY")
elif B <= 12 and B > 0:
  print("YYMM")
else:
  print("NA")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
s = str(input())
print(s[:2],s[2:])
num = ['01','02','03','04','05','06','07','08','09','10','11','12']
if s[:2] == '00' or s[2:] == '00':
    print("NA")
elif s[:2] in num and s[2:] in num:
    print("AMBIGUOUS")
elif s[:2] in num:
    print("MMYY")
elif s[2:] in num:
    print("YYMM")
else:
    print("NA")

s = str(input())
num = ['01','02','03','04','05','06','07','08','09','10','11','12']
if s[:2] in num and s[2:] in num:
    print("AMBIGUOUS")
elif s[:2] in num:
    print("MMYY")
elif s[2:] in num:
    print("YYMM")
else:
    print("NA")

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
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')

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

Verdicts: Wrong Answer

Accepted
Problem: 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`.

Submission attempts (in order):
S=input()
a=int(S[:2])
b=int(S[2:])
if 1<=a<=12 and 1<=b<=12:
  print("AMBIGUOUS")
elif 1<=a<=12:
  print("MMYY")
elif 1<=B<=12:
  print("YYMM")
else:
  print("NA")


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

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
S = input()
s_1 = S[:2]
s_2 = S[2:]

if 0 < s_1 < 13 and 0 < s_2 < 13:
  print("AMBIGUOUS")
elif 0 < s_1 < 13:
  print("MMYY")
elif 0 < s_2 < 13:
  print("YYMM")
else:
  print("NA")

S = input()
s_1 = int(S[:2])
s_2 = int(S[2:])

if 0 < s_1 < 13 and 0 < s_2 < 13:
  print("AMBIGUOUS")
elif 0 < s_1 < 13:
  print("MMYY")
elif 0 < s_2 < 13:
  print("YYMM")
else:
  print("NA")

Verdicts: Runtime Error

Accepted
Problem: 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`.

Submission attempts (in order):
s=input()
s1=int(s[:2])
s2=int(s[2:])
if 0<s1<13 and 0<s2<13:
  print("AMBIGUOUS")
if (12<s1 or s1=0) and 0<s2<13:
  print("YYMM")
if (12<s2 or s2=0) and 0<s1<13:
  print("MMYY")
else:
  print("NA")

s=input()
s1=int(s[:2])
s2=int(s[2:])
if 0<s1<13 and 0<s2<13:
  print("AMBIGUOUS")
if (12<s1 or s1==0) and 0<s2<13:
  print("YYMM")
if (12<s2 or s2==0) and 0<s1<13:
  print("MMYY")
else:
  print("NA")

s=input()
s1=int(s[:2])
s2=int(s[2:])
print(s1,s2)
if 0<s1<13 and 0<s2<13:
  print("AMBIGUOUS")
elif (12<s1 or s1==0) and 0<s2<13:
  print("YYMM")
elif (12<s2 or s2==0) and 0<s1<13:
  print("MMYY")
else:
  print("NA")

s=input()
s1=int(s[:2])
s2=int(s[2:])
if 0<s1<13 and 0<s2<13:
  print("AMBIGUOUS")
elif (12<s1 or s1==0) and 0<s2<13:
  print("YYMM")
elif (12<s2 or s2==0) and 0<s1<13:
  print("MMYY")
else:
  print("NA")

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted