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.lang.System;
import java.util.*;
import java.io.*;

public class Solution {
    public static void main(String[] args) {
        final Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        final int n = in.nextInt();
        final int m = in.nextInt();
        final int k = in.nextInt();
        final List<Integer>[] g = new List[n];
        for (int i = 0; i < n; ++i) {
            g[i] = new ArrayList<Integer>();
        }
        for (int i = 0; i < m; ++i) {
            final int a = in.nextInt() - 1;
            final int b = in.nextInt() - 1;
            g[a].add(b);
            g[b].add(a);
        }
        final Set<Triple> triples = new HashSet<Triple>();
        for (int i = 0; i < k; ++i) {
            final int a = in.nextInt() - 1;
            final int b = in.nextInt() - 1;
            final int c = in.nextInt() - 1;
            triples.add(new Triple(a, b, c));
        }

        final boolean[][] mark = new boolean[n][n];
        final LinkedList<Pair> q = new LinkedList<Pair>();
        q.add(new Pair(0, new ArrayList()));
        while (!q.isEmpty()) {
            final Pair cur = q.pollFirst();
            if (cur.node == n - 1) {
                System.out.println(cur.path.size());
                for (Integer i : cur.path) {
                    System.out.print((i + 1) + " ");
                }
                System.out.print(n);
                return;
            }
            for (Integer to : g[cur.node]) {
                if(mark[cur.node][to]) continue;
                final List<Integer> path = new ArrayList<Integer>(cur.path);
                path.add(cur.node);
                boolean flag = true;
                for (int ai = 2; ai < path.size(); ++ai) {
                    final Triple triple = new Triple(path.get(ai-2),
                                path.get(ai-1), path.get(ai));
                    if (triples.contains(triple)) {
                        flag = false;
                        break;
                    }
                }
                if(path.size() > 1){
                    final Triple triple = new Triple(path.get(path.size()-2),
                                path.get(path.size()-1), to);
                    if (triples.contains(triple)) {
                        flag = false;
                    }
                }
                if (flag) {
                    mark[cur.node][to] = true;
                    q.add(new Pair(to, path));
                }
            }
        }

        System.out.print(-1);
    }

    public static class Pair {
        public final int node;
        public final List<Integer> path;

        public Pair(int node, List<Integer> path) {
            this.node = node;
            this.path = path;
        }
    }
    
    public static class Triple {
        public final int a;
        public final int b;
        public final int c;

        public Triple(int a, int b, int c) {
            this.a = a;
            this.b = b;
            this.c = c;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Triple triple = (Triple) o;

            if (a != triple.a) return false;
            if (b != triple.b) return false;
            if (c != triple.c) return false;

            return true;
        }

        @Override
        public int hashCode() {
            int result = a;
            result = 31 * result + b;
            result = 31 * result + c;
            return result;
        }
    }
}