Protocol buffers (or protobuf) are a flexible, efficient, automated mechanism for serializing structured data -- think XML, but smaller, faster and simpler. In this problem, we will discuss the wile-compatible problem on a simplified protocol buffer.
The first line contains an integer n indicates the number of lines of a protobuf descriptor.
The following n lines are the content of the protobuf descriptor which contains a set of messages. Each line will not contain more than 120 characters.
Then follows a line with an integer m (1≤m≤50000), indicating there are m wire-format compatibility queries.
Then follow m lines, each of which is a wire-format compatibility query with two message names.
It is guaranteed that the descriptor is valid, in other words, no two messages have the same name, no two fields in a message have the same field name or tag number, and each message type in a field must be one of the existing message names.
There will be at most 1000 messages in the descriptor, and each message will have at most 16 fields.
All tokens of the input are separated by spaces.
For each query, output one line containing "Wire-format compatible." (quotes for clarity) if the two messages in this query are wire-format compatible, or otherwise, "Wire-format incompatible." (quotes for clarity)
In the first example: