#include <bits/stdc++.h>

using ll   = long long;
using uint = unsigned int;
using ull  = unsigned long long;
using ld   = long double;
template<typename T>
using max_heap = std::priority_queue<T>;
template<typename T>
using min_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
constexpr int popcount(const ull v) { return v ? __builtin_popcountll(v) : 0; }
constexpr int log2p1(const ull v) { return v ? 64 - __builtin_clzll(v) : 0; }
constexpr int lsbp1(const ull v) { return __builtin_ffsll(v); }
constexpr int clog(const ull v) { return v ? log2p1(v - 1) : 0; }
constexpr ull ceil2(const ull v) { return 1ULL << clog(v); }
constexpr ull floor2(const ull v) { return v ? (1ULL << (log2p1(v) - 1)) : 0ULL; }
constexpr bool btest(const ull mask, const int ind) { return (mask >> ind) & 1ULL; }
template<typename T> void bset(T& mask, const int ind) { mask |= ((T)1 << ind); }
template<typename T> void breset(T& mask, const int ind) { mask &= ~((T)1 << ind); }
template<typename T> void bflip(T& mask, const int ind) { mask ^= ((T)1 << ind); }
template<typename T> void bset(T& mask, const int ind, const bool b) { (b ? bset(mask, ind) : breset(mask, ind)); }
template<typename T> bool chmin(T& a, const T& b) { return (a > b ? a = b, true : false); }
template<typename T> bool chmax(T& a, const T& b) { return (a < b ? a = b, true : false); }

template<typename T> constexpr T inf_v      = std::numeric_limits<T>::max() / 4;
template<typename Real> constexpr Real pi_v = Real{3.141592653589793238462643383279502884};
constexpr ull TEN(const int n) { return n == 0 ? 1ULL : TEN(n - 1) * 10ULL; }
template<typename F> struct fix : F
{
    fix(F&& f) : F{std::forward<F>(f)} {}
    template<typename... Args> auto operator()(Args&&... args) const { return F::operator()(*this, std::forward<Args>(args)...); }
};
class printer
{
public:
    printer(std::ostream& os_ = std::cout) : os{os_} {}
    template<typename T> int operator()(const T& v) { return os << v, 0; }
    template<typename T> int operator()(const std::vector<T>& vs)
    {
        for (int i = 0; i < (int)vs.size(); i++) { os << (i ? " " : ""), this->operator()(vs[i]); }
        return 0;
    }
    template<typename T> int operator()(const std::vector<std::vector<T>>& vss)
    {
        for (int i = 0; i < (int)vss.size(); i++) { os << (0 <= i or i + 1 < (int)vss.size() ? "\n" : ""), this->operator()(vss[i]); }
        return 0;
    }
    template<typename T, typename... Args> int operator()(const T& v, const Args&... args) { return this->operator()(v), os << ' ', this->operator()(args...), 0; }
    template<typename... Args> int ln(const Args&... args) { return this->operator()(args...), os << '\n', 0; }
    template<typename... Args> int el(const Args&... args) { return this->operator()(args...), os << std::endl, 0; }
    template<typename... Args> int fmt(const std::string& s, const Args&... args) { return rec(s, 0, args...); }

private:
    int rec(const std::string& s, int index) { return os << s.substr(index, s.size()), 0; }
    template<typename T, typename... Args> int rec(const std::string& s, int index, const T& v, const Args&... args) { return index == s.size() ? 0 : s[index] == '%' ? (this->operator()(v), rec(s, index + 1, args...)) : (os << s[index], rec(s, index + 1, v, args...)); }
    std::ostream& os;
};
printer out;

template<typename T, typename F> std::vector<T> generated(const int n, F f)
{
    std::vector<T> ans(n);
    return std::generate(ans.begin(), ans.end(), f), ans;
}
std::vector<int> ioted(const int n, const int offset = 0)
{
    std::vector<int> ans(n);
    return std::iota(ans.begin(), ans.end(), offset), ans;
}
template<typename Vs> Vs reversed(const Vs& vs)
{
    auto ans = vs;
    return std::reverse(ans.begin(), ans.end()), ans;
}
template<typename T, typename F = std::less<T>> std::vector<T> sorted(const std::vector<T>& vs, F comp = F{})
{
    auto ans = vs;
    return std::sort(ans.begin(), ans.end(), comp), ans;
}
template<typename F> std::vector<int> sorted_iota(const int n, F comp = F{}, const int offset = 0) { return sorted(ioted(n, offset), comp); }
class scanner
{
public:
    scanner(std::istream& is_ = std::cin) : is{is_} { is.tie(nullptr), std::ios::sync_with_stdio(false); }
    template<typename T> T val()
    {
        static T v;
        return is >> v, v;
    }
    template<typename T> T val(const T offset) { return val<T>() - offset; }
    template<typename T> std::vector<T> vec(const int n)
    {
        return generated<T>(n, [&] { return val<T>(); });
    }
    template<typename T> std::vector<T> vec(const int n, const T offset)
    {
        return generated<T>(n, [&] { return val<T>(offset); });
    }
    template<typename T> std::vector<std::vector<T>> vvec(const int n0, const int n1)
    {
        return generated<std::vector<T>>(n0, [&] { return vec<T>(n1); });
    }
    template<typename T> std::vector<std::vector<T>> vvec(const int n0, const int n1, const T offset)
    {
        return generated<std::vector<T>>(n0, [&] { return vec<T>(n1, offset); });
    }
    template<typename... Args> auto tup() { return std::tuple<std::decay_t<Args>...>{val<Args>()...}; }
    template<typename... Args> auto tup(const Args&... offsets) { return std::tuple<std::decay_t<Args>...>{val<Args>(offsets)...}; }

private:
    std::istream& is;
};
scanner in;
#    define SHOW(...) static_cast<void>(0)

