In Ancient Berland there were n cities and m two-way roads of equal length. The cities are numbered with integers from 1 to n inclusively. According to an ancient superstition, if a traveller visits three cities ai, bi, ci in row, without visiting other cities between them, a great disaster awaits him. Overall there are k such city triplets. Each triplet is ordered, which means that, for example, you are allowed to visit the cities in the following order: ai, ci, bi. Vasya wants to get from the city 1 to the city n and not fulfil the superstition. Find out which minimal number of roads he should take. Also you are required to find one of his possible path routes.

Input

The first line contains three integers n, m, k (2 ≤ n ≤ 3000, 1 ≤ m ≤ 20000, 0 ≤ k ≤ 105) which are the number of cities, the number of roads and the number of the forbidden triplets correspondingly. 

Then follow m lines each containing two integers xi, yi (1 ≤ xi, yi ≤ n) which are the road descriptions. The road is described by the numbers of the cities it joins. No road joins a city with itself, there cannot be more than one road between a pair of cities. 

Then follow k lines each containing three integers ai, bi, ci (1 ≤ ai, bi, ci ≤ n) which are the forbidden triplets. Each ordered triplet is listed mo more than one time. All three cities in each triplet are distinct.

City n can be unreachable from city 1 by roads.

Output

If there are no path from 1 to n print -1. Otherwise on the first line print the number of roads d along the shortest path from the city 1 to the city n. On the second line print d + 1 numbers — any of the possible shortest paths for Vasya. The path should start in the city 1 and end in the city n.

Examples

Input

4 4 1
1 2
2 3
3 4
1 3
1 4 3


Output

2
1 3 4


Input

3 1 0
1 2


Output

-1


Input

4 4 2
1 2
2 3
3 4
1 3
1 2 3
1 3 4


Output

4
1 3 2 3 4
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.util.AbstractQueue;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeSet;
import java.util.ArrayList;
import java.util.AbstractCollection;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        EShortestPath solver = new EShortestPath();
        solver.solve(1, in, out);
        out.close();
    }

    static class EShortestPath {
        TreeSet<tri> ts;
        int INF = (int) 1e9;
        ArrayList<Edge>[] adjList;
        int V;
        int[][] p;
        int par;

        public void solve(int testNumber, Scanner sc, PrintWriter pw) {
            int n = sc.nextInt();
            int m = sc.nextInt();
            int k = sc.nextInt();
            V = n;
            adjList = new ArrayList[n];
            for (int i = 0; i < n; i++) adjList[i] = new ArrayList<>();
            for (int i = 0; i < m; i++) {
                int u = sc.nextInt() - 1;
                int v = sc.nextInt() - 1;
                int w = 1;
                adjList[u].add(new Edge(v, w));
                adjList[v].add(new Edge(u, w));
            }
            ts = new TreeSet<>();

            for (int i = 0; i < k; i++) {
                ts.add(new tri(sc.nextInt() - 1, sc.nextInt() - 1, sc.nextInt() - 1));
            }
            int val = dijkstra(0, n - 1);
            if (val != -1) {
                pw.println(val);
                pw.println(printpath());
            } else pw.println(-1);
        }

        int dijkstra(int S, int T) {
            int[][] dist = new int[V][V];
            p = new int[V][V];
            PriorityQueue<Edge1> pq = new PriorityQueue<Edge1>();
            dist[S][S] = 0;
            p[S][S] = -1;
            pq.add(new Edge1(new tri(-1, -1, 0), S, 0));                        //may add more in case of MSSP (Mult-Source)
            while (!pq.isEmpty()) {
                Edge1 cur = pq.remove();
                tri tmp = cur.last;
                if (cur.node == T) {
                    int min = Integer.MAX_VALUE;
                    for (int i = 0; i < V; i++) min = Math.min(min, dist[i][T] == 0 ? INF : dist[i][T]);
                    for (int i = 0; i < V; i++) if (dist[i][T] == min) par = i;

                    return min;
                    //remove if all computations are needed
                }

                for (Edge nxt : adjList[cur.node]) {
                    tri nw = new tri(tmp.b, tmp.c, nxt.node);
                    if (dist[cur.node][nxt.node] == 0 && !ts.contains(nw)) {
                        //System.out.println(nw+ " "+ts+" "+ ts.contains(nw) );
                        p[cur.node][nxt.node] = tmp.b;
                        pq.add(new Edge1(nw, nxt.node, dist[cur.node][nxt.node] = cur.cost + nxt.cost));
                    }
                }
            }
            return -1;
        }

        String printpath() {
            ArrayList<Integer> sb = new ArrayList();
            int k = V - 1;
            int pa = 0;
            while (true) {
                sb.add((k + 1));
                if (k == 0) break;
                pa = p[par][k];
                k = par;
                par = pa;
            }
            Collections.reverse(sb);
            StringBuilder ans = new StringBuilder();
            for (int x : sb) ans.append(x + " ");
            return ans.toString();
        }

        public class Edge implements Comparable<Edge> {
            int node;
            int cost;

            public Edge(int a, int b) {
                node = a;
                cost = b;
            }

            public int compareTo(Edge e) {
                return cost - e.cost;
            }

        }

        public class Edge1 implements Comparable<Edge1> {
            int node;
            int cost;
            tri last;

            public Edge1(tri x, int a, int b) {
                last = x;
                node = a;
                cost = b;
            }

            public int compareTo(Edge1 e) {
                return cost - e.cost;
            }

        }

        public class tri implements Comparable<tri> {
            int a;
            int b;
            int c;

            public tri(int a, int b, int c) {
                this.a = a;
                this.b = b;
                this.c = c;
            }

            public int compareTo(tri e) {
                return a == e.a ? b == e.b ? c - e.c : b - e.b : a - e.a;
            }

            public String toString() {
                return a + " " + b + " " + c;
            }

        }

    }

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

