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.util.*;
import java.io.*;
import java.math.*;
import java.text.*;
@SuppressWarnings("unchecked")
public class Main
{
  static FastScanner in = new FastScanner(System.in);
  static StringBuilder sb = new StringBuilder();
  static DecimalFormat df = new DecimalFormat();
  public static void main(String[] args)
  {
    df.setMaximumFractionDigits(20);
    df.setMinimumFractionDigits(20);
    df.setRoundingMode(RoundingMode.DOWN);
    // String formatted = df.format(0.2);
    // Never sort array of primitive type
    int N = in.nextInt();
    int M = in.nextInt();
    int K = in.nextInt();
    int INF = (int) 1e9;
    ArrayList<Integer> adj[] = new ArrayList[N];
    for (int i = 0; i < N; i++)
      adj[i] = new ArrayList();
    for (int i = 0; i < M; i++)
    {
      int x = in.nextInt() - 1;
      int y = in.nextInt() - 1;
      adj[x].add(y);
      adj[y].add(x);
    }
    // you cannot go from a to b and c
    Set<Long> forbidden = new HashSet<Long>();
    for (int i = 0; i < K; i++)
    {
      int a = in.nextInt() - 1;
      int b = in.nextInt() - 1;
      int c = in.nextInt() - 1;
      forbidden.add(f(a, b, c));
    }

    int dist[][] = new int[N][N];
    for (int i = 0; i < N; i++)
      Arrays.fill(dist[i], INF);
    PriorityQueue<State> pq = new PriorityQueue<State>();
    for (int i = 0; i < adj[0].size(); i++)
    {
      int v = adj[0].get(i);
      dist[0][v] = 1;
      pq.add(new State(0, v, 1));
    }
    while (!pq.isEmpty())
    {
      State state = pq.poll();
      int p = state.p;
      int u = state.u;
      int d = state.d;
      if (dist[p][u] < d) continue;
      for (int i = 0; i < adj[u].size(); i++)
      {
        int v = adj[u].get(i);
        if (forbidden.contains(f(p, u, v))) continue;
        int alt = d + 1;
        if (alt < dist[u][v])
        {
          dist[u][v] = alt;
          pq.add(new State(u, v, alt));
        }
      }
    }

    int ans = INF;
    for (int i = 0; i < N; i++)
      ans = Math.min(ans, dist[i][N - 1]);

    if (ans == INF) 
    {
      System.out.println(-1);
      return;
    }
    Stack<Integer> stk = new Stack<Integer>();
    int cur = N - 1;
    int prev = -2;
    while (cur > 0)
    {
      stk.push(cur);
      int bestParent = -1;
      for (int i = 0; i < N; i++)
        if (!forbidden.contains(f(i, cur, prev)))
          if (bestParent == -1 || dist[i][cur] < dist[bestParent][cur])
            bestParent = i;
      if (bestParent == -1) 
      {
        int hhh = 0;
        while (hhh == hhh)  hhh++;
        System.out.println("something is wrong" + hhh);
      }
      prev = cur;
      cur = bestParent;
    }
    if (stk.size() != ans)
    {
      int x = 0;
      while (x == x) x++;
      System.out.println(x);
    }
    stk.add(0);
    System.out.println(ans);
    while (!stk.isEmpty())
    {
      int u = stk.pop();
      System.out.print(u + 1);
      if (stk.size() == 0)
        System.out.print('\n');
      else
        System.out.print(' ');
    }
  }
  static long f(int a, int b, int c)
  {
    return 3001 * 3001L * a + 3001 * b + c;
  }
  static class State implements Comparable<State> 
  {
    int p;
    int u;
    int d;
    public State(int p, int u, int d)
    {
      this.p = p;
      this.u = u;
      this.d = d;
    }
    @Override
    public int compareTo(State o)
    {
      return this.d - o.d;
    }
  }
  static BigInteger b(long n) { return BigInteger.valueOf(n);}
  static BigInteger b(String s) { return new BigInteger(s); }
  static BigDecimal bd(double d) { return BigDecimal.valueOf(d);}
  static BigDecimal bd(String s) { return new BigDecimal(s); }
}
class FastScanner
{
  BufferedReader reader;
  StringTokenizer tokenizer;
  FastScanner (InputStream inputStream)
  {
    reader = new BufferedReader(new InputStreamReader(inputStream));
  }
  String nextToken()
  {
    while (tokenizer == null || ! tokenizer.hasMoreTokens())
    {
      try {
        tokenizer = new StringTokenizer(reader.readLine());
      } catch (Exception e){}
    }
    return tokenizer.nextToken();
  }
  boolean hasNext()
  {
    if (tokenizer == null || ! tokenizer.hasMoreTokens())
    {
      try {
        tokenizer = new StringTokenizer(reader.readLine());
      } catch (Exception e){ return false; }
    }
    return true;
  }
  int nextInt()
  {
    return Integer.parseInt(nextToken());
  }
}
