# 33.15.1: LAB: Parsing dates

def get_month_as_int(monthString):
    if monthString == 'January':
        month_int = 1
    elif monthString == 'February':
        month_int = 2
    elif monthString == 'March':
        month_int = 3
    elif monthString == 'April':
        month_int = 4
    elif monthString == 'May':
        month_int = 5
    elif monthString == 'June':
        month_int = 6
    elif monthString == 'July':
        month_int = 7
    elif monthString == 'August':
        month_int = 8
    elif monthString == 'September':
        month_int = 9
    elif monthString == 'October':
        month_int = 10
    elif monthString == 'November':
        month_int = 11
    elif monthString == 'December':
        month_int = 12
    else:
        month_int = 0
    return month_int
    
    
    
  # Write a program to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. The input ends with -1 on a line alone. Output each correct date as: 3/1/1990.
    

# Read input until -1
dates = []
while True:
    user_string = input()
    if user_string == '-1':
        break
    dates.append(user_string)

# Process each date
for date_str in dates:
 
        continue
    
  
    parts = date_str.split()
    
    # 3 parts: Month, Day, Year
    if len(parts) != 3:
        continue
    
    month_str, day_str, year_str = parts
    
    # remove comma from day
    if not day_str.endswith(','):
        continue
    
    day_str = day_str.rstrip(',')
    
  
    month_int = get_month_as_int(month_str)
    if month_int == 0:
        continue
    
    # valid integers
    try:
        day_int = int(day_str)
        year_int = int(year_str)
    except ValueError:
        continue
    
  
    print(f"{month_int}/{day_int}/{year_int}")


# inputs
# March 1, 1990
# April 2 1995
# 7/15/20
# December 13, 2003
# -1
