#include <bits/stdc++.h>
using namespace std;
const string week[7] = {"monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"};
int main() {
srand(4202265);
int n =rand() % 20 + 1, m =rand() % 20 + 1;
cout << n << " " << m << endl;
for (int i = 1; i <= n; i++) {
vector<int> vec;
for (int j = 1; j <= m; j++) vec.push_back(j);
for (int j = 1; j <= m; j++) {
if (j != 1) printf(" ");
int have = rand() % (int)vec.size();
printf("%d", vec[have]);
vec.erase(vec.begin() + have);
}
puts("");
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBzdHJpbmcgd2Vla1s3XSA9IHsibW9uZGF5IiwgInR1ZXNkYXkiLCAid2VkbmVzZGF5IiwgInRodXJzZGF5IiwgImZyaWRheSIsICJzYXR1cmRheSIsICJzdW5kYXkifTsKaW50IG1haW4oKSB7CglzcmFuZCg0MjAyMjY1KTsKCWludCBuID1yYW5kKCkgJSAyMCArIDEsIG0gPXJhbmQoKSAlIDIwICsgMTsKCgljb3V0IDw8IG4gPDwgIiAiIDw8IG0gPDwgZW5kbDsKCWZvciAoaW50IGkgPSAxOyBpIDw9IG47IGkrKykgewoJCXZlY3RvcjxpbnQ+IHZlYzsKCQlmb3IgKGludCBqID0gMTsgaiA8PSBtOyBqKyspIHZlYy5wdXNoX2JhY2soaik7CgoJCWZvciAoaW50IGogPSAxOyBqIDw9IG07IGorKykgewoJCQlpZiAoaiAhPSAxKSBwcmludGYoIiAiKTsKaW50IGhhdmUgPSByYW5kKCkgJSAoaW50KXZlYy5zaXplKCk7CgkJCXByaW50ZigiJWQiLCB2ZWNbaGF2ZV0pOwoJdmVjLmVyYXNlKHZlYy5iZWdpbigpICsgaGF2ZSk7CgkJCQoJCX0KCQlwdXRzKCIiKTsKCX0KCXJldHVybiAwOwp9Cg==