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-----
1905

-----Sample Output-----
YYMM

May XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.
[{"code": "s=input()\ns1=int(s[0]+s[1])\ns2=int(s[2]+s[3])\nif (0<s1<13)and(0<s2<13):\n    print(\"AMBIGUOUS\")\nelif (0<s1<13):\n    print(\"MMYY\")\nelif (0<s2<13):\n    print(\"YYMM\")\nelse:\n    print(\"NA\")", "passed": true, "time": 0.28, "memory": 14180.0, "status": "done"}, {"code": "s=input()\nif 0 < int(s[:2]) <= 12 and 0 < int(s[2:]) <= 12:\n  print('AMBIGUOUS')\nelif 0 < int(s[:2]) <= 12 and int(s[2:]) >= 0:\n  print('MMYY')\nelif 0 < int(s[2:]) <= 12 and int(s[:2]) >= 0:\n  print('YYMM')\nelse:\n  print('NA')", "passed": true, "time": 0.15, "memory": 14140.0, "status": "done"}, {"code": "s=str(input())\nif 1<=int(s[:2])<=12 and 1<=int(s[2:])<=12:\n  print(\"AMBIGUOUS\")\nelif 1<=int(s[:2])<=12:\n  print(\"MMYY\")\nelif 1<=int(s[2:])<=12:\n  print(\"YYMM\")  \nelse:\n  print(\"NA\")\n", "passed": true, "time": 0.15, "memory": 14212.0, "status": "done"}, {"code": "def is_month(x):\n  if 1 <= x <= 12:\n    return True\n  else:\n    return False\n\nS = input()\nfirst, latter = is_month(int(S[:2])), is_month(int(S[2:]))\nif first and latter:\n  ans = \"AMBIGUOUS\"\nelif not first and not latter:\n  ans = \"NA\"\nelif first:\n  ans = \"MMYY\"\nelse:\n  ans = \"YYMM\"\nprint(ans)", "passed": true, "time": 0.17, "memory": 14316.0, "status": "done"}, {"code": "S = str(input())\nL = int(S[0])*10 + int(S[1]) \nR = int(S[2])*10 + int(S[3]) \n\nif 12 >= L >= 1:\n    if 12 >= R >= 1:\n        print('AMBIGUOUS')\n        return\n    print('MMYY')\n    return\n\nelse:\n    if 12 >= R >= 1:\n        print('YYMM')\n        return\n    print('NA')\n    return", "passed": true, "time": 0.23, "memory": 14068.0, "status": "done"}, {"code": "s = input()\nif s == '0000' or (int(s[:2]) >= 13 and int(s[-2:]) >= 13):\n    print('NA')\nelif 1 <= int(s[:2]) <= 12 and 1 <= int(s[-2:]) <= 12:\n    print('AMBIGUOUS')\nelif 1 <= int(s[:2]) <= 12:\n    print('MMYY')\nelif 1 <= int(s[-2:]) <= 12:\n    print('YYMM')\nelse:\n    print('NA')", "passed": true, "time": 0.16, "memory": 14336.0, "status": "done"}, {"code": "s = input()\nx = int(s[:2])\ny = int(s[2:])\nif 1 <= x <= 12 and 1 <= y <= 12:\n    a = \"AMBIGUOUS\"\nelif 1 <= x <= 12:\n    a = \"MMYY\"\nelif 1 <= y <= 12:\n    a = \"YYMM\"\nelse:\n    a = \"NA\"\nprint(a)", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "s = input()\na = int(s[:2])\nb = int(s[2:])\nif 1 <= a <= 12 and 1 <= b <= 12:\n    print('AMBIGUOUS')\nelif 1 <= a <= 12:\n    print('MMYY')\nelif 1 <= b <= 12:\n    print('YYMM')\nelse:\n    print('NA')", "passed": true, "time": 0.22, "memory": 14136.0, "status": "done"}, {"code": "S = input()\n \nif int(S[:2]) > 12 or int(S[:2]) == 0:\n  if int(S[2:]) > 12 or int(S[2:]) == 0: print('NA')\n  else: print('YYMM')\nelse:\n  if int(S[2:]) > 12 or int(S[2:]) == 0: print('MMYY')\n  else: print('AMBIGUOUS')", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "S=input()\nif 1 <= int(S[0:2]) <= 12:\n  if 1 <= int(S[2:4]) <= 12:\n    print(\"AMBIGUOUS\")\n  else:\n    print(\"MMYY\")\nelse:\n  if 1 <= int(S[2:4]) <= 12:\n    print(\"YYMM\")\n  else:\n    print(\"NA\")", "passed": true, "time": 0.22, "memory": 14212.0, "status": "done"}, {"code": "s = int(input())\nl, r = s / 100, s % 100\nif 1 <= l <= 12:\n    if 1 <= r <= 12:\n        print('AMBIGUOUS')\n    else:\n        print('MMYY')\nelif 1 <= r <= 12:\n    print('YYMM')\nelse:\n    print('NA')\n", "passed": true, "time": 0.24, "memory": 14252.0, "status": "done"}, {"code": "N = input()\nA = int(N[:2])\nB = int(N[2:])\nif (A >= 1 and A <=12):\n    if (B >= 1 and B <=12):\n        print('AMBIGUOUS')\n    else:\n        print('MMYY')\n\nelse:\n    if (B >= 1 and B <=12):\n        print('YYMM')\n    else:\n        print('NA')", "passed": true, "time": 0.27, "memory": 14072.0, "status": "done"}, {"code": "from itertools import product\ns=input()\ny=[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"]\nyy=list((x+y for x,y in product(y,repeat=2)))\nmm=[\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\"]\n\nans=\"NA\"\nif (s[0:2] in yy and s[2:4] in mm) and (s[0:2] not in mm or  s[2:4]  not in yy):\n    ans=\"YYMM\"\nelif (s[0:2] in mm and s[2:4] in yy) and (s[0:2] not in yy or  s[2:4]  not in mm):\n    ans=\"MMYY\"\nelif (s[0:2] in mm and s[2:4] in yy) and (s[0:2] in yy or  s[2:4]  in mm):\n    ans=\"AMBIGUOUS\"\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "S = input()\nmonths = set([str(i).zfill(2) for i in range(1, 13)])\n\nres = ''\nif S[:2] in months and S[2:] in months:\n    res = 'AMBIGUOUS'\nelif S[:2] in months:\n    res = 'MMYY'\nelif S[2:] in months:\n    res = 'YYMM'\nelse:\n    res = 'NA'\n\nprint(res)", "passed": true, "time": 0.38, "memory": 14176.0, "status": "done"}, {"code": "S = str(input())\nyear = int(S[0] + S[1])\nmonth = int(S[2] + S[3])\nif year <= 12 and year >= 1 and month >= 1 and month <= 12:\n    print('AMBIGUOUS')\nelif year >= 0 and year <= 99 and month >= 1 and month <= 12:\n    print('YYMM')\nelif year >= 1 and year <= 12 and month >= 0 and month <= 99:\n    print('MMYY')\nelse:\n    print('NA')", "passed": true, "time": 0.2, "memory": 14212.0, "status": "done"}, {"code": "import sys\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninl = lambda: [int(x) for x in sys.stdin.readline().split()]\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\n\ndef solve():\n    S = ins()\n    a = int(S[:2])\n    b = int(S[2:])\n    am = 0 < a < 13\n    bm = 0 < b < 13\n    if am and bm:\n        return \"AMBIGUOUS\"\n    elif am:\n        return \"MMYY\"\n    elif bm:\n        return \"YYMM\"\n    else:\n        return \"NA\"\n\n\nprint(solve())\n", "passed": true, "time": 0.14, "memory": 14416.0, "status": "done"}, {"code": "s = input()\ns1 = s[:2]\ns2 = s[2:4]\nr = int(s2)\nl = int(s1)\n\nif(1<=r<=12 and 1<=l<=12):\n    print(\"AMBIGUOUS\")\nelif((r > 12 or r == 0) and 1 <= l <= 12):\n    print(\"MMYY\")\nelif((l >= 12 or l == 0) and 1 <= r <= 12):\n    print(\"YYMM\")\nelse:\n    print(\"NA\")\n\n\n", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "s = input()\n\nflag=[0,0]\n\nif 1<=int(s[0:2])<=12:\n    flag[0]=1\nif 1<=int(s[2:4])<=12:\n    flag[1]=1\n\nif flag==[0,0]:\n    print(\"NA\")\nif flag==[1,0]:\n    print(\"MMYY\")\nif flag==[0,1]:\n    print(\"YYMM\")\nif flag==[1,1]:\n    print(\"AMBIGUOUS\")\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "S=input()\nS_f=S[:2]\nS_b=S[2:]\n\ncom=['YYMM','MMYY','AMBIGUOUS','NA']\n\nif 1<=int(S_f)<=12:\n  if 1<=int(S_b)<=12:\n    print(com[2])\n  else:\n    print(com[1])\nelif 1<=int(S_b)<=12:\n  if 1<=int(S_f)<=12:\n    print(com[2])\n  else:\n    print(com[0])\nelse:\n  print(com[3])", "passed": true, "time": 0.15, "memory": 14200.0, "status": "done"}, {"code": "S = int(input())\n \nL = S // 100 # \u524d\u534a2\u6841\nR = S % 100 # \u5f8c\u534a2\u6841\n \nif 1 <= L <= 12:\n  if 1 <= R <= 12: print('AMBIGUOUS')\n  else: print('MMYY')\nelse:\n  if 1 <= R <= 12: print('YYMM')\n  else: print('NA')", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "S=input().strip()\na=int(S[:2])\nb=int(S[2:])\naa = a < 13 and a != 0\nbb = b < 13 and b != 0\n\nif aa and bb:\n    ans = 'AMBIGUOUS'\nelif aa and not bb:\n    ans = 'MMYY'\nelif bb and not aa:\n    ans = 'YYMM'\nelse:\n    ans = 'NA'\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "s = input().rstrip()\n\na = int(s[:2])\nb = int(s[2:])\nif 1 <= a <= 12 and 1 <= b <= 12:\n    print(\"AMBIGUOUS\")\nelif (a == 0 or 13 <= a <= 99) and 1 <= b <= 12:\n    print(\"YYMM\")\nelif 1 <= a <= 12 and (b == 0 or 13 <= b <= 99):\n    print(\"MMYY\")\nelse:\n    print(\"NA\")", "passed": true, "time": 0.22, "memory": 14248.0, "status": "done"}, {"code": "S = input()\nnum1 = int(S[:2])\nnum2 = int(S[2:])\n\nif 1 <= num1 <= 12 and 1 <=  num2 <= 12:\n    ans = \"AMBIGUOUS\"\nelif 1 <= num1 <= 12 and (num2 == 0 or 12 < num2):\n    ans = \"MMYY\"\nelif (num1 == 0 or 12 < num1) and 1 <=  num2 <= 12:\n    ans = \"YYMM\"\nelse:\n    ans = \"NA\"\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "S = input()\n\nfirst = int(S[0:2])\nlast = int(S[2:4])\n\nif (0 < first < 13):\n\tif (0 < last < 13):\n\t\tprint(\"AMBIGUOUS\")\n\telse:\n\t\tprint(\"MMYY\")\nelse:\n\tif (0 < last < 13):\n\t\tprint(\"YYMM\")\n\telse:\n\t\tprint(\"NA\")", "passed": true, "time": 0.22, "memory": 14304.0, "status": "done"}, {"code": "S = int(input())\n\nflag = [0, 0] # [YYMM, MMYY]\nl = S // 100\nr = S % 100\nif 1<=r and r<=12:\n  flag[0] += 1\nif 1<=l and l<=12:\n  flag[1] += 1\nif flag == [0, 0]:\n  print('NA')\nelif flag == [0, 1]:\n  print('MMYY')\nelif flag == [1, 0]:\n  print('YYMM')\nelif flag == [1, 1]:\n  print(\"AMBIGUOUS\")", "passed": true, "time": 0.14, "memory": 14368.0, "status": "done"}, {"code": "s = input()\n\ns1 = int(s[0]+s[1])\ns2 = int(s[2]+s[3])\n#print(s1, s2)\nL=[]\n\nfor i in range(1, 13):\n    L.append(i)\n\n\nif s1 not in L and s2 not in L:\n    print('NA')\nelif s1 in L and s2 not in L:\n    print('MMYY')\nelif s1 not in L and s2 in L:\n    print('YYMM')\nelse:\n    print('AMBIGUOUS')\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "s = input()\nhead = int(s[:2])\ntail = int(s[2:])\n\nis_mmyy = False\nis_yymm = False\n\nif 1 <= head <= 12:\n    is_mmyy = True\n\nif 1 <= tail <= 12:\n    is_yymm = True\n\nif is_yymm and is_mmyy:\n    print('AMBIGUOUS')\nelif is_yymm:\n    print('YYMM')\nelif is_mmyy:\n    print('MMYY')\nelse:\n    print('NA')\n", "passed": true, "time": 0.15, "memory": 14316.0, "status": "done"}, {"code": "s = str(input())\na = int(s[0]) * 10 + int(s[1])\nb = int(s[2]) * 10 + int(s[3])\nif 1 <= a <= 12 and 1 <= b <= 12:\n    print('AMBIGUOUS')\nelif 1 <= a <= 12:\n    print('MMYY')\nelif 1 <= b <= 12:\n    print('YYMM')\nelse:\n    print('NA')", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "s = int(input())\nb = s%100\na = (s - b)//100\nif (0 < a <= 12 and 0 < b <= 12):\n    print(\"AMBIGUOUS\")\nelif (0 < a <= 12):\n    print(\"MMYY\")\nelif (0 < b <= 12):\n    print(\"YYMM\")\nelse:\n    print(\"NA\")\n", "passed": true, "time": 0.15, "memory": 14116.0, "status": "done"}, {"code": "S=input()\nmonth=['01','02','03','04','05','06','07','08','09','10','11','12']\nyear=['00','01','02','03','04','05','06','07','08','09']\nfor i in range(10,100):\n    year.append(str(i))\n\nif month.count(S[0:2])==1 and year.count(S[2:4])==1 and month.count(S[2:4])==1 and year.count(S[0:2])==1:\n    print('AMBIGUOUS')\nelif month.count(S[2:4])==1 and year.count(S[0:2])==1:\n    print('YYMM')\nelif month.count(S[0:2])==1 and year.count(S[2:4])==1:\n    print('MMYY')\nelse:\n    print('NA')\n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "s=input()\n\ndef month(n):\n    if 1 <= n <= 12:\n        return True\n    else:\n        return False\n\n\nif int(s[0:2]) == 0:\n    if month(int(s[2:4])) :\n        print(\"YYMM\")\n        return\n    else:\n        print(\"NA\")\n        return\n\nif int(s[2:4]) == 0:\n    if month(int(s[0:2])):\n        print(\"MMYY\")\n        return\n    else:\n        print(\"NA\")\n        return\n\n\nif month(int(s[0:2])):\n    if month(int(s[2:4])):\n        print(\"AMBIGUOUS\")\n    else:\n        print(\"MMYY\")\nelse:\n    if month(int(s[2:4])):\n            print(\"YYMM\")\n    else:\n        print(\"NA\")\n", "passed": true, "time": 0.28, "memory": 14256.0, "status": "done"}, {"code": "s = input()\ns1 = int(s[:2])\ns2 = int(s[2:])\nif 1 <= s1 <= 12 and 1 <= s2 <= 12:\n    print('AMBIGUOUS')\nelif 1 <= s1 <= 12:\n    print('MMYY')\nelif 1 <= s2 <= 12:\n    print('YYMM')\nelse:\n    print('NA')", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "S = input()\nf = int(S[:2])\nl = int(S[2:])\nif f==0 or f>12:\n  if l==0 or l>12:\n    print(\"NA\")\n  else:\n    print(\"YYMM\")\nelse:\n  if l==0 or l>12:\n    print(\"MMYY\")\n  else:\n    print(\"AMBIGUOUS\")", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "n = int(input())\n\nr = n // 100\nl = n % 100\n\nif r <= 12 and 1 <= r:\n  if l <= 12 and 1 <= l:\n    print(\"AMBIGUOUS\")\n  else:\n    print(\"MMYY\")\nelse:\n  if l <= 12 and 1 <= l:\n    print(\"YYMM\")\n  else:\n    print(\"NA\")", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "\ns = input()\na=int(s[0:2])\nb=int(s[2:4])\nif 0<a<=12 and 0<b<=12:\n    print('AMBIGUOUS')\nelif 0<b<=12:\n    print('YYMM')\nelif 0<a<=12 :\n    print('MMYY')\n\nelse:\n    print('NA')\n\n", "passed": true, "time": 0.32, "memory": 14280.0, "status": "done"}, {"code": "S=list(input())\nmonth=[\"0\"+str(i) for i in range(1,10)]\nmonth.append(\"10\")\nmonth.append(\"11\")\nmonth.append(\"12\")\n\nFirst=S[:2]\nFmonthflag=0\nif \"\".join(First) in month:\n\tFmonthflag=1\n\nLatter=S[2:]\nLmonthflag=0\nif \"\".join(Latter) in month:\n\tLmonthflag=1\n\t\nif Fmonthflag==1 and Lmonthflag==0:\n\tprint(\"MMYY\")\nelif Fmonthflag==0 and Lmonthflag==1:\n\tprint(\"YYMM\")\nelif Fmonthflag==1 and Lmonthflag==1:\n\tprint(\"AMBIGUOUS\")\nelif Fmonthflag==0 and Lmonthflag==0:\n\tprint(\"NA\")", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "s = input()\n\nif 0 < int(s[:2]) <= 12 and 0 < int(s[2:]) <= 12:\n    print('AMBIGUOUS')\nelif 0 < int(s[:2]) <= 12 and int(s[2:]) >= 12:\n    print('MMYY')\nelif 0 < int(s[:2]) < 12 and int(s[2:]) == 0:\n    print('MMYY')\nelif int(s[:2]) >= 12 > 0 and 0 < int(s[2:]) <= 12:\n    print('YYMM')\nelif int(s[:2]) == 0 and 0 < int(s[2:]) <= 12:\n    print('YYMM')\nelse:\n    print('NA')", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "s = input()\na1 = int(s[:2])\na2 = int(s[2:])\nif a1 in range(1, 13):\n  if a2 in range(1, 13): print(\"AMBIGUOUS\")\n  else: print(\"MMYY\")\nelse:\n  if a2 in range(1, 13): print(\"YYMM\")\n  else: print(\"NA\")", "passed": true, "time": 0.15, "memory": 14244.0, "status": "done"}, {"code": "S = input()\n\nF = int(S[:2])\nB = int(S[2:])\n\nif F == 0 and B == 0:\n    print('NA')\nelif (F == 0 and B > 12) or (B == 0 and F > 12):\n    print('NA')\nelif F == 0:\n    print('YYMM')\nelif B == 0:\n    print('MMYY')\nelif (F <= 12 and B <= 12):\n    print('AMBIGUOUS')\nelif F > 12 and B <= 12:\n    print('YYMM')\nelif F <= 12 and B > 12:\n    print('MMYY')\nelse:\n    print('NA')\n", "passed": true, "time": 0.23, "memory": 14296.0, "status": "done"}, {"code": "s=input()\nyy = [\"%02d\" % i for i in range(100)]\nmm = [\"%02d\" % i for i in range(1, 13)]\nyymm = s[:2] in yy and s[2:] in mm\nmmyy = s[:2] in mm and s[2:] in yy\nprint(([\"NA\",\"MMYY\",\"YYMM\",\"AMBIGUOUS\"][yymm*2+mmyy]))\n", "passed": true, "time": 0.15, "memory": 14256.0, "status": "done"}, {"code": "s = list(input())\ns = [int(i+j) for (i,j) in zip(s[::2],s[1::2])]\n\nif 1 <= s[0] <= 12:\n  if 1 <= s[1] <= 12:\n    print(\"AMBIGUOUS\")\n  else:\n    print(\"MMYY\")\nelse:\n  if 1 <= s[1] <= 12:\n    print(\"YYMM\")\n  else:\n    print(\"NA\")", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "import re\n\n\ndef answer(s: str) -> str:\n    YYMM = r'^[0-9]{2}(0[1-9]|1[0-2])$'\n    MMYY = r'^(0[1-9]|1[0-2])[0-9]{2}$'\n    YYMM_result = re.match(YYMM, s)\n    MMYY_result = re.match(MMYY, s)\n\n    if YYMM_result and MMYY_result:\n        return 'AMBIGUOUS'\n    if YYMM_result:\n        return 'YYMM'\n    if MMYY_result:\n        return 'MMYY'\n    return 'NA'\n\n\ndef main():\n    s = input()\n    print((answer(s)))\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.15, "memory": 14148.0, "status": "done"}, {"code": "s = input()\nif 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]) <= 12:\n  print(\"AMBIGUOUS\")\nelif 1 <= int(s[:2]) <= 12:\n  print(\"MMYY\")\nelif 1 <= int(s[2:]) <= 12:\n  print(\"YYMM\")\nelse:\n  print(\"NA\")", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "s = str(input())\nnum = ['01','02','03','04','05','06','07','08','09','10','11','12']\nif s[:2] in num and s[2:] in num:\n    print(\"AMBIGUOUS\")\nelif s[:2] in num:\n    print(\"MMYY\")\nelif s[2:] in num:\n    print(\"YYMM\")\nelse:\n    print(\"NA\")", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "s = input()\nif s[0:2] in \"01 02 03 04 05 06 07 08 09 10 11 12\":\n  l = \"m\"\nelse:\n  l = \"y\"\nif s[2:4] in \"01 02 03 04 05 06 07 08 09 10 11 12\":\n  r = \"m\"\nelse:\n  r = \"y\"\nif l+r == \"mm\":\n  print(\"AMBIGUOUS\")\nelif l+r == \"my\":\n  print(\"MMYY\")\nelif l+r == \"ym\":\n  print(\"YYMM\")\nelse:\n  print(\"NA\")", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "def f(y, m):\n\tif y in range(1, 13) and m in range(1, 13):\n\t\treturn \"AMBIGUOUS\"\n\tif m in range(1, 13):\n\t\treturn \"YYMM\"\n\tif y in range(1, 13):\n\t\treturn \"MMYY\"\n\treturn \"NA\"\n  \nS = input()\ny, m = int(S[:2]), int(S[2:])\nprint((f(y, m)))\n  \n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "S=input()\ns1=S[0:2]\ns2=S[2:4]\nli=[\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\"]\n\nif s1 not in li:\n    a=False\nelse:\n    a=True\nif s2 not in li:\n    b=False\nelse:\n    b=True\n\nif a==b==True:\n    print(\"AMBIGUOUS\")\nelif a==b==False:\n    print(\"NA\")\nelif a==True:\n    print(\"MMYY\")\nelse:\n    print(\"YYMM\")\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "s = str(input())\ns_ov = s[:2]\ns_un = s[2:]\n\nif int(s_ov) >= 1 and int(s_ov) <= 12:\n    if int(s_un) >= 1 and int(s_un) <= 12:\n        print(\"AMBIGUOUS\")\n    else:\n        print(\"MMYY\")\nelif int(s_un) >= 1 and int(s_un) <= 12:\n    print(\"YYMM\")\nelse:\n    print(\"NA\")", "passed": true, "time": 0.23, "memory": 14296.0, "status": "done"}, {"code": "S=input()\n\ncom=['YYMM','MMYY','AMBIGUOUS','NA']\n\nif 1<=int(S[:2])<=12 and 1<=int(S[2:])<=12:\n  print(com[2])\nelif 1<=int(S[:2])<=12:\n  print(com[1])\nelif 1<=int(S[2:])<=12:\n  print(com[0])\nelse:\n  print(com[3])", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "S=input()\na=1<=int(S[:2])<=12\nb=1<=int(S[-2:])<=12\n\nif a & b: print('AMBIGUOUS')\nelif a:   print('MMYY')\nelif b:   print('YYMM')\nelse:     print('NA')", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "S = input()\n\nformer = int(S[:2])\nlatter = int(S[2:])\n\nif((former >= 13 or former == 0) and 1 <= latter <= 12):\n    print(\"YYMM\")\nif((latter >= 13 or latter == 0) and 1 <= former <= 12):\n    print(\"MMYY\")\nif(1 <= former <= 12 and 1 <= latter <= 12):\n    print(\"AMBIGUOUS\")\nif((former >= 13 or former == 0) and (latter >= 13 or latter == 0)):\n    print(\"NA\")", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "s = input()\na = s[:2]\nb = s[2:]\n\nl = [\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\"]\n\nif a in l and b in l:\n  print(\"AMBIGUOUS\")\nelif a in l and b not in l:\n  print(\"MMYY\")\nelif a not in l and b in l:\n  print(\"YYMM\")\nelse:\n  print(\"NA\")", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "S = list(input())\nx = int(\"\".join(S[0:2]))\ny = int(\"\".join(S[2:4]))\nif 1 <= x <= 12:\n    if 1 <= y <= 12:\n        print(\"AMBIGUOUS\")\n    else:\n        print(\"MMYY\")\nelse:\n    if 1 <= y <= 12:\n        print(\"YYMM\")\n    else:\n        print(\"NA\")\npass\n", "passed": true, "time": 0.23, "memory": 14096.0, "status": "done"}, {"code": "S = input()\n\nif int(S[2:]) == 0 or int(S[2:]) > 12:\n    if int(S[:2]) == 0 or int(S[:2]) > 12:\n        print('NA')\n    else:\n        print('MMYY')\nelif int(S[:2]) == 0 or int(S[:2]) > 12:\n    print('YYMM')\nelse:\n    print('AMBIGUOUS')", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "s = input()\na = int(s[0:2])\nb = int(s[2:])\n\nif 13 <= a or a == 0:\n    if 1 <= b and b <= 12:\n        print('YYMM')\n    else:\n        print('NA')\nelse:\n    \n    if 1<= b  and b<= 12:\n        print('AMBIGUOUS')\n    else:\n        print('MMYY')", "passed": true, "time": 0.23, "memory": 14172.0, "status": "done"}, {"code": "s=input()\n\nif 12<int(s[:2]) or 0==int(s[:2]):\n    if 12>=int(s[2:])>=1:\n        print(\"YYMM\")\n    else:\n        print(\"NA\")\nelif 1<=int(s[:2])<=12:\n    if 12>=int(s[2:])>=1:\n        print(\"AMBIGUOUS\")\n    else:\n        print(\"MMYY\")\n    \n", "passed": true, "time": 0.2, "memory": 14344.0, "status": "done"}, {"code": "s = input()\nans = 'NA'\nif 1 <= int(s[:2]) <= 12:\n    ans = 'MMYY'\n    if 1 <= int(s[2:]) <= 12:\n        ans = 'AMBIGUOUS'\nelif 1 <= int(s[2:]) <= 12:\n    ans = 'YYMM'\nprint(ans)", "passed": true, "time": 0.25, "memory": 14132.0, "status": "done"}, {"code": "S = input()\nMM = [\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\"]\n\nif S[:2] in MM and S[2:] in MM:\n  print(\"AMBIGUOUS\")\nelif S[:2] in MM:\n  print(\"MMYY\")\nelif S[2:] in MM:\n  print(\"YYMM\")\nelse:\n  print(\"NA\")", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "S = int(input())\nA = S//100\nB = S%100\nif 0 < A <= 12 and 0 < B <= 12:\n    print(\"AMBIGUOUS\")\nelif 0 < A <= 12:\n    print(\"MMYY\")\nelif 0 < B <= 12:\n    print(\"YYMM\")\nelse:\n    print(\"NA\")", "passed": true, "time": 0.17, "memory": 14292.0, "status": "done"}, {"code": "s = input()\na = s[:2]\nb = s[2:]\n \nl = [\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\"]\n \nif a in l and b in l:\n  print(\"AMBIGUOUS\")\nelif a in l and b not in l:\n  print(\"MMYY\")\nelif a not in l and b in l:\n  print(\"YYMM\")\nelse:\n  print(\"NA\")\n", "passed": true, "time": 0.18, "memory": 14140.0, "status": "done"}, {"code": "S=input()\nl=len(S)\nY=0\nM=0\nfor i in range(l):\n    if i==3:\n        if int(S[i-1])==0 and 1<=int(S[i])<=9:\n            Y=1\n        elif int(S[i-1])==1 and 0<=int(S[i])<=2:\n            Y=1\nfor i in range(l):\n    if i==1:\n        if int(S[i-1])==0 and 1<=int(S[i])<=9:\n            M=1\n        elif int(S[i-1])==1 and 0<=int(S[i])<=2:\n            M=1\nif Y==1 and M==1:\n    print('AMBIGUOUS')\nelif Y==1 and M==0:\n    print('YYMM')\nelif Y==0 and M==1:\n    print('MMYY')\nelif Y==0 and M==0:\n    print('NA')", "passed": true, "time": 0.18, "memory": 14348.0, "status": "done"}, {"code": "s = input()\nif 0 < int(s[:2]) <13 and 0< int(s[2:]) < 13:\n    print(\"AMBIGUOUS\")\nelif 0 < int(s[:2]) < 13:\n    print(\"MMYY\")\nelif 0 < int(s[2:]) < 13:\n    print(\"YYMM\")\nelse:\n    print(\"NA\")", "passed": true, "time": 0.18, "memory": 14244.0, "status": "done"}, {"code": "s=input()\n\nmae=int(s[:2])\nushiro=int(s[2:])\n\nif 1<=mae<=12:\n    if 1<=ushiro<=12:\n        ans=\"AMBIGUOUS\"\n    else:\n        ans=\"MMYY\"\n\nelif 1<=ushiro<=12:\n    ans=\"YYMM\"\n\nelse:\n    ans=\"NA\"\n    \nprint(ans)", "passed": true, "time": 0.14, "memory": 14320.0, "status": "done"}, {"code": "#Answer\nS = input()\nS = int (S)\nA = S // 100\nB = S % 100\n\nif 1 <= A <= 12 and 1 <= B <= 12:\n    print(\"AMBIGUOUS\")\nelif (A==0 or A > 12) and (B==0 or B > 12):\n    print(\"NA\")\nelif (A==0 or A > 12) and 1 <= B <= 12:\n    print(\"YYMM\")\nelse:\n    print(\"MMYY\")", "passed": true, "time": 0.14, "memory": 14400.0, "status": "done"}, {"code": "#ABC126 B\n\nS = list(map(int,input()))\nif 1 <= S[0]*10 + S[1] <= 12 and 1 <= S[2]*10 + S[3] <= 12:\n    print(\"AMBIGUOUS\")\nelif 1 <= S[0]*10 + S[1] <= 12 and (S[2]*10 + S[3] > 12 or S[2]*10 + S[3] == 0):\n    print(\"MMYY\")\nelif (S[0]*10 + S[1] > 12 or S[0]*10 + S[1] == 0)  and  1 <= S[2]*10 + S[3] <= 12:\n    print(\"YYMM\")\nelif (S[0]*10 + S[1] > 12 or S[0]*10 + S[1] == 0) and (S[2]*10 + S[3] > 12 or S[2]*10 + S[3] == 0):\n    print(\"NA\")", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "import sys\n\n\ndef input(): return sys.stdin.readline().strip()\ndef I(): return int(input())\ndef LI(): return list(map(int, input().split()))\ndef IR(n): return [I() for i in range(n)]\ndef LIR(n): return [LI() for i in range(n)]\ndef SR(n): return [S() for i in range(n)]\ndef S(): return input()\ndef LS(): return input().split()\n\n\nINF = float('inf')\n\n\ndef is_yymm(f, l):\n    if 1 <= l <= 12:\n        return True\n    return False\n\n\ndef is_mmyy(f, l):\n    if 1 <= f <= 12:\n        return True\n    return False\n\n\ns = S()\nf = int(s[:2])\nl = int(s[2:])\n\nif is_yymm(f, l) and is_mmyy(f, l):\n    print('AMBIGUOUS')\n\nelif is_yymm(f, l) and not(is_mmyy(f, l)):\n    print('YYMM')\n\nelif not(is_yymm(f, l)) and is_mmyy(f, l):\n    print('MMYY')\n\nelse:\n    print('NA')\n", "passed": true, "time": 0.14, "memory": 14408.0, "status": "done"}, {"code": "s = int(input())\na = s // 100\nb = s % 100\n\nif 1 <= a <= 12 and 1 <= b <= 12:\n    print(\"AMBIGUOUS\")\nelif 1 <= a <= 12:\n    print(\"MMYY\")\nelif 1 <= b <= 12:\n    print(\"YYMM\")\nelse:\n    print(\"NA\")", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "import math\n\n\ndef isMM(num):\n    if num < 13 and num > 0:\n        return True\n    else:\n        return False\n\n\ndef hantei(number):\n    num = math.floor(number/100)\n    ber = number % 100\n    if isMM(num) is False and isMM(ber) is False:\n        return \"NA\"\n    elif isMM(num) is True and isMM(ber) is True:\n        return \"AMBIGUOUS\"\n    elif isMM(num) is True and isMM(ber) is False:\n        return \"MMYY\"\n    else:\n        return \"YYMM\"\n\n\nnum = int(input())\nprint((hantei(num)))\n", "passed": true, "time": 0.14, "memory": 14392.0, "status": "done"}, {"code": "s = input()\n\ns_1 = int(s[0:2])\ns_2 = int(s[2:4])\n\nif (s_1>12 or s_1<1) and (s_2>12 or s_2<1):\n    print('NA')\nelif s_1<=12 and s_1>=1 and s_2<=12 and s_2>=1:\n    print('AMBIGUOUS')\nelif s_1<=12 and s_1>=1:\n    print('MMYY')\nelse:\n    print('YYMM')", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "s = input()\nl = s[:2]\nr = s[2:]\n\nif(int(l) >= 1 and int(l) <=12 and int(r) <= 12 and int(r) >= 1):\n    print('AMBIGUOUS')\nelse :\n    if(int(l) <= 12 and int(l) >= 1):\n        print('MMYY')\n    else:\n        if(int(r) <= 12 and int(r) >= 1):\n            print('YYMM')\n        else:\n            print('NA')\n", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "S = int(input())\n\na = int(S/100 - (S%100)/100)\nb = int(S%100)\n\nif( 0<a<13 and 0<b<13 ):\n  print(\"AMBIGUOUS\")\nif( (0<a<13 and 12<b<100) or (0<a<13 and b==0) ):\n  print(\"MMYY\")\nif( (12<a<100 and 0<b<13) or (a==0 and 0<b<13) ):\n  print(\"YYMM\")\nif( 12<a<100 and 12<b<100 ):\n  print(\"NA\")\nif( a==0 and 12<b<100 ):\n  print(\"NA\")\nif( 12<a<100 and b==0 ):\n  print(\"NA\")\nif( a==0 and b==0 ):\n  print(\"NA\")\n\n", "passed": true, "time": 0.14, "memory": 14160.0, "status": "done"}, {"code": "s = str(input())\nans = ['YYMM','MMYY','AMBIGUOUS','NA']\n#print(s[:2],s[-2:])\nif (0==int(s[:2]) or 13<=int(s[:2])) and (0==int(s[-2:]) or 13<=int(s[-2:])):\n    print((ans[3]))\nif 0<int(s[:2])<=12 and 0<int(s[-2:])<=12:\n    print((ans[2]))\nelif 0<int(s[:2])<=12:\n    print((ans[1]))\nelif 0<int(s[-2:])<=12:\n    print((ans[0]))\n\n", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "a=input()\nb=int(a[0]+a[1])\nc=int(a[2]+a[3])\nif 1<=b<=12:\n  if 1<=c<=12:\n    print(\"AMBIGUOUS\")\n  else:\n    print(\"MMYY\")\nelse:\n  if 1<=c<=12:\n    print(\"YYMM\")\n  else:\n    print(\"NA\")", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "S = input()\n\nif int(S[:2]) == 0 and 0 < int(S[2:]) <= 12:\n  print(\"YYMM\")\nelif int(S[2:]) == 0 and 0 < int(S[:2]) <= 12:\n  print(\"MMYY\")\nelif int(S[:2]) == 0 or int(S[2:]) == 0 or (int(S[:2]) > 12 and int(S[2:]) > 12):\n  print(\"NA\")\nelif int(S[:2]) > 12 and int(S[2:]) <= 12:\n  print(\"YYMM\")\nelif int(S[:2]) <= 12 and int(S[2:]) > 12:\n  print(\"MMYY\")\nelse:\n  print(\"AMBIGUOUS\")", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "s=int(input())\na=s//100\nb=s%100\nif 1<=a<=12 and 1<=b<=12:\n  print(\"AMBIGUOUS\")\nelif 1<=a<=12 and (b>12 or b==0):\n  print(\"MMYY\")\nelif (a==0 or a>12) and 1<=b<=12:\n  print(\"YYMM\")\nelse:\n  print(\"NA\")", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "n = input()\ns, t = (1 <= int(n[:2]) <= 12), (1 <= int(n[2:]) <= 12)\nprint(\"AMBIGUOUS\" if s and t else \"YYMM\" if t else \"MMYY\" if s else \"NA\")", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "S = int(input())\n\na = S//100\nb = S%100\n\nif 1<=a<=12 and 1<=b<=12:\n    print('AMBIGUOUS')\nelif 1<=a<=12 and (b>12 or b==0):\n    print('MMYY')\nelif (a==0 or a>12) and 1<=b<=12:\n    print('YYMM')\nelse:\n    print('NA')\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "S = input()\nS_front = S[:2]\nS_back = S[2:]\n\nif 0 < int(S_front) < 13:\n\tif 0 < int(S_back) < 13:\n\t\tprint(\"AMBIGUOUS\")\n\telse:\n\t\tprint(\"MMYY\")\nelse:\n\tif 0 < int(S_back) < 13:\n\t\tprint(\"YYMM\")\n\telse:\n\t\tprint(\"NA\")", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "S = str(input())\nF = S[:2]\nL = S[2:]\nif F == \"00\" or int(F)>12:\n    if L == \"00\" or int(L) > 12:\n        ans = \"NA\"\n    else:\n        ans = \"YYMM\"\nelif int(F) <= 12:\n    if int(L) >= 1 and int(L) <=12:\n        ans = \"AMBIGUOUS\"\n    else:\n        ans = \"MMYY\"    \nprint(ans)", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "S = int(input())\n\nL = S // 100 # \u524d\u534a2\u6841\nR = S % 100 # \u5f8c\u534a2\u6841\n\nif L > 12 or L == 0:\n  if R > 12 or R == 0: print('NA')\n  else: print('YYMM')\nelse:\n  if R > 12 or R == 0: print('MMYY')\n  else: print('AMBIGUOUS')", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "s = input()\n\nif 1 <= int(s[2:4]) <= 12 and 1 <= int(s[0:2]) <= 12:\n    print('AMBIGUOUS')\nelif 1 <= int(s[2:4]) <= 12:\n    print('YYMM')\nelif 1 <= int(s[0:2]) <= 12:\n    print('MMYY')\nelse:\n    print('NA')", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "s = input()\ndef YYMM(s):\n    p = int(s[2:])\n    if 1 <= p <= 12:\n        return True\n    return False\n\ndef MMYY(s):\n    p = int(s[:2])\n    if 1 <= p <= 12:\n        return True \n    return False\n\nif YYMM(s) and MMYY(s):\n    print('AMBIGUOUS')\nelif YYMM(s):\n    print('YYMM')\nelif MMYY(s):\n    print('MMYY')\nelse:\n    print('NA')", "passed": true, "time": 0.23, "memory": 14152.0, "status": "done"}, {"code": "S = input()\nl = int(S[:2])\nr = int(S[2:])\na = 0\nans = ['NA', 'MMYY', 'YYMM', 'AMBIGUOUS']\nif 0 < l and l < 13:\n  a += 1\nif 0 < r and r < 13:\n  a += 2\nprint(ans[a])", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "def check_month(month):\n    return 1 <= int(month) <= 12\n\nS = input()\n\nls = S[:2]\nrs = S[2:]\n\nif check_month(ls) and check_month(rs):\n    print('AMBIGUOUS')\nelif check_month(ls) and not check_month(rs):\n    print('MMYY')\nelif not check_month(ls) and check_month(rs):\n    print('YYMM')\nelse:\n    print('NA')", "passed": true, "time": 0.21, "memory": 14332.0, "status": "done"}, {"code": "s = list(map(int,list(input())))\na = s[0]*10+s[1]\nb = s[2]*10+s[3]\nif a == 0 and b == 0:\n    print('NA')\n    return\nif 0 < a<= 12 and (b>12 or b==0):\n    print('MMYY')\nelif (a > 12 or a==0) and 0 < b <= 12:\n    print('YYMM')\nelif a <= 12 and b <= 12:\n    print('AMBIGUOUS')\nelse:print('NA')", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "S=input()\nx=int(S[:2])\ny=int(S[2:4])\nif 1<=x<=12:\n    if 1<=y<=12:\n        print(\"AMBIGUOUS\")\n    else:\n        print(\"MMYY\")\nelse:\n    if 1<=y<=12:\n        print(\"YYMM\")\n    else:\n        print(\"NA\")", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "s=input()\n\nif 0<int(s[:2])<=12:\n    if 0<int(s[2:])<=12:\n        print('AMBIGUOUS')\n    else:\n        print('MMYY')\nelse:\n    if 0<int(s[2:])<=12:\n        print('YYMM')\n    else:\n        print('NA')\n", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "def is_YY(S):\n    N = int(S)\n    if 00 <= N <= 99:\n        return True\n    else:\n        return False\n\n\ndef is_MM(S):\n    N = int(S)\n    if 1 <= N <= 12:\n        return True\n    else:\n        return False\n\ndef __starting_point():\n    S = input()\n    top = S[:2]\n    bottom = S[2:]\n    if is_YY(top) and is_MM(top) and is_YY(bottom) and is_MM(bottom):\n        print('AMBIGUOUS')\n    elif is_YY(top) and is_MM(bottom):\n        print('YYMM')\n    elif is_MM(top) and is_YY(bottom):\n        print('MMYY')\n    else:\n        print('NA')\n__starting_point()", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "s=input()\nif int(s[0:2])>=1 and int(s[0:2])<=12:\n    if int(s[2:4])>=1 and int(s[2:4])<=12:\n        print(\"AMBIGUOUS\")\n    elif int(s[2:4])==0 or int(s[2:4])>=13:\n        print(\"MMYY\")\nelse:\n    if int(s[2:4])>=1 and int(s[2:4])<=12:\n        print(\"YYMM\")\n    else:\n        print(\"NA\")", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "s = str(input())\nans = \"NA\"\nx = int(s[0:2])\ny = int(s[2:4])\nif x>0 and x<13:\n    ans = \"MMYY\"\nif y>0 and y<13:\n    ans = \"YYMM\"\nif x>0 and x<13 and y>0 and y<13:\n    ans = \"AMBIGUOUS\"\nprint(ans)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "YYMM = list(input())\nYY = int(YYMM[0] + YYMM[1])\nMM = int(YYMM[2] + YYMM[3])\nYYMM = False\nMMYY = False\nif 1 <= MM <= 12:\n  YYMM = True\nif 1 <= YY <= 12:\n  MMYY = True\nif YYMM == True and MMYY == True:\n  print(\"AMBIGUOUS\")\nelif YYMM == True and MMYY == False:\n  print(\"YYMM\")\nelif YYMM == False and MMYY == True:\n  print(\"MMYY\")\nelif YYMM == False and MMYY == False:\n  print(\"NA\")", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "s = input()\n\nb = int(s[:2])\na = int(s[2:])\n\ndef yorm(i):\n    flag = 'none'\n    if 0<i<=12:\n        flag = 'MM'\n    elif i<100:\n        flag = 'YY'\n    return flag\n\nbf = yorm(b)\naf = yorm(a)\n   \nans = bf+af\nif len(ans) != 4:\n    ans = 'NA'\nif ans == 'MMMM':\n    ans = 'AMBIGUOUS'\nif ans == 'YYYY':\n    ans = 'NA'\nprint(ans)", "passed": true, "time": 0.15, "memory": 14072.0, "status": "done"}, {"code": "s = input()\na = 1<= int(s[:2]) <=12\nb = 1<= int(s[2:]) <=12\nif a and b:\n    print(\"AMBIGUOUS\")\nelif a:\n    print('MMYY')\nelif b:\n    print('YYMM')\nelse:\n    print('NA')", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "import re\n\ns = input()\n\n\ndef is_valid_yymm(s):\n    match = re.search('^[0-9]{2}(01|02|03|04|05|06|07|08|09|10|11|12)$', s)\n    return bool(match)\n    \n\ndef is_valid_mmyy(s):\n    match = re.search('^(01|02|03|04|05|06|07|08|09|10|11|12)[0-9]{2}$', s)\n    return bool(match)\n\n\nif is_valid_yymm(s) and is_valid_mmyy(s):\n    print('AMBIGUOUS')\nelif is_valid_yymm(s):\n    print('YYMM')\nelif is_valid_mmyy(s):\n    print('MMYY')\nelse:\n    print('NA')\n", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "S = input()\nans = [0,0]\n\nif 1<=int(S[:2]) and int(S[:2]) <= 12 :\n    ans[0] = 1\nif 1 <=int(S[2:]) and int(S[2:]) <= 12 :\n    ans[1] = 1\n\nif ans == [1,1] :\n    print('AMBIGUOUS')\nelif ans == [0,0] :\n    print('NA')\nelif ans == [0,1] :\n    print('YYMM')\nelif ans == [1,0] :\n    print('MMYY')", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "s=input()\nif 1<=int(s[:2])<=12 and 1<=int(s[2:])<=12:\n  print(\"AMBIGUOUS\")\nelif 1<=int(s[:2])<=12:\n  print(\"MMYY\")\nelif 1<=int(s[2:])<=12:\n  print(\"YYMM\")\nelse:\n  print(\"NA\")", "passed": true, "time": 0.14, "memory": 14356.0, "status": "done"}, {"code": "def YY(x):\n    if 1<=x and x<=12:\n        return True\n    else:\n        return False\nS=input()\nA=int(S[0:2])\nB=int(S[2:4])\nif YY(A) and YY(B):\n    print(\"AMBIGUOUS\")\nelif YY(A):\n    print(\"MMYY\")\nelif YY(B):\n    print(\"YYMM\")\nelse:\n    print(\"NA\")\n", "passed": true, "time": 0.14, "memory": 14260.0, "status": "done"}, {"code": "yymm = input()\n\nif (1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12) and (1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12):\n    print('AMBIGUOUS')\nelif (1 <= int(yymm[0:2]) and int(yymm[0:2]) <= 12) and int(yymm[2:4]) <= 99:\n    print('MMYY')\nelif int(yymm[0:2]) <= 99 and (1 <= int(yymm[2:4]) and int(yymm[2:4]) <= 12):\n    print('YYMM')\nelse:\n    print('NA')", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "n = list(input())\nx = int(n[0]+n[1])\ny = int(n[2]+n[3])\n\nif 1 <= x and x <= 12:\n  if 1 <= y and y <= 12:\n    print(\"AMBIGUOUS\")\n  else:\n    print(\"MMYY\")\nelif 1 <= y and y <= 12:\n  print(\"YYMM\")\nelse:\n  print(\"NA\")", "passed": true, "time": 0.14, "memory": 14368.0, "status": "done"}, {"code": "s = input()\na = s[0] + s[1]\nb = s[2] + s[3]\np = 0\nq = 0\nif a == \"01\" or a == \"02\" or a == \"03\" or a == \"04\" or a == \"05\" or a == \"06\" or a == \"07\" or a == \"08\" or a == \"09\" or a == \"10\" or a == \"11\" or a == \"12\":\n    p = 1\nif b == \"01\" or b == \"02\" or b == \"03\" or b == \"04\" or b == \"05\" or b == \"06\" or b == \"07\" or b == \"08\" or b == \"09\" or b == \"10\" or b == \"11\" or b == \"12\":\n    q = 1  \nif p == 1 and q == 1:\n    print(\"AMBIGUOUS\")\nelif p == 1 and q == 0:\n    print(\"MMYY\")\nelif p == 0 and q == 1:\n    print(\"YYMM\")\nelse:\n    print(\"NA\")", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}]