International Dates

시간 제한1초메모리 제한1024 MB

요약
AA/BB/CCCC 형식의 날짜를 읽고 미국식(AA/BB)만 가능한지, 유럽식(BB/AA)만 가능한지, 둘 다 가능한지 판별합니다.
난이도

쉬움10점 중 2점

유형
구현, 수학
정답자
아직 제출이 없습니다

문제

You read a lot of documents that come from the United States, Europe, and other countries around the world. The issue is that their date formats aren’t consistent! The US formats their dates as MM/DD/YYYY while in Europe they format it as DD/MM/YYYY. That is, in the US the month comes before the day, while in Europe the day comes first. Given a date, can you determine if its definitely the US format, for sure European, or could be either? (Note that there are even more date formats, but luckily since the year is guaranteed to be last in this case, we only have to worry about these 2 formats.)

입력

The input consists of a single string comprised of 3 integers separated by forward slashes, as AA/BB/CCCCAA/BB/CCCC, where 1≤AA,BB,≤311 \le AA, BB, \le 31, and 0≤CCCC≤99990 \le CCCC \le 9999. It is guaranteed that the given string will be a valid date for at least one of the formats. You can assume that all 1212 months have exactly 3131 days, so there is no need to worry about months with 30 days, or February.

출력

Output either US if the date doesn’t conform to the European format, or EU if the date doesn’t conform to the US format. Otherwise, output either if there is no way to know for sure which format the date follows.

예제3

  1. 예제 1

    입력
    25/03/2023
    
    예상 출력
    EU
    
  2. 예제 2

    입력
    04/02/2023
    
    예상 출력
    either
    
  3. 예제 3

    입력
    07/23/1972
    
    예상 출력
    US