#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<int>k(M);
  vector<int>p(M);
  for (int i = 0; i < M; i++) {
    vector<vector<int>>s(M,vector<int>(k.at(i));
    for (int j = 0; j < k.at(i); j++) {
      cin >> k.at(i) >> s.at(i).at(j);
    }
  }
}
