Module _20190519

    Sub Main()

        Dim sRead As String = Console.ReadLine()

        Dim arrChar() As Char = sRead.ToCharArray()

        Dim sUe As Integer = CInt(arrChar(0) & arrChar(1))
        Dim sSita As Integer = CInt(arrChar(2) & arrChar(3))

        '1=年のみ 2=両方OK
        Dim iUeFlg As Integer = 0
        Dim iSitaFlg As Integer = 0

        If sUe > 12 OrElse sUe = 0 Then

            iUeFlg = 1

        Else

            iUeFlg = 2

        End If

        If sSita > 12 OrElse sSita = 0 Then

            iSitaFlg = 1

        Else

            iSitaFlg = 2

        End If

        If iUeFlg = 2 AndAlso iSitaFlg = 2 Then

            Console.WriteLine("AMBIGUOUS")

        ElseIf iUeFlg = 1 AndAlso iSitaFlg = 2 Then

            Console.WriteLine("YYMM")

        ElseIf iUeFlg = 2 AndAlso iSitaFlg = 1 Then

            Console.WriteLine("MMYY")

        Else

            Console.WriteLine("NA")

        End If

    End Sub

End Module
