Jane has decided to throw a party for her classmates. Unfortunately, not everyone in the class likes each other. Most pairs of students are friends, but some are bitter enemies. Jane herself is very kind and likes every one of her classmates.
Jane knows two things. First, if she invites two people who are enemies of each other, they will fight and ruin the party. Second, whenever she invites someone, she must also invite all of that person's friends; otherwise an uninvited friend would feel hurt.
So Jane wants to choose her guests subject to these rules:
Jane wants to invite as many guests as possible. Find the maximum number of guests she can invite, and the number of different ways (sets of invited people) to achieve that maximum.
The first line contains three integers n, p, and q (2≤n≤250, 3n(n−1)≤p≤2n(n−1), 0≤q≤6n(n−1)): the number of students in the class, the number of friend pairs, and the number of enemy pairs, respectively. The students are numbered 1 through n for convenience (Jane is not included).
Each of the next p lines contains two integers ai and bi (1≤ai,bi≤n, ai=bi), meaning students ai and bi are friends. Each of the following q lines contains two integers ci and di (1≤ci,di≤n, ci=di), meaning students ci and di are enemies. No (unordered) pair appears more than once in the input.
Print two integers on a single line: the maximum number of guests Jane can invite, and the number of ways to choose that maximum number of guests.