/*
* POJ_2356.cpp
*
* Created on: 2013年10月8日
* Author: Administrator
*/
#include <iostream>
#include <cstdio>
using namespace std;
const int maxn = 10005;
int a[maxn], s[maxn], mod[maxn];
void print(int s, int t) {
printf("%d\n", t - s + 1);
int i;
for (i = s; i <= t; ++i) {
printf("%d\n", a[i]);
}
}
int main() {
int n;
scanf("%d", &n);
memset(a, 0, sizeof(a));
memset(s, 0, sizeof(s));
memset(mod, 0, sizeof(mod));
int i;
for (i = 1; i <= n; ++i) {
scanf("%d", &a[i]);
s[i] = s[i-1] + a[i];
if (s[i] % n == 0) {
print(1, i);
break;
} else if (!mod[s[i] % n]) {
mod[s[i] % n] = i;
} else {
print(mod[s[i] % n] + 1, i);
break;
}
}
}