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.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.fill;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.sort;

public class Main {
    public static void main(String[] args) throws IOException {
        new Thread(null, new Runnable() {
            public void run() {
                try {
                    try {
                        if (new File("input.txt").exists())
                            System.setIn(new FileInputStream("input.txt"));
                    } catch (SecurityException e) {}
                    new Main().run();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }, "1", 1L << 24).start(); 
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");
    
    int N;
    int M;
    int K;
    
    Edge[] edges;
    MultiList graph;
    Set<Long> set = new HashSet<Long>();
    
    int[] queue;
    int[] dist;
    int[] prev;
    
    void run() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        
        N = nextInt();
        M = nextInt();
        K = nextInt();
        graph = new MultiList(N, 2 * M);
        edges = new Edge [2 * M + 1];

        for (int i = 0; i < M; i++) {
            int u = nextInt() - 1;
            int v = nextInt() - 1;
            edges[2 * i + 0] = new Edge(u, v);
            edges[2 * i + 1] = new Edge(v, u);
            graph.add(2 * i + 0, u, v);
            graph.add(2 * i + 1, v, u);
        }
        
        edges[2 * M] = new Edge(-1, 0);
        
        for (int i = 0; i < K; i++) {
            long a = nextInt() - 1;
            long b = nextInt() - 1;
            long c = nextInt() - 1;
            set.add(code(a, b, c));
        }
        
        queue = new int [2 * M + 1];
        dist = new int [2 * M + 1];
        prev = new int [2 * M + 1];
        
        int qH = 0;
        int qT = 0;
        queue[qT++] = 2 * M;
        
        fill(dist, -1);
        fill(prev, -1);
        dist[2 * M] = 0;
    
        int pnt = -1;
        int ans = -1;
        
        while (qH < qT) {
            int ce = queue[qH++];
            int cd = dist[ce];
            int cv = edges[ce].to;
            
            if (cv == N - 1) {
                pnt = ce;
                ans = cd;
                break;
            }
            
            int pv = edges[ce].from;
            for (int i = graph.head[cv]; i != 0; i = graph.next[i]) {
                int nv = graph.vert[i];
                if (pv != -1 && set.contains(code(pv, cv, nv)))
                    continue;
                int ne = graph.edge[i];
                if (dist[ne] == -1) {
                    dist[ne] = cd + 1;
                    prev[ne] = ce;
                    queue[qT++] = ne;
                }
            }
        }
        
        if (ans == -1) {
            out.println(-1);
            out.close();
            return;
        }
        
        out.println(ans);
        int[] stack = new int [ans + 1];
        int sz = 0;
        for (int ce = pnt; ce != -1; ce = prev[ce]) {
//          System.out.println(edges[ce]);
            stack[sz++] = edges[ce].to + 1;
        }
        
        for (int i = 0; i < sz; i++) {
            if (i > 0)
                out.print(' ');
            out.print(stack[sz - i - 1]);
        }
        out.println();
        
        out.close();
    }
    
    long code(long a, long b, long c) {
        return a * 9000000L + b * 3000L + c;
    }
    
    class MultiList {
        int[] head;
        int[] next;
        int[] edge;
        int[] vert;
        int cnt = 1;
        
        MultiList(int vNum, int eNum) {
            head = new int [vNum];
            edge = new int [eNum + 1];
            next = new int [eNum + 1];
            vert = new int [eNum + 1];
        }
        
        void add(int e, int u, int v) {
            next[cnt] = head[u];
            edge[cnt] = e;
            vert[cnt] = v;
            head[u] = cnt++;
        }
    }
    
    class Edge {
        int from;
        int to;
        
        Edge(int from, int to) {
            this.from = from;
            this.to = to;
        }
        
        @Override
        public String toString() {
            return "(" + (from + 1) + ", " + (to + 1) + ")";
        }
    }
    
    String nextToken() throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        
        return st.nextToken();
    }
    
    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    
    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    
    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    
    String nextLine() throws IOException {
        st = new StringTokenizer("");
        return in.readLine();
    }
    
    boolean EOF() throws IOException {
        while (!st.hasMoreTokens()) {
            String s = in.readLine();
            
            if (s == null) {
                return true;
            }
            
            st = new StringTokenizer(s);
        }
        
        return false;
    }
}
