#include <bits/stdc++.h>
using namespace std;
int main() {
  random_device rnd, rnd2, rnd3;
  mt19937 mt(rnd()), mt2(rnd2()), mt3(rnd3());
  uniform_int_distribution<> rand100(0, 1000);
  int N, M;
  N = rand100(mt) % 3 + 1;
  M = rand100(mt) % 6;
  cout << N << " " << M << endl;
  for (int i = 0; i < M; i++) {
    cout << rand100(mt) % N + 1 << " " << rand100(mt) % 10 << endl;
  }
}
