int main(int argc, const char *argv[]) {
  const int max = 1000;
  int *a = malloc(max * sizeof(int));
  for (int n = 0; n < max - 1; n ++) {
    for (int m = n - 1; m >= 0; m --) {
      if (a[m] == a[n]) {
        a[n+1] = n - m;
        break;
      }
    }
  }

  printf();
  for (int i = 0; i < 10; i ++) printf(, a[i]);
  printf();
  for (int i = 990; i < 1000; i ++) printf(, a[i]);
  putchar('\n');

  return 0;
}