This page is still under construction.

Parts of this page are still being built. What you see may change.

Practice: Roll Call

Time limit1sMemory limit128 MB

Summary
Rewrite each first and last name pair as one line in Last, First order with a case number.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

Mr. Petersworth teaches 10th grade history at True Blue High School. The principal hands him a class list with each student's first name and last name written on separate lines, which makes taking attendance slow. Mr. Petersworth wants the first name and the last name on one line instead, with the last name in front.

Write a program that rewrites the list in the format he wants.

Input

The first line contains the number of test cases.

Each test case takes two lines. The first line holds the student's first name and the second line holds the student's last name. Both names are shorter than 20 characters.

Output

For each test case, print one line in the format Case x: Last, First, where x is the case number, Last is the last name, and First is the first name.

Examples1

  1. Example 1

    Input
    5
    Tyler
    Lopez
    Alexandra
    Johnson
    Martin
    Young
    Sabrina
    Chao
    Arjun
    Gupta
    
    Expected output
    Case 1: Lopez, Tyler
    Case 2: Johnson, Alexandra
    Case 3: Young, Martin
    Case 4: Chao, Sabrina
    Case 5: Gupta, Arjun