template<typename T, int n, int i = 0>
auto make_v(int const (&szs)[n], const T x = T{})
{
    if constexpr (i == n) {
        return x;
    } else {
        return std::vector(szs[i], make_v<T, n, i + 1>(szs, x));
    }
}

const auto min_merge    = [](const auto& x1, const auto& x2) { return std::min(x1, x2); };
const auto max_merge    = [](const auto& x1, const auto& x2) { return std::max(x1, x2); };
const auto minmax_merge = [](const auto& x1, const auto& x2) { return decltype(x1){std::min(x1.first, x2.first), std::max(x1.second, x2.second)}; };
const auto sum_merge    = [](const auto& x1, const auto& x2) { return x1 + x2; };
const auto affine_merge = [](const auto& x1, const auto& x2) { return decltype(x1){x1.first * x2.first, x1.first * x2.second + x1.second}; };

const auto plus_comp   = [](const auto& f1, const auto& f2) { return f1 + f2; };
const auto mult_comp   = [](const auto& f1, const auto& f2) { return f1 * f2; };
const auto assign_comp = [](const auto f1, const auto f2) { return f1 == inf_v<decltype(f1)> ? f2 : f1; };
const auto affine_comp = [](const auto& f1, const auto& f2) { return decltype(f1){f1.first * f2.first, f1.first * f2.second + f1.second}; };

const auto min_plus_apply      = [](const auto& f, const auto& x, const auto&) { return x + f; };
const auto max_plus_apply      = [](const auto& f, const auto& x, const auto&) { return x + f; };
const auto minmax_plus_apply   = [](const auto& f, const auto& x, const auto&) { return decltype(x){x.first + f, x.second + f}; };
const auto minmax_mult_apply   = [](const auto& f, const auto& x, const auto&) { return f >= 0 ? decltype(x){f * x.first, f * x.second} : decltype(x){f * x.second, f * x.first}; };
const auto min_assign_apply    = [](const auto& f, const auto& x, const auto&) { return f == inf_v<decltype(f)> ? x : f; };
const auto max_assign_apply    = [](const auto& f, const auto& x, const auto&) { return f == inf_v<decltype(f)> ? x : f; };
const auto minmax_assign_apply = [](const auto& f, const auto& x, const auto&) { return f == inf_v<decltype(f)> ? x : decltype(x){f, f}; };
const auto minmax_affine_apply = [](const auto& f, const auto x, const auto&) { return f.first >= 0 ? decltype(x){x.first * f.first + f.second, x.second * f.first + f.second} : decltype(x){x.second * f.first + f.second, x.first * f.first + f.second}; };
const auto sum_plus_apply      = [](const auto& f, const auto& x, const auto& l) { return x + f * l; };
const auto sum_mult_apply      = [](const auto& f, const auto& x, const auto&) { return x * f; };
const auto sum_assign_apply    = [](const auto& f, const auto& x, const auto& l) { return f == inf_v<decltype(f)> ? x : f * l; };
const auto sum_affine_apply    = [](const auto& f, const auto x, const auto& l) { return x * f.first + f.second * l; };

const auto reverse = [](const auto f) { return [f](const auto& x1, const auto& x2) { return f(x2, x1); }; };


