#C8848. Library Book Recommendation

    ID: 52875 Type: Default 1000ms 256MiB

Library Book Recommendation

Library Book Recommendation

You are given two lists: one representing the IDs of books that a user has already read, and another representing the IDs of all books available in the library. Your task is to output the list of books that the user has not read yet, in the same order as they appear in the library list.

Formally, given two arrays A and B, output the list { b \in B : b \notin A }. Use the following constraints:

  • Input: The input begins with an integer N representing the number of books the user has read, followed by N integers (if N is zero this line will be empty). Then, an integer M is given, followed by M integers representing the IDs of all books in the library.
  • Output: Print the unread book IDs separated by a single space. If the user has read all books, print an empty line.

The solution should read input from stdin and print the result to stdout.

inputFormat

The input format is as follows:

  1. An integer N, the number of books the user has read.
  2. A line with N space-separated integers representing the IDs of books the user has read. If N is zero, the line will be empty.
  3. An integer M, the number of books in the library.
  4. A line with M space-separated integers representing the IDs of all the books in the library.

outputFormat

Output a single line containing the IDs of books that the user has not read, in the order they appear in the library list, separated by a single space. If all books have been read, output an empty line.

## sample
3
2 3 5
5
1 2 3 4 5
1 4