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




public class Solution
{
       static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;
 
        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
 
        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(
                new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }
 
        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n') {
                    if (cnt != 0) {
                        break;
                    }
                    else {
                        continue;
                    }
                }
                buf[cnt++] = (byte)c;
            }
            return new String(buf, 0, cnt);
        }
 
        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ') {
                c = read();
            }
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
 
            if (neg)
                return -ret;
            return ret;
        }
 
        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }
 
        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
 
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
 
            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }
 
            if (neg)
                return -ret;
            return ret;
        }
 
        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0,
                                 BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }
 
        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }
 
        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
    static int parent(int x , int p[])
    {
           if(p[x] == x)
           return x;
           
           return (p[x] = parent(p[x],p));
    }
    
    static void union(int a , int b , int p[] , int size[])
    {
           a = parent(a,p);
           b = parent(b,p);
           
           if(size[a] < size[b])
           {
                  int temp = a;
                  a = b;
                  b = temp;
           }
           p[b] = a;
           size[a] += size[b];
    }
   // int ass;
    
   

   public static void main(String []args) throws IOException
   {
          Reader sc = new Reader();
          int n = sc.nextInt();
          int m = sc.nextInt();
          int k = sc.nextInt();
          
          TreeMap<tuple,Integer> map = new TreeMap<tuple,Integer>(new Compare());
          LinkedList<Integer> arr[] = new LinkedList[n+1];
          for(int i = 1 ; i <= n ; i++)
          {
                 arr[i] = new LinkedList<Integer>();
          }
          for(int i = 0 ; i < m ; i++)
          {
                 int x = sc.nextInt();
                 int y = sc.nextInt();
                 arr[x].add(y);
                 arr[y].add(x);
          }
          
          for(int i = 0 ; i < k ; i++)
          {
                 map.put(new tuple(sc.nextInt(),sc.nextInt(),sc.nextInt()) , 1);
          }
          Queue<pair> q = new LinkedList<pair>();
          q.add(new pair(0,1));
          int dist[][] = new int[n+1][n+1];
          for(int i = 0 ; i <= n ; i++)
          {
                 for(int j = 0 ; j <= n ; j++)
                 {
                        
                        dist[i][j] = Integer.MAX_VALUE;
                 }
          }
          dist[0][1] = 0;
          while(q.size() > 0)
          {
                 pair pp = q.remove();
                 for(Integer v : arr[pp.y])
                 {
                        if(dist[pp.y][v] > dist[pp.x][pp.y]+1 && !map.containsKey(new tuple(pp.x,pp.y,v)))
                        {
                               dist[pp.y][v] = 1+dist[pp.x][pp.y];
                               q.add(new pair(pp.y,v));
                        }
                 }
          }
          
          int d = Integer.MAX_VALUE;
          for(int i = 0 ; i <= n ; i++)
          {
                d = Math.min(d,dist[i][n]);
          }
          //System.out.println(dist[3][n]);
          if(d == Integer.MAX_VALUE)
          System.out.println("-1");
          
          else
          {
                 int ans[] = new int[d];
                 int curr = n;
                 int pos = 0;
                 
                // System.out.println(dist[1][curr] == d);
                 
                 System.out.println(d);
                 
                 while(pos < ans.length)
                 {
                        for(int i = 1 ; i <= n ; i++)
                        {
                               if(dist[i][curr] == d)
                               {
                                     
                                       d--;
                                      ans[pos++] = curr;
                                      curr = i;
                                      break;
                               }
                        }
                 }
                 
                 
                 System.out.print(1 + " ");
                 for(int i = ans.length-1 ; i >= 0 ; i--)
                 {
                        System.out.print(ans[i] + " ");
                 }
                 System.out.println();
          }
   }
}

 class Compare implements Comparator<tuple>
{
       public int compare(tuple a , tuple b)
       {
              if(a.a != b.a)
              return a.a-b.a;
              
              if(a.b != b.b)
              return a.b-b.b;
              
              return a.c-b.c;
       }
}

class pair
{
       int x ,y;
       public pair(int x , int y)
       {
              this.x = x;
              this.y = y;
       }
}

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


