IP Addresses

No attempts yetTime limit1sMemory limit1024 MB

Problem

Mati has a website and wants to know exactly who visits it. To track visitors, Mati wrote a script that works as follows:

  • the IP addresses of all visitors seen so far are kept in a single text file;
  • whenever a new request (visitor) arrives, the program grep is used to check whether that IP address occurs in the text file (grep <newIP> <file>);
  • if no match is found, the new address is appended to the end of the file and a notification is sent to Mati;
  • otherwise, nothing is done.

An IP address is a string made of four integers, each in the range $0 \ldots 255$, separated by dots (.).

grep is a common tool for searching text files for patterns described by regular expressions. Here Mati uses grep incorrectly, because:

  • grep searches for substrings: the pattern need not start at the beginning of a line nor end at the end of a line;
  • the pattern is interpreted as a regular expression, so a dot (.) in the searched IP address can match any character in the text file (but not the other way around: a digit in the pattern does not match a dot in the file).

You are given the list of all IP addresses processed by Mati's script, in processing order. Determine which addresses Mati's script erroneously failed to add to the file.

Input

The first line contains one integer, the number of IP addresses $N$ ($1 \le N \le 1,000,000$). Each of the next $N$ lines contains one IP address. The input may contain repeated addresses; in any test, the total number of distinct addresses does not exceed $2,000$.

Output

On the first line, print the number $V$ of distinct addresses that were not added. On each of the next $V$ lines, print one of the not-added addresses, in the order of their first appearance in the input.