You successfully found poor Arkady near the exit of the station you've perfectly predicted. You sent him home on a taxi and suddenly came up with a question.

There are n crossroads in your city and several bidirectional roads connecting some of them. A taxi ride is a path from some crossroads to another one without passing the same crossroads twice. You have a collection of rides made by one driver and now you wonder if this driver can be a robot or they are definitely a human.

You think that the driver can be a robot if for every two crossroads a and b the driver always chooses the same path whenever he drives from a to b. Note that a and b here do not have to be the endpoints of a ride and that the path from b to a can be different. On the contrary, if the driver ever has driven two different paths from a to b, they are definitely a human.

Given the system of roads and the description of all rides available to you, determine if the driver can be a robot or not.

Input

Each test contains one or more test cases. The first line contains a single integer t (1 ≤ t ≤ 3 ⋅ 10^5) — the number of test cases.

The first line of each test case contains a single integer n (1 ≤ n ≤ 3 ⋅ 10^5) — the number of crossroads in the city.

The next line contains a single integer q (1 ≤ q ≤ 3 ⋅ 10^5) — the number of rides available to you.

Each of the following q lines starts with a single integer k (2 ≤ k ≤ n) — the number of crossroads visited by the driver on this ride. It is followed by k integers c_1, c_2, ..., c_k (1 ≤ c_i ≤ n) — the crossroads in the order the driver visited them. It is guaranteed that all crossroads in one ride are distinct.

It is guaranteed that the sum of values k among all rides of all test cases does not exceed 3 ⋅ 10^5.

It is guaranteed that the sum of values n and the sum of values q doesn't exceed 3 ⋅ 10^5 among all test cases.

Output

Output a single line for each test case.

If the driver can be a robot, output "Robot" in a single line. Otherwise, output "Human".

You can print each letter in any case (upper or lower).

Examples

Input


1
5
2
4 1 2 3 5
3 1 4 3


Output


Human


Input


1
4
4
3 1 2 3
3 2 3 4
3 3 4 1
3 4 1 2


Output


Robot

Note

In the first example it is clear that the driver used two different ways to get from crossroads 1 to crossroads 3. It must be a human.

In the second example the driver always drives the cycle 1 → 2 → 3 → 4 → 1 until he reaches destination.
#include <bits/stdc++.h>
using namespace std;
const int CUTOFF = 550;
int N, Q;
vector<vector<int>> rides;
bool consistent() {
  vector<int> location(N);
  vector<vector<pair<int, int>>> small_locations(N);
  for (int r = 0; r < Q; r++)
    if (rides[r].size() > CUTOFF) {
      fill(location.begin(), location.end(), -1);
      for (int i = 0; i < (int)rides[r].size(); i++) location[rides[r][i]] = i;
      for (int i = 0; i < Q; i++) {
        int previous = N;
        for (int x : rides[i]) {
          if (location[x] == -1) continue;
          if (location[x] > previous + 1) return false;
          previous = location[x];
        }
      }
    } else {
      for (int i = 0; i < (int)rides[r].size() - 1; i++)
        small_locations[rides[r][i]].emplace_back(r, i);
    }
  vector<int> after(N, -1);
  for (int cross = 0; cross < N; cross++) {
    for (pair<int, int> &p : small_locations[cross]) {
      int r = p.first, index = p.second;
      int next = rides[r][index + 1];
      for (int i = index + 1; i < (int)rides[r].size(); i++) {
        if (after[rides[r][i]] != -1 && after[rides[r][i]] != next)
          return false;
        after[rides[r][i]] = next;
      }
    }
    for (pair<int, int> &p : small_locations[cross]) {
      int r = p.first, index = p.second;
      for (int i = index + 1; i < (int)rides[r].size(); i++)
        after[rides[r][i]] = -1;
    }
  }
  return true;
}
void solve_case() {
  scanf("%d %d", &N, &Q);
  rides.assign(Q, {});
  for (int i = 0; i < Q; i++) {
    int k;
    scanf("%d", &k);
    rides[i].resize(k);
    for (int &c : rides[i]) {
      scanf("%d", &c);
      c--;
    }
  }
  puts(consistent() ? "Robot" : "Human");
}
int main() {
  int T;
  scanf("%d", &T);
  while (T-- > 0) solve_case();
}
