#include "testlib.h"

using namespace std;
using ll = long long;

#define forn(i, n) for (int i = 0; i < int(n); i++)

int main(int argc, char* argv[]) {
    registerValidation(argc, argv);
    int t = inf.readInt(1, 10'000, "t");
    inf.readEoln();

    int sum_n = 0;

    forn(tt, t) {
        setTestCase(tt + 1);
        int n = inf.readInt(1, 2'00'000, "n");
        inf.readSpace();
        int m = inf.readInt(1, n, "m");
        inf.readEoln();
        sum_n += n;
        ensuref(sum_n <= 2'00'000, "sum of n must not exceed 200000");
        string s = inf.readString("[a-z]{" + to_string(n) + "}", "s");
    }
    inf.readEof();
}
