#include <cstdio>

#define maxn 100000

int xn = 0, x[maxn];

int main()
{
  int n, tn = 0;

  while (scanf("%d", &n) == 1)
  {
    if (tn)
      x[xn++] = 0;

    char s[99];
    sprintf(s, "%02d", ++tn);

    fprintf(stderr, "Test=%s\n", s);

    FILE *F = fopen(s, "wt");
    fprintf(F, "%d\n", n);
    for (int i = 0; i < n; i++)
    {
      int a;
      scanf("%d", &a);
      x[xn++] = a;
      fprintf(F, "%d%c", a, i == n - 1 ? '\n' : ' ');
    }
    fclose(F);
  }

  char s[99];
  sprintf(s, "%02d", ++tn);

  fprintf(stderr, "Test=%s\n", s);

  FILE *F = fopen(s, "wt");
  fprintf(F, "%d\n", xn);
  for (int i = 0; i < xn; i++)
    fprintf(F, "%d%c", x[i], i == xn - 1 ? '\n' : ' ');
  fclose(F);
  return 0;
}
