#include <bits/stdc++.h>
using namespace std;
template <class n, class second>
ostream &operator<<(ostream &p, pair<n, second> x) {
  return p << "<" << x.first << ", " << x.second << ">";
}
template <class n>
auto operator<<(ostream &p, n y) ->
    typename enable_if<!is_same<n, string>::value,
                       decltype(y.begin(), p)>::type {
  int o = 0;
  p << "{";
  for (auto c : y) {
    if (o++) p << ", ";
    p << c;
  }
  return p << "}";
}
void dor() { cerr << '\n'; }
template <class n, class... second>
void dor(n p, second... y) {
  cerr << p << " ";
  dor(y...);
}
template <class n, class second>
void mini(n &p, second y) {
  if (p > y) p = y;
}
template <class n, class second>
void maxi(n &p, second y) {
  if (p < y) p = y;
}
const int MXN = 1e5 + 6;
vector<int> V[MXN];
vector<int> Vr[MXN];
int ans[MXN];
int odw[MXN];
int asdfhsdkhfgkh[MXN];
int pp[MXN];
void dfsr(int x, int bad, int pop) {
  pp[x] = pop;
  asdfhsdkhfgkh[x] = 1;
  for (auto i : V[x]) {
    if (odw[i] == 1 && asdfhsdkhfgkh[i] == 0 && i != pop) bad = 1;
  }
  if (odw[x] == 2) bad = 1;
  if (bad == 0) {
    odw[x] = 1;
    for (auto i : Vr[x]) {
      if (odw[i] == 1 && asdfhsdkhfgkh[i] == 0 && pp[i] != x) {
        dfsr(i, 1, x);
      }
      if (odw[i] == 0) {
        dfsr(i, 0, x);
      }
    }
  } else {
    odw[x] = 2;
    for (auto i : Vr[x])
      if (odw[i] != 2 && asdfhsdkhfgkh[i] == 0) dfsr(i, 1, x);
  }
  asdfhsdkhfgkh[x] = 0;
}
int kol[MXN];
int n, m;
void solve() {
  cin >> n >> m;
  std::random_device dev;
  std::mt19937 rng(dev());
  std::uniform_int_distribution<std::mt19937::result_type> dist(1, n);
  for (int i = (1); i <= (int)(n); ++i) {
    V[i].clear();
    Vr[i].clear();
    ans[i] = 1;
  }
  for (int i = (1); i <= (int)(m); ++i) {
    int a, b;
    cin >> a >> b;
    V[a].push_back(b);
    Vr[b].push_back(a);
  }
  for (int j = 0; j < (int)(500); ++j) {
    int x = dist(rng);
    dfsr(x, 0, 0);
    for (int i = (1); i <= (int)(n); ++i) {
      if (odw[i] == 2) ans[i] = 0;
      odw[i] = 0;
      random_shuffle((V[i]).begin(), (V[i]).end());
      random_shuffle((Vr[i]).begin(), (Vr[i]).end());
    }
  }
  vector<int> res;
  for (int i = (1); i <= (int)(n); ++i)
    if (ans[i]) res.push_back(i);
  ;
  if (res.size() * 10 < 2 * n)
    cout << -1 << '\n';
  else {
    for (auto i : res) cout << i << " ";
    cout << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  int z;
  cin >> z;
  while (z--) solve();
}
