#C14155. Book Finder

    ID: 43773 Type: Default 1000ms 256MiB

Book Finder

Book Finder

You are given a collection of books and a query string. Each book is represented by its title, author, year, and ISBN. Your task is to find and output all book titles for which the query string appears either in the title or in the author's name. The matching must be case-insensitive.

Formally, for each book with title T and author A, and a query string q, you should include the book if \[ \text{lower}(q) \subseteq \text{lower}(T) \quad \text{or} \quad \text{lower}(q) \subseteq \text{lower}(A) \] where \(\text{lower}(s)\) denotes the lowercase version of string \(s\).

The output should list the matching book titles in the same order as they appear in the input. If there are no matching books, output nothing.

inputFormat

The input is read from stdin and has the following format:

  1. An integer n representing the number of books.
  2. Next n lines: each line represents a book and contains four fields separated by semicolons (;): title;author;year;ISBN.
  3. The last line contains the query string.

Note: The year and ISBN fields are provided but not used in the search.

outputFormat

Print to stdout all matching book titles, each on a separate line, in the order they appear in the input. If no book matches the query, output nothing.

## sample
4
The Great Gatsby;F. Scott Fitzgerald;1925;9780743273565
To Kill a Mockingbird;Harper Lee;1960;9780060935467
1984;George Orwell;1949;9780451524935
The Catcher in the Rye;J.D. Salinger;1951;9787543321724
george
1984