#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
typedef int NUM;
const double EPS = 1e-12;
const int MOD = 1E9+7;
const int MAXD=105;
const int MAXT=1E6+10;
int rev_t[MAXT];

int exgcd(int a, int b, int& x, int& y){
    if(!b) return x=1,y=0,a;
    int u=exgcd(b,a%b,y,x);
    return y-=a/b*x,u;
}

int rev(int a)
{
	int r,v,ret;
	return exgcd(a,MOD,r,v)==1?(r+MOD)%MOD:0;
	if (a==1) return 1;
	if (a<MAXT&&rev_t[a]!=0) return rev_t[a];
	exgcd(a,MOD,r,v);
	ret=(r+MOD)%MOD;
	if (a<MAXT) rev_t[a]=ret;
	return ret;
}

inline NUM cmp(NUM a, NUM b){
	return a==b;
    //return fabs(a-b)>=EPS+fabs(a)*EPS?a-b:0;
}

struct POL{
	int d;
	NUM f[MAXD];
	POL() { memset(f,0,sizeof(f)); d=0; }
	NUM &operator [](int t) { return *(f+t); }
	const NUM &operator [](int t) const { return *(f+t); }
	NUM &back() { return f[d]; }
};

inline void print(const POL &a)
{
	cout << a[0];
	for (int i=1;i<=a.d;i++) cout << " " << a[i];
	puts("");
}

inline bool zero(const NUM &a) { return cmp(a,0); }

inline bool zero(const POL &a) {
	if (a.d==0&&zero(a[0])) return 1;
	else return 0;
}

inline void depre(POL &a) {
	while (a.d>0&&zero(a.back())) a.d--;
}

inline POL operator +(const POL &a, const POL &b) {
	POL ret;
	ret.d=max(a.d,b.d);
	for (int i=0;i<=ret.d;i++){
		ret[i]=a[i]+b[i];
		if (ret[i]>MOD) ret[i]-=MOD;
	}
	depre(ret);
	return ret;
}

inline POL operator -(const POL &a, const POL &b) {
	POL ret;
	ret.d=max(a.d,b.d);
	for (int i=0;i<=ret.d;i++){
		ret[i]=a[i]-b[i];
		if (ret[i]<0) ret[i]+=MOD;
	}
	depre(ret);
	return ret;
}

inline POL operator *(const POL &a, const POL &b) {
	POL ret;
	return ret;
}

inline POL operator /(const POL &a, const POL &b) {
	POL ret,r=a;
	ret.d=max(0,a.d-b.d);
	for (int i=ret.d;i>=0;i--){
//		ret[i]=r[i+b.d]/b[b.d];
		ret[i]=(LL)r[i+b.d]*rev(b[b.d])%MOD;
		for (int j=b.d;j>=0;j--){
//			r[i+j]-=ret[i]*b[j];
			r[i+j]=((r[i+j]-(LL)ret[i]*b[j])%MOD+MOD)%MOD;
		}
	}
	depre(ret);
	return ret;
}

inline POL operator %(const POL &a, const POL &b) {
	POL ret,r=a;
	ret.d=max(0,a.d-b.d);
	for (int i=ret.d;i>=0;i--){
//		ret[i]=r[i+b.d]/b[b.d];
		ret[i]=(LL)r[i+b.d]*rev(b[b.d])%MOD;
		for (int j=b.d;j>=0;j--){
//			r[i+j]-=ret[i]*b[j];
			r[i+j]=((r[i+j]-(LL)ret[i]*b[j])%MOD+MOD)%MOD;
		}
	}
	depre(r);
	return r;
}

inline bool operator ==(const POL &a, const POL &b) {
	if (a.d!=b.d) return 0;
	for (int i=0;i<=a.d;i++)
		if (!cmp(a[i],b[i])) return 0;
	return 1;
}

inline POL derive(const POL &a) {
	POL ret;
	if (a.d!=0) {
		ret.d=a.d-1;
		for (int i=1;i<=a.d;i++)
			ret[i-1]=(LL)a[i]*i%MOD;
	}
	else ret.d=0,ret[0]=0;
	return ret;
}

inline POL gcd(const POL &a, const POL &b) {
	if (zero(b)) return a;
	else return gcd(b,a%b);
}

POL p,q,r;
int n,a[110];

int main()
{
	scanf("%d",&n);
	p.d=n;
	for (int i=0;i<=n;i++) cin >> p[i];
	//scanf("%lf",&p[i]);
	memset(a,0,sizeof(a));
	for (int i=1;i<=n;i++){
		q=derive(p);
		r=gcd(p,q);
//		cout << "TEST" << endl;
//		print(p);
//		print(q);
//		print(r);
		q=r;
		r=p/r;
		a[i]=r.d;
		p=q;
	}
//	for (int i=1;i<=n;i++) printf("%d ",a[i]);puts("");
	for (int i=1;i<n;i++) a[i]-=a[i+1];
	for (int i=n;i>0;i--)
	if (a[i]!=0) {
		printf("%d\n",i);
		for (int j=1;j<=i;j++) printf("%d ",a[j]);
		puts("");
		break;
	}
}
