Under construction

Still being built. Things may change

International Dates

Time limit1sMemory limit1024 MB

Summary
Given a date written as AA/BB/CCCC, decide whether it must be US format (MM/DD), must be European format (DD/MM), or could be either.
Level

Easy2 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

You read many documents from the United States, Europe, and other countries. Their date formats are not consistent. The US writes dates as MM/DD/YYYY, while Europe writes them as DD/MM/YYYY. In other words, the US puts the month before the day, and Europe puts the day first. Given a date, determine whether it is definitely in the US format, definitely in the European format, or could be either. (There are more date formats, but since the year always comes last in this case, only these 2 formats need to be considered.)

Input

The input is a single string of 3 integers separated by forward slashes, in the form AA/BB/CCCCAA/BB/CCCC, where 1≤AA,BB,≤311 \le AA, BB, \le 31 and 0≤CCCC≤99990 \le CCCC \le 9999. The given string is guaranteed to be a valid date in at least one of the two formats. Assume all 12 months have exactly 31 days, so months with 30 days and February need not be considered.

Output

Print US if the date does not follow the European format, or EU if the date does not follow the US format. If there is no way to know for sure which format the date follows, print either.

Examples3

  1. Example 1

    Input
    25/03/2023
    
    Expected output
    EU
    
  2. Example 2

    Input
    04/02/2023
    
    Expected output
    either
    
  3. Example 3

    Input
    07/23/1972
    
    Expected output
    US