#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, k, p, q, r;
  cin >> n >> m >> k;
  vector<vector<int>> adj(n + 1), store(n + 1, vector<int>(n + 1));
  for (int i = 0; i < m; ++i) {
    cin >> p >> q;
    adj[p].push_back(q);
    adj[q].push_back(p);
  }
  set<vector<int>> s;
  queue<pair<int, int>> next;
  map<pair<int, int>, int> mapp;
  next.push({1, 1});
  for (int i = 0; i < k; ++i) {
    cin >> p >> q >> r;
    s.insert({p, q, r});
  }
  int dis = -1, last = -1;
  while (!next.empty()) {
    auto road = next.front();
    auto x1 = road.first, x2 = road.second;
    next.pop();
    for (auto i : adj[x2]) {
      if (s.find({x1, x2, i}) == s.end() and store[x2][i] == 0) {
        store[x2][i] = store[x1][x2] + 1;
        next.push({x2, i});
        mapp[{x2, i}] = x1;
        if (i == n) {
          dis = store[x2][i];
          last = x2;
          break;
        }
      }
    }
    if (dis > 0) break;
  }
  if (dis == -1)
    cout << -1;
  else {
    cout << dis << "\n" << 1 << " ";
    vector<int> v;
    v.push_back(n);
    while (last != 1) {
      v.push_back(last);
      int w = last;
      last = mapp[{last, n}];
      n = w;
    }
    for (int i = dis - 1; i >= 0; --i) cout << v[i] << " ";
  }
}
