PROGRAMMING:Show love and share quickly
The ancients said: show love, share quickly.
A large number of people publish a large number of photos on the Internet every day. By analyzing these photos, we can analyze the intimacy between people. If K people appear in a picture, the intimacy between them is defined as 1gk. If any two people appear in several photos at the same time, the intimacy between them is the sum of the intimacy corresponding to all the photos in the same frame. Given a group of photos below, please analyze a given couple to see if they have more intimate heterosexual friends?
###Input format:
Enter 2 positive integers in the first line: n (no more than 1000, for the total number - for simplicity, we number everyone from 0 to n-1. In order to distinguish gender, we use the minus sign before the number to indicate female) and m (no more than 1000, which is the total number of photos). Then m lines, each line gives the information of a photo, the format is as follows:
```
K P[1] ... P[K]
```
Where K ($$$Le $$500) is the number of people in the photo, and P [1] ~ p [k] is the number of these people. The last line gives the numbers a and B of a heterosexual couple. Peer numbers are separated by spaces. The title ensures that everyone has only one gender and does not appear multiple times in the same photo.
###Output format:
First, output 'a PA', where 'PA' is the closest opposite sex to 'a'. If 'PA' is not unique, it will be output incrementally according to the absolute value of their number; Then output 'B PB' similarly. However, if 'a' and 'B' are the most intimate pair, only their numbers will be output, regardless of whether there are other people juxtaposed.
###Input sample 1:
```in
10 4
4 -1 2 -3 4
4 2 -3 -5 -6
3 2 4 -5
3 -6 0 2
-3 2
```
###Output sample 1:
```out
-3 2
2 -5
2 -6
```
###Input example 2:
```in
4 4
4 -1 2 -3 0
2 0 -3
2 2 -3
2 -1 2
-3 2
```
###Output example 2:
```out
-3 2
```
answer:If there is no answer, please comment
A large number of people publish a large number of photos on the Internet every day. By analyzing these photos, we can analyze the intimacy between people. If K people appear in a picture, the intimacy between them is defined as 1gk. If any two people appear in several photos at the same time, the intimacy between them is the sum of the intimacy corresponding to all the photos in the same frame. Given a group of photos below, please analyze a given couple to see if they have more intimate heterosexual friends?
###Input format:
Enter 2 positive integers in the first line: n (no more than 1000, for the total number - for simplicity, we number everyone from 0 to n-1. In order to distinguish gender, we use the minus sign before the number to indicate female) and m (no more than 1000, which is the total number of photos). Then m lines, each line gives the information of a photo, the format is as follows:
```
K P[1] ... P[K]
```
Where K ($$$Le $$500) is the number of people in the photo, and P [1] ~ p [k] is the number of these people. The last line gives the numbers a and B of a heterosexual couple. Peer numbers are separated by spaces. The title ensures that everyone has only one gender and does not appear multiple times in the same photo.
###Output format:
First, output 'a PA', where 'PA' is the closest opposite sex to 'a'. If 'PA' is not unique, it will be output incrementally according to the absolute value of their number; Then output 'B PB' similarly. However, if 'a' and 'B' are the most intimate pair, only their numbers will be output, regardless of whether there are other people juxtaposed.
###Input sample 1:
```in
10 4
4 -1 2 -3 4
4 2 -3 -5 -6
3 2 4 -5
3 -6 0 2
-3 2
```
###Output sample 1:
```out
-3 2
2 -5
2 -6
```
###Input example 2:
```in
4 4
4 -1 2 -3 0
2 0 -3
2 2 -3
2 -1 2
-3 2
```
###Output example 2:
```out
-3 2
```
answer:If there is no answer, please comment