#K53872. Sort Book Titles Ignoring Case
Sort Book Titles Ignoring Case
Sort Book Titles Ignoring Case
You are given a list of book titles. Your task is to sort them in alphabetical order, ignoring the differences in letter case (i.e., uppercase and lowercase letters are considered equivalent when sorting) while preserving their original case in the output.
For example, if the input list is:
The Great Gatsby to Kill a Mockingbird pride AND prejudice the Catcher IN the Rye
Then after sorting (using case-insensitive comparison) the output should be:
pride AND prejudice the Catcher IN the Rye The Great Gatsby to Kill a Mockingbird
Note: When comparing the titles, consider using the lowercase conversion \(\text{title.lower()}\) for each title. However, ensure that the output preserves the original case.
inputFormat
The input is read from standard input (stdin) and consists of:
- The first line containing an integer \(n\) (where \(n \geq 0\)) denoting the number of book titles.
- The following \(n\) lines, each containing one book title.
outputFormat
Output the sorted book titles to standard output (stdout), each on a new line, in case-insensitive alphabetical order.
## sample4
the Great Gatsby
to Kill a Mockingbird
Pride and Prejudice
the Catcher in the Rye
Pride and Prejudice
the Catcher in the Rye
the Great Gatsby
to Kill a Mockingbird
</p>