#include <bits/stdc++.h>
using namespace std;
int cost[3010][3010];
vector<vector<int> > g;
map<pair<int, pair<int, int> >, bool> m;
int n, mm, k;
void bfs() {
  queue<pair<pair<int, int>, int> > q;
  q.push(make_pair(make_pair(1, 0), 1));
  cost[1][0] = 1;
  while (!q.empty()) {
    int u = q.front().first.first, prev = q.front().first.second,
        c = q.front().second;
    q.pop();
    for (int i = 0; i < g[u].size(); i++) {
      if (m.find(make_pair(prev, make_pair(u, g[u][i]))) == m.end() &&
          (!cost[g[u][i]][u] || c + 1 < cost[g[u][i]][u])) {
        cost[g[u][i]][u] = c + 1;
        q.push(make_pair(make_pair(g[u][i], u), c + 1));
      }
    }
  }
}
void print(int u, int c) {
  int pos = 0;
  if (u == 1) {
    printf("%d ", u);
    return;
  }
  for (int i = 0; i <= n; i++) {
    if (cost[u][i] == c) {
      pos = i;
    }
  }
  print(pos, c - 1);
  printf("%d ", u);
}
int main() {
  cin >> n >> mm >> k;
  g.resize(n + 1);
  for (int i = 0; i < mm; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 0; i < k; i++) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    m[make_pair(a, make_pair(b, c))] = 1;
  }
  bfs();
  int mn = 2e9;
  for (int i = 1; i < n; i++) {
    if (cost[n][i] && cost[n][i] < mn) mn = cost[n][i];
  }
  if (mn != 2e9) {
    printf("%d\n", mn - 1);
    print(n, mn);
  } else {
    printf("-1");
  }
  return 0;
}
