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.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;

public class ShortestPaths {





	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner(System.in);
		HashSet<triple> forbiden=new HashSet();
		int n=sc.nextInt(),m=sc.nextInt(),k=sc.nextInt();
		ArrayList<Integer> [] adj=new ArrayList[n];
		for(int i=0;i<n;i++)
			adj[i]=new ArrayList();
		while(m-->0)
		{
			int u=sc.nextInt()-1,v=sc.nextInt()-1;
			adj[u].add(v);
			adj[v].add(u);
		}
		while(k-->0)
			forbiden.add(new triple(sc.nextInt()-1,sc.nextInt()-1,sc.nextInt()-1));
		int [][] dist=new int [n][n];
		pair[][]p=new pair [n][n];
		Queue<pair> q=new LinkedList();
		q.add(new pair(0,0));
		
		while(!q.isEmpty())
		{
			pair x=q.poll();
			int curr=x.curr;
			int last=x.last;
			for(int v:adj[curr])
			{
				if(dist[curr][v]==0 && !forbiden.contains(new triple(last,curr,v)))
				{
					p[curr][v]=x;
					dist[curr][v]=dist[last][curr]+1;
					
					q.add(new pair(curr,v));
				}
			}
		}
		int min=Integer.MAX_VALUE;
		for(int i=0;i<n;i++)
			if(dist[i][n-1]!=0)
				min=Math.min(min, dist[i][n-1]);
		if(min==Integer.MAX_VALUE)
		{
			System.out.println(-1);
			return ;
		}
		int parent=0;
		for(int i=0;i<n;i++)
			if(dist[i][n-1]==min)
				parent=i;
		System.out.println(min);
		pair last=new pair(parent,n-1);
		ArrayList<Integer> path=new ArrayList();
		path.add(n-1);
		while(true)
		{
			pair nxt=p[last.last][last.curr];
			path.add(nxt.curr);
			if(nxt.curr==0)
				break;
			last=nxt;
		}
		StringBuilder sb=new StringBuilder();
		for(int i=path.size()-1;i>=0;i--)
			sb.append((path.get(i)+1)+" ");
		System.out.println(sb);
		
	
	}
	static class pair
	{
		int last,curr;
		public pair(int x,int y)
		{
			last=x;
			curr=y;
		}
	}
	static  class triple 
	{
		int a,b,c;
		triple(int x,int y,int z)
		{
			a=x;b=y;c=z;
		}
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + a;
			result = prime * result + b;
			result = prime * result + c;
			return result;
		}
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			triple other = (triple) obj;
			if (a != other.a)
				return false;
			if (b != other.b)
				return false;
			if (c != other.c)
				return false;
			return true;
		}
	

	}

	static class Scanner
	{
		BufferedReader br;
		StringTokenizer st;
		public Scanner(InputStream s)
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
}
