#include <bits/stdc++.h>
using namespace std;
struct node {
  int pid, pre, u, ti;
} f, q[300010];
string s;
int u, v, n, m, k, a, b, c, r, l;
vector<int> g[3010];
map<string, bool> mp, mp2;
string str(int x) {
  string s = "";
  if (x == 0) s += '0';
  while (x > 0) {
    s += (char)((x % 10) + '0');
    x /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
void pri(node x) {
  if (x.pid == -1) {
    printf("%d ", x.u);
    return;
  }
  pri(q[x.pid]);
  printf("%d ", x.u);
  return;
}
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= k; i++) {
    s = "";
    scanf("%d%d%d", &a, &b, &c);
    s += str(a);
    s += " ";
    s += str(b);
    s += " ";
    s += str(c);
    mp[s] = true;
  }
  q[++r] = (node){-1, 0, 1, 0};
  while (r >= l) {
    f = q[++l];
    u = f.u;
    for (int i = 0; i < g[u].size(); i++) {
      v = g[u][i];
      string pd = "";
      pd += str(f.pre);
      pd += " ";
      pd += str(u);
      pd += " ";
      pd += str(v);
      if (mp[pd]) {
        continue;
      }
      pd = "";
      pd += str(u);
      pd += " ";
      pd += str(v);
      if (mp2[pd]) {
        continue;
      }
      mp2[pd] = true;
      if (v == n) {
        printf("%d\n", f.ti + 1);
        pri(f);
        printf("%d", n);
        return 0;
      }
      q[++r] = (node){l, u, v, f.ti + 1};
    }
  }
  printf("-1");
  return 0;
}