template<typename T = int>
struct edge
{
    using cost_type = T;
    int u, v;
    T c;
    edge(const int u_, const int v_) : u{u_}, v{v_}, c{1} {}
    edge(const int u_, const int v_, const T& c_) : u{u_}, v{v_}, c{c_} {}
    operator int() const { return v; }
    int from() const { return u; }
    int to() const { return v; }
    T cost() const { return c; }
    friend std::ostream& operator<<(std::ostream& os, const edge& e) { return os << e.u << "->" << e.v << ":" << e.c; }
};
template<typename Edge>
class base_graph
{
public:
    base_graph(const int n) : sz{n}, es(n), res(n) {}
    void add_edge(const int u, const int v, const bool bi = false)
    {
        es[u].emplace_back(u, v), res[v].emplace_back(v, u);
        if (bi) { es[v].emplace_back(v, u), res[u].emplace_back(u, v); }
    }
    template<typename Cost>
    void add_edge(const int u, const int v, const Cost& c, const bool bi = false)
    {
        es[u].emplace_back(u, v, c), res[v].emplace_back(v, u, c);
        if (bi) { es[v].emplace_back(v, u, c), res[u].emplace_back(u, v, c); }
    }
    std::vector<Edge>& operator[](const int u) { return es[u]; }
    const std::vector<Edge>& operator[](const int u) const { return es[u]; }
    std::vector<Edge>& from(const int u) { return es[u]; }
    const std::vector<Edge>& from(const int u) const { return es[u]; }
    std::vector<Edge>& to(const int v) { return res[v]; }
    const std::vector<Edge>& to(const int v) const { return res[v]; }
    int size() const { return sz; }
    friend std::ostream& operator<<(std::ostream& os, const base_graph& g)
    {
        for (int i = 0; i < g.sz; i++) {
            for (const auto& e : g.es[i]) { os << e << '\n'; }
        }
        return os;
    }

private:
    int sz;
    std::vector<std::vector<Edge>> es, res;
};
template<typename Edge>
using base_tree = base_graph<Edge>;
using graph     = base_graph<edge<>>;
using tree      = base_graph<edge<>>;
template<typename Cost>
using cost_graph = base_graph<edge<Cost>>;
template<typename Cost>
using cost_tree = base_graph<edge<Cost>>;
template<typename Edge = edge<>>
class hl_decomp
{
public:
    hl_decomp(base_tree<Edge>& g, const int r = 0) : pars(g.size(), -1), tops{pars}, ins{pars}, rins{pars}, outs{pars}
    {
        const int n = g.size();
        std::vector<int> sz(n, 1);
        auto dfs1 = [&](auto&& self, const int s, const int p) -> int {
            pars[s]  = p;
            int maxi = -1, max = 0;
            for (int i = 0; i < (int)g[s].size(); i++) {
                const auto& e = g[s][i];
                const int to  = e.to();
                if (p == to) { continue; }
                sz[s] += self(self, to, s);
                if (max < sz[g[s][i].to()]) { max = sz[g[s][i].to()], maxi = i; }
            }
            if (maxi != -1) { std::swap(g[s][maxi], g[s][0]); }
            return sz[s];
        };
        dfs1(dfs1, r, -1);
        tops[r]   = r;
        auto dfs2 = [&](auto&& self, const int s, const int p, int& ind) -> void {
            ins[s] = ind++, rins[ins[s]] = s;
            for (const auto& e : g[s]) {
                const int to = e.to();
                if (to == p) { continue; }
                tops[to] = (to == g[s][0].to() ? tops[s] : to);
                self(self, to, s, ind);
            }
            outs[s] = ind;
        };
        int ind = 0;
        dfs2(dfs2, r, -1, ind);
    }
    int pos(const int v) const { return ins[v]; }
    int at(const int n) const { return rins[n]; }
    std::pair<int, int> sub(const int v) const { return {ins[v], outs[v]}; }
    std::vector<std::pair<int, int>> path(int u, int v) const
    {
        using P = std::pair<int, int>;
        std::vector<P> head, tail;
        for (int pu = tops[u], pv = tops[v]; pu != pv;) {
            if (ins[pu] < ins[pv]) {
                tail.push_back({ins[pv], ins[v]});
                v = pars[pv], pv = tops[v];
            } else {
                head.push_back({ins[u], ins[pu]});
                u = pars[pu], pu = tops[u];
            }
        }
        head.push_back({ins[u], ins[v]});
        std::reverse(tail.begin(), tail.end());
        for (const auto& p : tail) { head.push_back(p); }
        return head;
    }
    friend std::ostream& operator<<(std::ostream& os, const hl_decomp& hld)
    {
        os << "rins = {";
        for (const int v : hld.rins) { os << v << ","; }
        os << "}\ntops = {";
        for (const int v : hld.tops) { os << v << ","; }
        return os << "}";
    }

private:
    std::vector<int> pars, tops, ins, rins, outs;
};

