#include <bits/stdc++.h>
#include "testlib.h"

using namespace std;

int main(int argc, char** argv) {
  registerGen(argc, argv, 1);
  cout << 1 << "\n";
  
  int n = opt<int>("n");
  int minstart = opt<int>("minstart");
  int maxstart = opt<int>("maxstart");
  int minops = opt<int>("minops");
  int maxops = opt<int>("maxops");
  int r = opt<int>("r");
  int start = rnd.next(minstart, maxstart);
  if (r < 3) {
    while (start % 3 != r) {
      start = rnd.next(minstart, maxstart);
    }
  }
  cout << n << "\n";
  vector<int> vals(n, start);
  for (int i = 0; i < n; ++i) {
    int ops = rnd.next(minops, maxops);
    vals[i] += ops;
    vals[(i + 1) % n] += 2 * ops;
  }
  println(vals);
  return 0;
}
