      PROGRAM YYMMorMMYY
      IMPLICIT NONE
      integer :: ant,post
      
      read'(i2i2)',ant,post
      
      
      if( 1<=ant.and.ant<=12 )then
        if( 1<=post.and.post<=12 )then
          print*,'AMBIGUOUS'
        else
          print*,'MMYY'
        end if
      else
        if( 1<=post.and.post<=12 )then
          print*,'YYMM'
        else
          print*,'NA'
        end if
      end if
      
      
      
      END PROGRAM