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
	/*	/ ﾌﾌ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ム
		/ )\⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀  Y
		(⠀⠀| ( ͡° ͜ʖ ͡°）⠀⌒(⠀ ノ
		(⠀ ﾉ⌒ Y ⌒ヽ-く __／
		| _⠀｡ノ| ノ｡ |/
		(⠀ー '_人`ー ﾉ
		⠀|\ ￣ _人'彡ﾉ
		⠀ )\⠀⠀ ｡⠀⠀ /
		⠀⠀(\⠀ #⠀ /
		⠀/⠀⠀⠀/ὣ====================D-
		/⠀⠀⠀/⠀ \ \⠀⠀\
		( (⠀)⠀⠀⠀⠀ ) ).⠀)
		(⠀⠀)⠀⠀⠀⠀⠀( | /
		|⠀ /⠀⠀⠀⠀⠀⠀ | /
		[_] ⠀⠀⠀⠀⠀[___]                     */
	// Main Code at the Bottom
	import java.util.*;
	import java.lang.*;
	import java.io.*;
	import java.math.BigInteger; 
	public class Main {
		//Fast IO class
	    static class FastReader {
	        BufferedReader br; 
	        StringTokenizer st; 
	        public FastReader() {
	        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
	        	if(!env) {
	        		try {
						br=new BufferedReader(new FileReader("src\\input.txt"));
					} catch (FileNotFoundException e) {
						e.printStackTrace();
					}
	        	}
	        	else br = new BufferedReader(new InputStreamReader(System.in)); 
	        } 
	        String next() {
	            while (st == null || !st.hasMoreElements()) {
	                try {
	                    st = new StringTokenizer(br.readLine()); 
	                } 
	                catch (IOException  e) {
	                    e.printStackTrace(); 
	                } 
	            } 
	            return st.nextToken(); 
	        } 
	        int nextInt() {
	            return Integer.parseInt(next()); 
	        } 
	        long nextLong() {
	            return Long.parseLong(next()); 
	        } 
	        double nextDouble() {
	            return Double.parseDouble(next()); 
	        } 
	        String nextLine() {
	            String str = ""; 
	            try {
	                str = br.readLine(); 
	            } 
	            catch (IOException e) {
	                e.printStackTrace(); 
	            } 
	            return str; 
	        } 
	    }     
	    static long MOD=1000000000+7;
	    //Euclidean Algorithm
	    static long gcd(long A,long B){
	    	return (B==0)?A:gcd(B,A%B);
	    }
	    //Modular Exponentiation
	    static long fastExpo(long x,long n){
	        if(n==0) return 1;
	        if((n&1)==0) return fastExpo((x*x)%MOD,n/2)%MOD;
	        return ((x%MOD)*fastExpo((x*x)%MOD,(n-1)/2))%MOD;
	    }
	    //Modular Inverse
	    static long inverse(long x) {
	    	return fastExpo(x,MOD-2);
	    }
	    //Prime Number Algorithm
	    static boolean isPrime(long n){
	        if(n<=1) return false;
	        if(n<=3) return true;
	        if(n%2==0 || n%3==0) return false;
	        for(int i=5;i*i<=n;i+=6) if(n%i==0 || n%(i+2)==0) return false;
	        return true;
	    }
	    //Reverse an array
	    static void reverse(int arr[],int l,int r){
	    	while(l<r) {
	    		int tmp=arr[l];
	    		arr[l++]=arr[r];
	    		arr[r--]=tmp;
	    	}
	    }
	    //Print array
	    static void print1d(int arr[]) {
	    	out.println(Arrays.toString(arr));
	    }
	    static void print2d(int arr[][]) {
	    	for(int a[]: arr) out.println(Arrays.toString(a));
	    }
	    // Pair
	    static class pair{
	    	int x,y;
	    	pair(int a,int b){
	    		this.x=a;
	    		this.y=b;
	    	}
	    	public boolean equals(Object obj) {
	    		if(obj == null || obj.getClass()!= this.getClass()) return false;
	            pair p = (pair) obj;
	            return (this.x==p.x && this.y==p.y);
	        }
	    	public int hashCode() {
	            return Objects.hash(x,y);
	        }
	    }
	    static FastReader sc=new FastReader();
	    static PrintWriter out=new PrintWriter(System.out);  
	    //Main function(The main code starts from here
	    static class triplet{
	    	int x,y,z;
	    	triplet(int a,int b,int c){
	    		x=a;
	    		y=b;
	    		z=c;
	    	}
	    	public boolean equals(Object obj) {
	    		if(obj == null || obj.getClass()!= this.getClass()) return false;
	            triplet p = (triplet) obj;
	            return (this.x==p.x && this.y==p.y && this.z==z);
	        }
	    	public int hashCode() {
	            return Objects.hash(x,y,z);
	        }
	    }
	    static int V,visited[];
	    static ArrayList<Integer> ans=new ArrayList<>();
	    static ArrayList<Integer> graph[];
	    static HashMap<triplet,Integer> map=new HashMap<>();
	    static void init(int n){
	        V=n;
	        visited=new int[n];
	        graph=new ArrayList[V];
	        for(int i=0;i<V;i++) graph[i]=new ArrayList<>();
	    }
	    static void addEdge(int src,int dest){
	        graph[src].add(dest);
	        graph[dest].add(src);
	    }
	    static int bfs() {
	    	int s=0;
	    	HashMap<pair,Long> dist=new HashMap<>();
	    	HashMap<pair,pair> parent=new HashMap<>();
	    	HashMap<pair,Integer> visited=new HashMap<>();
	    	dist.put(new pair(-1,0),0L);
	    	parent.put(new pair(-1,0),new pair(-1,-1));
	    	PriorityQueue<triplet> q=new PriorityQueue<>((t1,t2)->t1.z-t2.z);
	    	q.add(new triplet(-1,s,0));
	    	while(!q.isEmpty()) {
	    		triplet t=q.poll();
	    		int prev=t.x;
	    		s=t.y;
	    		if(s==V-1) break;
	    		pair p=new pair(prev,s);
	    		//System.out.println(s);
	    		if(visited.get(p)!=null) continue;
	    		visited.put(p,1);
	    		for(Integer x: graph[s]) {
	    			if(map.get(new triplet(prev,s,x))!=null) continue;
	    			pair p2=new pair(s,x);
	    			if(dist.get(p2)!=null) {
	    				long d=dist.get(p2);
	    				if(dist.get(p)+1<d) {
	    					d=dist.get(p)+1;
	    					dist.put(p2,d);
	    					parent.put(p2,p);
	    					q.add(new triplet(s,x,(int) d));
	    				}
	    			}
	    			else {
	    				long d=dist.get(p)+1;
	    				dist.put(p2,d);
	    				parent.put(p2,p);
	    				q.add(new triplet(s,x,(int) d));
	    			}
	    		}
	    	}
	    	pair req=new pair(-1,-1);
	    	long min=Integer.MAX_VALUE;
	    	for(pair p: dist.keySet()) {
	    		if(p.y==V-1) {
	    			long l=dist.get(p);
	    			if(l<min) {
	    				min=dist.get(p);
		    			req=p;
	    			}
	    		}
	    	}
	    	if(req.x==-1) return -1;
	    	while(req.x!=-1) {
	    		ans.add(req.y);
	    		req=parent.get(req);
	    	}
	    	return 1;
	    }
	    public static void main (String[] args) throws java.lang.Exception {
	    	int test;
	    	test=1;
	    	//test=sc.nextInt();
	    	while(test-->0){
	    		int n=sc.nextInt(),m=sc.nextInt(),k=sc.nextInt();
	    		init(n);
	    		for(int i=0;i<m;i++) addEdge(sc.nextInt()-1,sc.nextInt()-1);
	    		for(int i=0;i<k;i++) map.put(new triplet(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt()-1),1);
	    		int f=bfs();
	    		if(f==-1) out.println(-1);
	    		else {
	    			ans.add(0);
	    			Collections.reverse(ans);
	    			out.println(ans.size()-1);
	    			for(Integer x: ans) out.print((x+1)+" ");
	    		}
	    	}
	        out.flush();
	        out.close();
	    }
	}