#include <bits/stdc++.h>
using namespace std;
long n, m, k, d[3001][3001], tr[3001][3001];
map<long long, int> M;
vector<long> a[3001], kq;
long long res = 1000000007;
void djk() {
  priority_queue<pair<long, pair<long, long> > > pq;
  pq.push(pair<long, pair<long, long> >(0, pair<long, long>(1, 1)));
  while (pq.size()) {
    long u = pq.top().second.first, v = pq.top().second.second,
         duv = -pq.top().first;
    pq.pop();
    if (d[u][v] != duv) continue;
    for (long i = 0; i < a[v].size(); i++) {
      long w = a[v][i];
      long long A = (1ll * u * 131 * 131 + 1ll * v * 131 + w) % 1000000007;
      if (M[A]) continue;
      if (d[v][w] > d[u][v] + 1) {
        d[v][w] = d[u][v] + 1;
        tr[v][w] = u;
        pq.push(
            pair<long, pair<long, long> >(-d[v][w], pair<long, long>(v, w)));
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (long i = 1; i <= m; i++) {
    long u, v;
    cin >> u >> v;
    a[u].push_back(v);
    a[v].push_back(u);
    d[u][v] = d[v][u] = 1;
  }
  for (long i = 1; i <= k; i++) {
    long u, v, w;
    cin >> u >> v >> w;
    long long A = (1ll * u * 131 * 131 + 1ll * v * 131 + w) % 1000000007;
    M[A] = 1;
  }
  for (long i = 1; i <= n; i++)
    for (long j = 1; j <= n; j++) d[i][j] = 1000000007;
  for (long i = 1; i <= n; i++) d[1][1] = 0;
  djk();
  long tu, tv;
  for (long i = 0; i < a[n].size(); i++) {
    long v = a[n][i];
    if (res > d[v][n]) {
      res = d[v][n];
      tu = v, tv = n;
    }
  }
  if (res == 1000000007) {
    cout << -1;
    return 0;
  }
  kq.push_back(n), kq.push_back(tu);
  while (tr[tu][tv] != 1) {
    kq.push_back(tr[tu][tv]);
    long tg = tv;
    tv = tu;
    tu = tr[tu][tg];
  }
  cout << res << "\n";
  if (kq[kq.size() - 1] != 1) cout << 1 << " ";
  for (long i = kq.size() - 1; i >= 0; i--) cout << kq[i] << " ";
  return 0;
}
