Blue Promenades

A promenade of length L (L ≥ 0) in a directed unweighted graph G is a sequence of vertices (v0, v1, ..., vL) with the properties:
A. Pair (vk, vk+1) is an edge in G for each k = 0, 1, ..., L−1.    B. Any vertex might appear more times in the sequence.

Let each vertex of the graph be either white or blue.



Figure 1. Examples of directed graphs with exactly one blue node in each strongly connected component.
a) The length of promenade (7, 8, 2, 0, 1, 3, 8, 4) is minimum among all promenades which contain all blue vertices. b) The length of promenade (9, 4, 5, 1, 0, 4, 5, 1, 2, 6, 7, 3) is minimum among all promenades which contain 6 blue vertices. There is no promenade containing all 7 blue vertices. c) The length of promenade (12, 13, 7, 10, 5, 4, 8) is minimum among all promenades which contain 4 blue vertices. There is no promenade containing 5 or more blue vertices.

The task

You are given a directed graph in which each strongly connected component contains exactly one blue vertex. Determine the minimum possible length of a promenade which contains maximum possible number of blue vertices.


Input

The first input line contains three integers N, B, M separated by spaces. N is the number of all vertices, B is the number of blue vertices and M is the number of edges. We suppose that vertices are labeled 0, 1, ..., N−1.
Next line contains B integers which represent a list of labels of all blue vertices. The labels are separated by spaces. The order of labels is arbitrary.
Next, there are M lines, each represents one edge. Each of these lines contains two vertex labels a, b (in this order) separated by space and representing a directed edge from a to b. The order of edges in the input is arbitrary.
It holds, 1 ≤ BN ≤ 105, 0 ≤ M ≤ 106. It is guaranteed that each strongly connected component contains exactly one blue vertex.

Output

The output is one line with two integers V, L separated by space. V is the maximum possible number of blue vertices in one promenade in the given graph. L is the minimum possible length of a promenade containing V blue vertices.

Example 1

Input
9 3 10
7 4 1
6 5
7 8
8 4
0 1
2 0
1 3
8 6
5 8
8 2
3 8
Output
3 7
The graph presented in Example 1 is depicted in Figure 1 a).

Example 2

Input
10 7 13
0 2 6 3 7 8 9
9 8
0 4
5 1
2 6
7 3
0 8
1 0
1 2
2 3
9 4
4 5
5 6
6 7
Output
6 11
The graph presented in Example 2 is depicted in Figure 1 b).

Example 3

Input
21 7 30
0 4 8 10 12 16 20
2 0
0 3
3 2
1 5
5 4
4 1
9 6
6 12
12 9
13 7
7 10
10 13
8 11
11 14
14 8
16 15
15 19
19 16
17 20
20 18
18 17
3 1
10 5
4 8
18 14
16 17
12 15
12 13
6 7
6 2
Output
4 6
The graph presented in Example 3 is depicted in Figure 1 c).

Public data

The public data set is intended for easier debugging and approximate program correctness checking. The public data set is stored also in the upload system and each time a student submits a solution it is run on the public dataset and the program output to stdout and stderr is available to him/her.
Link to public data set