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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.*;

public class Main {
    static class Scanner{
        BufferedReader br ;
        StringTokenizer st;
        Scanner(){
            br = new BufferedReader(new InputStreamReader(System.in));
            st = new StringTokenizer("");
        }
        String next() throws IOException {
            while(!st.hasMoreElements()){
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }
        String nextLine() throws IOException{
            return br.readLine();
        }
        int nextInt() throws  IOException{
            return Integer.parseInt((next()));
        }
    }
    static class pair{
        int u,v;
        pair(int u,int v){
            this.u = u;
            this.v =v;
        }
    }
    static class triple implements Comparable<triple>{
        int u,v,w;
        public triple(int u, int v,int w) {
            this.u = u;
            this.v = v;
            this.w = w;
        }
        public String toString(){
            return u+" "+ v+" "+w;
        }

        @Override
        public int compareTo(triple o) {
            if(u!=o.u){
                return u-o.u;
            }
            else if(v!=o.v){
                return v-o.v;
            }
            else return w-o.w;
        }
    }
    static PrintWriter pw = new PrintWriter(System.out);
    public static final int inf =(int)2e9;
    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner();
        int n= sc.nextInt(),m = sc.nextInt(),k = sc.nextInt();
        arr = new LinkedList[n];
        for(int i=0;i<n;i++){
            arr[i]=new LinkedList<>();
        }
        for(int i=0;i<m;i++){
            int u = sc.nextInt()-1,v = sc.nextInt()-1;
            arr[u].add(v);
            arr[v].add(u);
        }
        forbiden = new triple[k];
        for(int i=0;i<k;i++){
            forbiden[i] = new triple(sc.nextInt()-1,sc.nextInt()-1, sc.nextInt()-1);
        }
        Arrays.sort(forbiden);
        p = new int[n][n];
        for(int[]I:p)Arrays.fill(I,-1);
        visit = new boolean[n][n];
        visit[0][0]=true;
        bfs(0,0);
//        for(boolean[] i:visit){
//            pw.println(Arrays.toString(i));
//        }
        int parentofn=-1;
        boolean flag = false;
        for(int i =0;i<n;i++){
            if(visit[i][n-1]){
                flag = true;
                parentofn = i;
                break;
            }
        }
        if(!flag){
            pw.println(-1);
        }
        else {
           // print2(p);
            Stack<Integer> stack = new Stack<>();
            int child = n-1;
            int j = parentofn;
           // pw.println(j);
            while(p[child][j]!=0) {
                stack.push(child);
                int tmp = j;
                j = p[child][j];
                child = tmp;
            }
            stack.push(child);
            stack.push(j);
            if(j!=0)stack.push(p[child][j]);
            pw.println(stack.size()-1);
            while(stack.isEmpty()==false){
                pw.print((stack.pop()+1)+" ");
            }
        }
        pw.close();
    }
    static triple[] forbiden;
    static LinkedList<Integer>[] arr;
    static int[][]p;
    static boolean[][]visit;
    public static void bfs(int parent,int i){
        LinkedList<pair> q = new LinkedList<>();
        q.addFirst(new pair(parent,i));
        while(q.isEmpty()==false){
            pair tmp = q.remove();
            for(int j:arr[tmp.v]){
                if(!visit[tmp.v][j]&&valid(tmp.u,tmp.v,j)){
                    q.addLast(new pair(tmp.v,j));
                    visit[tmp.v][j] = true;
                    p[j][tmp.v]=tmp.u;
                    if(j==visit.length-1)return;
                }
            }
        }
    }
    public static boolean valid(int i,int j,int w){
        if(Arrays.binarySearch(forbiden,new triple(i,j,w))<=-1)return true;
        return false;
    }
    public static void print2(int[][]arr){
        for(int[] i:arr){
            print1(i);
        }
    }
    public static void print1(int[]arr){
        pw.println(Arrays.toString(arr));
    }
}
