#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, sgn = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') sgn = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48);
  return x * sgn;
}
const int N = 3010;
const int E = 2e4 + 10;
int n, m, k, x, y, z, pre[E << 1], cnt = 1, h[N];
set<pair<int, int> > s[N];
bool vis[E << 1];
struct edge {
  int v, nxt;
} e[E << 1];
void dfs(int x) {
  if (pre[x])
    dfs(pre[x]), printf(" %d", e[pre[x]].v);
  else
    printf("1");
}
void link(int x, int y) {
  e[++cnt] = (edge){y, h[x]};
  h[x] = cnt;
}
int main() {
  n = read(), m = read(), k = read();
  for (int i = 1; i <= m; i++) {
    x = read(), y = read();
    link(x, y);
    link(y, x);
  }
  for (int i = 1; i <= k; i++) {
    x = read(), y = read(), z = read();
    s[x].insert(pair<int, int>(y, z));
  }
  queue<pair<int, pair<int, int> > > q;
  q.push(pair<int, pair<int, int> >(1, pair<int, int>(0, 0)));
  while (q.size()) {
    int x = q.front().first, las = q.front().second.first,
        tim = q.front().second.second;
    q.pop();
    for (int i = h[x]; i; i = e[i].nxt) {
      int y = e[i].v;
      if (s[e[las ^ 1].v].find(pair<int, int>(x, y)) != s[e[las ^ 1].v].end() ||
          vis[i])
        continue;
      pre[i] = las;
      vis[i] = 1;
      q.push(pair<int, pair<int, int> >(y, pair<int, int>(i, tim + 1)));
      if (y == n) {
        printf("%d\n", tim + 1);
        dfs(i);
        printf(" %d", y);
        puts("");
        return 0;
      }
    }
  }
  puts("-1");
  return 0;
}
