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.*;

public class CF59E
{
	static final boolean _DEBUG = true;

	static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner(BufferedReader _br) {
			br = _br;
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					e.printStackTrace();
					return "";
				}
			}
			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 MyScanner   scan;
	static PrintWriter out;

	static int debugCount = 0;
	static void debug(String msg) {
		if (_DEBUG && debugCount < 200) {
			out.println(msg);
			out.flush();
			debugCount++;
		}
	}
	
    public static void main (String args[]) throws IOException {
//    	scan = new MyScanner(new BufferedReader(new FileReader("test.in")));
    	scan = new MyScanner(new BufferedReader(new InputStreamReader(System.in)));
    	out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        CF59E inst = new CF59E();
        inst.execute();
        out.close();
    }
    
    class Node2 {
    	int id;
    	public Node2(int _id) {
    		id = _id;
    	}
    	HashSet<Node2> nbs = new HashSet<Node2>();
    	HashMap<Node2, Node2> path = new HashMap<Node2, Node2>();
    	HashMap<Node2, HashSet<Node2>> forbids = new HashMap<Node2, HashSet<Node2>>();
    	
    	void addForbid(Node2 a, Node2 c) {
    		HashSet<Node2> set = forbids.get(a);
    		if (set == null) {
    			set = new HashSet<Node2>();
    			forbids.put(a, set);
    		}
    		set.add(c);
    	}
    	 	
    }
    
    void execute2() throws IOException {
    	int n = scan.nextInt();
    	int m = scan.nextInt();
    	int k = scan.nextInt();
    	
    	Node2[] nodes = new Node2[n];
    	for (int i = 0; i < n; i++) {
    		nodes[i] = new Node2(i);
    	}
    	Node2 start = nodes[0];
    	Node2 end = nodes[n-1];
    	for (int i = 0; i < m; i++) {
    		Node2 a = nodes[scan.nextInt()-1];
    		Node2 b = nodes[scan.nextInt()-1];
			a.nbs.add(b);
			b.nbs.add(a);
    	}
    	for (int i = 0; i < k; i++) {
    		Node2 a = nodes[scan.nextInt()-1];
       		Node2 b = nodes[scan.nextInt()-1];
       		Node2 c = nodes[scan.nextInt()-1];
       		if (b != start) {
       			b.addForbid(a, c);     
       			b.addForbid(c, a); 
       		}
       			
    	}
//    	debug("Here");
    	
    	Queue<int[]> queue = new LinkedList<int[]>();
    	
		queue.add(new int[] {0, 0, 0});
    	while(!queue.isEmpty()) {
    		int[] top = queue.poll();
    		Node2 cur = nodes[top[1]];
//    		debug(Arrays.toString(top));
    		Node2 parent = nodes[top[0]];
    		if (cur.nbs.size() == 0) continue;
    		Iterator<Node2> it = cur.nbs.iterator();
    		HashSet<Node2> forbid = cur.forbids.get(parent);
			int nwt = top[2] + 1;
    		while(it.hasNext()) {
    			Node2 next = it.next();
    			if (forbid != null && forbid.contains(next)) {
    				continue;
    			} else {
    				it.remove();
    				if (next.nbs.size() == 0) continue;
    				cur.path.put(next, parent);
    	    		if (next == end) {
    	    			out.println(nwt);
    	    			Stack<Node2> ans = new Stack<Node2>();
    	    			ans.push(next);
    	    			while (cur != start) {
    	    				ans.push(cur);
    	    				parent = cur.path.get(next);
    	    				next = cur;
    	    				cur = parent;
    	    			}
    	    			
    	    			out.print(1);
    	    			while(!ans.isEmpty()) {
    	    				out.print(" " + (ans.pop().id+1));
    	    			}
    	    			out.println();
    	    			return;
    	    		}   								
    				queue.add(new int[] {cur.id, next.id, nwt});
    			}   			
    		}
    	}
    	out.println(-1);
    }
    
    class Node {
    	int id;
    	public Node(int _id) {
    		id = _id;
    	}
    	HashMap<Node, Edge> nbs = new HashMap<Node, Edge>(); 	
    }
    
    class Edge {
    	Node a, b;
    	public Edge(Node _a, Node _b) {
    		a = _a;
    		b = _b;
    		a.nbs.put(b, this);
    	}
    	HashSet<Edge> forbids = new HashSet<Edge>();
    	boolean visited = false; 	
    	
    	int dist;
    	Edge parent;
    	
    	public String toString() {
    		return (a.id + 1) + "->" + (b.id + 1) + " " + dist;
    	}
    	
    }
    
    void execute() throws IOException {
    	int n = scan.nextInt();
    	int m = scan.nextInt();
    	int k = scan.nextInt();
    	
    	Node[] nodes = new Node[n+2];
    	for (int i = 0; i < n; i++) {
    		nodes[i] = new Node(i);
    	}
    	
    	Edge nouse = null;
    	for (int i = 0; i < m; i++) {
    		Node a = nodes[scan.nextInt()-1];
    		Node b = nodes[scan.nextInt()-1];
    		nouse = new Edge(a, b);
    		nouse = new Edge(b, a);
    	}
    	for (int i = 0; i < k; i++) {
    		Node a = nodes[scan.nextInt()-1];
       		Node b = nodes[scan.nextInt()-1];
       		Node c = nodes[scan.nextInt()-1];   
       		
       		Edge e = a.nbs.get(b);
       		Edge f = b.nbs.get(c);
       		if (e != null && f != null) {
       			e.forbids.add(f);
       			
       			f = c.nbs.get(b);
       			e = b.nbs.get(a);
       			f.forbids.add(e);
       		}
    	}
//    	debug("Here");
    	Node start = nodes[n] = new Node(n);
    	Node end = nodes[n+1] =  new Node(n+1);
    	Edge start2 = new Edge(start, nodes[0]);
    	Edge end2 = new Edge(nodes[n-1], end);
    		
    	Queue<Edge> queue = new LinkedList<Edge>();
    	
		queue.add(start2);
		start2.visited = true;
		start2.dist = 0;
    	while(!queue.isEmpty()) {
    		Edge top = queue.poll();
    		Node other = top.b;
//    		debug("Try " + top);

    		Iterator<Map.Entry<Node, Edge>> it = other.nbs.entrySet().iterator();
    		while (it.hasNext()) {
    			Edge next = it.next().getValue();
    			if (next.visited) continue;
    			if (top.forbids.contains(next)) continue;
    			next.visited = true;
    			next.parent = top;
    			it.remove();
    			if (next == end2) {
    				out.println(top.dist);
    				Stack<Edge> stack = new Stack<Edge>();
    				Edge parent = top;
    				Edge cur = next;
    				while (parent != start2) {
    					stack.push(parent);
    					cur = parent;
    					parent = cur.parent;
    				}
    				out.print(1);
    				while(!stack.isEmpty()) {
    					out.print(" " + (stack.pop().b.id + 1));
    				}
    				return;
    			}
    			next.dist = top.dist + 1;
//    			debug("Add " + next);
    			queue.add(next);
    		}
    	}
    	out.println(-1);
    }
}