AtCoder Beginner Contest 126
B
YYMM or MMYY
AtCoder
未评级
原题
← AC →
翻译中…

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.

翻译中…

样例

Input #1
1905
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.
Input #2
0112
Output #2
AMBIGUOUS
Both December $XX01$ and January $XX12$ are valid dates. Thus, this string is valid in both formats.
Input #3
1700
Output #3
NA
Neither $0$ nor $17$ is valid as a month. Thus, this string is valid in neither format.
题目信息
题号
abc126_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。