Party

No attempts yetTime limit1sMemory limit128 MB

Problem

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:

  • She never invites two people who are enemies of each other.
  • If she invites a person, she invites all of that person's friends.

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.

Input

The first line contains three integers nn, pp, and qq (2n2502 \le n \le 250, n(n1)3pn(n1)2\frac{n(n-1)}{3} \le p \le \frac{n(n-1)}{2}, 0qn(n1)60 \le q \le \frac{n(n-1)}{6}): the number of students in the class, the number of friend pairs, and the number of enemy pairs, respectively. The students are numbered 11 through nn for convenience (Jane is not included).

Each of the next pp lines contains two integers aia_i and bib_i (1ai,bin1 \le a_i, b_i \le n, aibia_i \ne b_i), meaning students aia_i and bib_i are friends. Each of the following qq lines contains two integers cic_i and did_i (1ci,din1 \le c_i, d_i \le n, cidic_i \ne d_i), meaning students cic_i and did_i are enemies. No (unordered) pair appears more than once in the input.

Output

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.