Under construction

Still being built. Things may change

Kick Start

Interview

Time limit1sMemory limit256 MB

Summary
Given a list of 2019 Kick Start dates and today's date, print the earliest scheduled date after today, or a message if none remain.
Level

Easy3 of 10

Topics
Implementation, Sorting, Array, String
Solved
No attempts yet

Problem

Kick Start is a global online coding competition run by Google. Participants can compete in online rounds held throughout the year, and get a chance to develop their programming skills while getting a glimpse of the technical skills needed for a career at Google.

Mr. Panda is a Kick Start enthusiast who never misses a Kick Start round in any year. He is now reading the 2019 round schedule and wonders what the date of the next Kick Start round is (excluding today). Can you help Mr. Panda find that date?

Every date in this problem is given as a month abbreviation followed by a date ordinal number. The month abbreviations are 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sept', 'Oct', 'Nov', and 'Dec'; the ordinal numbers are '1st', '2nd', '3rd', '4th', '5th', and so on.

Input

The first line of the input gives the number of test cases, TT (1≤T≤1001 \le T \le 100). TT test cases follow.

For each test case, the first line contains an integer nn (1≤n≤201 \le n \le 20), the number of scheduled Kick Start rounds for this year.

In the next nn lines, each line contains a date in the year 2019, in the format of a month abbreviation followed by a date ordinal number. The scheduled dates may not be arranged in chronological order, and all scheduled dates are distinct.

The last line contains the date of today, in the same format.

Output

For each test case, output one line containing "Case #x: y", where x is the test case number (starting from 11), and y is the date of the next Kick Start round. If there is no following Kick Start round this year, output "See you next year".

Examples1

  1. Example 1

    Input
    2
    3
    Jan 1st
    Feb 2nd
    Mar 3rd
    Jan 2nd
    8
    Mar 24th
    Apr 20th
    May 26th
    Jul 28th
    Aug 25th
    Sept 29th
    Oct 19th
    Nov 17th
    Nov 17th
    
    Expected output
    Case #1: Feb 2nd
    Case #2: See you next year