/***
 * Usage: n, m
 *
 * n - max N
 * m - max number
 ***/

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

unsigned R()
{
  return rand() + (rand() << 15);
}

int R( int l, int r )
{
  return l + R() % (r - l + 1);
}

__int64 Time()
{
  _asm rdtsc
}

#define maxn 200000

int xn = 0, x[maxn], num[maxn];

int main( int argc, char *argv[] )
{
  int i, j, n = atoi(argv[2]), m = atoi(argv[3]);
  int seed = atoi(argv[1]);

  fprintf(stderr, "n=%d m=%d seed=%d\n", n, m, seed);

  srand(seed == -1 ? Time() : seed);

  int a = 1, s = 0;
  while ((n + s) / a > 1)
  {
    x[xn] = 2 + R() % (min(m, (n + s) / a) - 1);
    a *= x[xn];
    s += x[xn] - 1;
    xn++;
  }
  
  fprintf(stderr, "x: ");
  for (i = 0; i < xn; i++)
    fprintf(stderr, "%d ", x[i]);
  fprintf(stderr, "\n");

  int ones = 0, sum = x[0], pr = x[0];
  memset(num, 0, sizeof(num));

  for (i = 1; i < xn; i++)
  {
    while (sum + x[i] <= pr * x[i])
      sum++, num[i]++, ones++;
    sum += x[i], pr *= x[i];
  }

  printf("%d\n", xn + ones);
  printf("%d ", x[0]);
  for (i = 1; i < xn; i++)
  {
    while (num[i]--)
      printf("1 ");
    printf("%d%c", x[i], i == xn - 1 ? '\n' : ' ');
  }
  return 0;
}
