/**
 * Author: Sergey Kopeliovich (Burunduk30@gmail.com)
 * Date: 2013.10.05
 */

#include <cstdio>
#include <cassert>

#include "random.h"

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

int main( int argc, char *argv[] )
{
  if (argc < 5)
  {
    puts("Usage: <seed for random> <n> <k> <c>");
    puts("  [seed == 0] => Time()");
    return 1;
  }

  int seed = atoi(argv[1]);
  int n = atoi(argv[2]);
  int k = atoi(argv[3]);
  int c = atoi(argv[4]);

  int *x = new int[n];
  int *y = new int[n];

  if (seed == 0)
    seed = Time(), fprintf(stderr, "seed = %d\n", seed);
  initrand(seed);

  printf("%d %d\n", n, k);
  forn(i, n)
  {
    int bad;
    do
    {
      x[i] = R(0, c), y[i] = R(0, c);
      bad = 0;
      forn(a, i)
        if (x[a] == x[i] && y[a] == y[i])
          bad = 1;
      forn(a, i)
        forn(b, a)
          if ((x[a] - x[i]) * (y[b] - y[i]) == (x[b] - x[i]) * (y[a] - y[i]))
            bad = 1;
    } while (bad);
    printf("%d %d\n", x[i], y[i]);
  }
  return 0;
}