template<typename T, typename F>
class dualseg
{
public:
    dualseg(const std::vector<T>& vs, F compose_, T id_) : sz{(int)vs.size()}, depth{(int)clog(sz)}, half{1 << depth}, ops(half << 1, id_), compose{compose_}, id{id_} { std::copy(vs.begin(), vs.end(), ops.begin() + half); }
    T get(const int a) const
    {
        assert(0 <= a and a < sz);
        T ans = id;
        for (int i = 0; i <= depth; i++) { ans = compose(ans, ops[(a + half) >> (depth - i)]); }
        return ans;
    }
    void set(int a, const T& f)
    {
        assert(0 <= a and a < sz);
        clean(a += half), clean(a + 1), ops[a] = f;
    }
    void act(int L, int R, const T& f)
    {
        assert(0 <= L and R <= sz);
        if (L >= R) { return; }
        clean(L += half), clean(R += half);
        for (; L < R; L >>= 1, R >>= 1) {
            if (L & 1) { update(L++, f); }
            if (R & 1) { update(--R, f); }
        }
    }
    friend std::ostream& operator<<(std::ostream& os, const dualseg& seg)
    {
        os << "[";
        for (int i = 0; i < seg.sz; i++) { os << seg.get(i) << (i + 1 == seg.sz ? "" : ","); }
        return (os << "]\n");
    }

private:
    void down(const int a) { update(a << 1, ops[a]), update(a << 1 | 1, ops[a]), ops[a] = id; }
    void clean(const int a)
    {
        const int b = (a / (a & -a)) >> 1;
        for (int i = 0; i < depth; i++) {
            const int v = a >> (depth - i);
            if (v > b) { break; }
            down(v);
        }
    }
    void update(const int a, const T& f) { ops[a] = compose(f, ops[a]); }
    const int sz, depth, half;
    std::vector<T> ops;
    F compose;
    T id;
};
int main()
{
    std::mt19937 mt{std::random_device{}()};
    const auto T = in.val<int>();
    for (int t = 0; t < T; t++) {
        const auto [N, M] = in.tup<int, int>();
        graph g(N);
        for (int i = 0; i < M; i++) {
            const auto [u, v] = in.tup<int, int>(1, 1);
            g.add_edge(u, v);
        }
        auto is_ok = [&](const int r) -> bool {
            std::vector<int> depth(N, -1);
            depth[r] = 0;
            return fix([&](auto dfs, const int s) -> bool {
                for (const int to : g[s]) {
                    if (depth[to] != -1) {
                        if (depth[to] >= depth[s]) { return false; }
                        continue;
                    }
                    depth[to]      = depth[s] + 1;
                    const bool sub = dfs(to);
                    if (not sub) { return false; }
                }
                return true;
            })(r);
        };
        int r = -1;
        {
            std::vector<int> vs(N);
            std::iota(vs.begin(), vs.end(), 0);
            std::shuffle(vs.begin(), vs.end(), mt);
            for (int i = 0; i < std::min(100, N); i++) {
                if (is_ok(vs[i])) {
                    r = vs[i];
                    break;
                }
            }
        }
        SHOW(r);
        if (r == -1) {
            out.ln(-1);
            continue;
        }
        std::vector<bool> used(N, false);
        std::vector<std::vector<int>> backss(N);
        std::vector<std::set<int>> foress(N);
        graph tree(N);
        fix([&](auto dfs, const int s) -> void {
            used[s] = true;
            for (const int to : g[s]) {
                if (used[to]) {
                    backss[s].push_back(to);
                } else {
                    foress[s].insert(to);
                    dfs(to);
                }
            }
        })(r);
        for (int i = 0; i < N; i++) {
            for (const int f : foress[i]) { tree.add_edge(i, f, true); }
        }

        const auto hld = hl_decomp(tree);

        auto seg1 = dualseg(std::vector<int>(N, 0), plus_comp, 0);
        auto seg2 = dualseg(std::vector<int>(N, inf_v<int>), assign_comp, inf_v<int>);
        for (int i = 0; i < N; i++) {
            for (const int b : backss[i]) {
                const auto ps = hld.path(i, b);
                for (const auto& [L, R] : ps) {
                    const int l = std::min(L, R);
                    const int r = std::max(L, R) + 1;
                    seg1.act(l, r, 1);
                    seg2.act(l, r, b);
                }
            }
        }
        std::vector<bool> ok(N, false);
        ok[r] = true;
        fix([&](auto dfs, const int s) -> void {
            if (seg1.get((int)hld.pos(s)) == 1) {
                const int b = seg2.get((int)hld.pos(s));
                ok[s]       = ok[b];
            }
            for (const int f : foress[s]) { dfs(f); }
        })(r);
        std::vector<int> ans;
        for (int i = 0; i < N; i++) {
            if (ok[i]) { ans.push_back(i + 1); }
        }
        const int num = ans.size();
        if (num * 5 < N) {
            out.ln(-1);
        } else {
            std::sort(ans.begin(), ans.end());
            out.ln(ans);
        }
    }
    return 0;
}

 	 		 		  	  	 						   		    	