#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int dist[3055][3055], par[3055][3055];
bool used[3055][3055];
vector<int> g[3055];
map<pair<int, int>, bool> bad[3055];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> k;
  int x, y;
  for (int(i) = 0; (i) < (m); i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  int a, b, c;
  for (int(i) = 0; (i) < (k); i++) {
    cin >> a >> b >> c;
    bad[a][pair<int, int>(b, c)] = true;
  }
  queue<pair<int, int> > que;
  que.push(pair<int, int>(-1, 1));
  memset(par, -1, sizeof(par));
  while (!que.empty()) {
    pair<int, int> p = que.front();
    que.pop();
    for (int(i) = 0; (i) < (g[p.second].size()); i++) {
      int to = g[p.second][i];
      if (used[p.second][to]) continue;
      if (bad[p.first].find(pair<int, int>(p.second, to)) != bad[p.first].end())
        continue;
      used[p.second][to] = true;
      dist[p.second][to] = dist[p.first][p.second] + 1;
      par[to][p.second] = p.first;
      que.push(pair<int, int>(p.second, to));
    }
  }
  int last = -1, piv = INT_MAX;
  for (int(i) = (1); (i) <= (n); i++) {
    if (!used[i][n]) continue;
    if (piv > dist[i][n]) {
      piv = dist[i][n];
      last = i;
    }
  }
  if (last == -1) {
    cout << -1 << '\n';
    return 0;
  }
  vector<int> res;
  int last2 = n;
  res.push_back(n);
  while (last != -1) {
    res.push_back(last);
    int temp = par[last2][last];
    last2 = last;
    last = temp;
  }
  cout << res.size() - 1 << '\n';
  for (int(i) = (res.size()) - 1; (i) >= 0; i--) {
    if (i != res.size() - 1) cout << " ";
    cout << res[i];
  }
  cout << '\n';
  return 0;
}
