#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class t, class u>
void chmax(t& first, u second) {
  if (first < second) first = second;
}
template <class t, class u>
void chmin(t& first, u second) {
  if (first > second) first = second;
}
template <class t>
using vc = vector<t>;
template <class t>
using vvc = vc<vc<t>>;
using pi = pair<int, int>;
using vi = vc<int>;
template <class t, class u>
ostream& operator<<(ostream& os, const pair<t, u>& p) {
  return os << "{" << p.first << "," << p.second << "}";
}
template <class t>
ostream& operator<<(ostream& os, const vc<t>& v) {
  os << "{";
  for (auto e : v) os << e << ",";
  return os << "}";
}
struct arr {
  int n, t;
  vi first, second;
  arr(int nn) : n(nn), t(0), first(n), second(n) {}
  void cl() { t++; }
  int& operator[](int i) {
    if (second[i] < t) {
      first[i] = -1;
      second[i] = t;
    }
    return first[i];
  }
};
void slv() {
  int n, q;
  cin >> n >> q;
  vvc<int> first(q);
  for (int i = int(0); i < int(q); i++) {
    int k;
    cin >> k;
    first[i].resize(k);
    for (int j = int(0); j < int(k); j++) {
      cin >> first[i][j];
      first[i][j]--;
    }
  }
  arr w(n);
  sort(first.begin(), first.end(),
       [](const vi& x, const vi& y) { return x.size() < y.size(); });
  const int V = 500;
  while (first.size() && first.back().size() >= V) {
    vi second = first.back();
    first.pop_back();
    w.cl();
    for (int i = int(0); i < int(second.size()); i++) w[second[i]] = i;
    for (const auto& c : first) {
      int last = -1, pre = n;
      for (auto i : c) {
        if (w[i] == -1) {
        } else {
          if (w[i] < pre) {
            pre = w[i];
          } else if (last != -1 && last + 1 == w[i]) {
          } else {
            cout << "Human\n";
            return;
          }
        }
        last = w[i];
      }
    }
  }
  vvc<pi> idx(n);
  for (int i = int(0); i < int(first.size()); i++)
    for (int j = int(0); j < int(int(first[i].size()) - 1); j++)
      idx[first[i][j]].emplace_back(i, j);
  for (int i = int(0); i < int(n); i++) {
    w.cl();
    for (auto p : idx[i]) {
      int z = first[p.first][p.second + 1];
      for (int jj = int(p.second + 1); jj < int(first[p.first].size()); jj++) {
        int j = first[p.first][jj];
        if (w[j] == -1) w[j] = z;
        if (w[j] != z) {
          cout << "Human\n";
          return;
        }
      }
    }
  }
  cout << "Robot\n";
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
  int t;
  cin >> t;
  for (int _ = int(0); _ < int(t); _++) slv();
}
