#include<cstdio>
#include<cmath>
#include<cassert>
#include<complex>
#include<vector>
#include<type_traits>
using namespace std;
#define FFT_LEN 65536
const double pi = acos(-1);
vector<complex<double>> fft(const vector<complex<double>> &x, const int &inv){
static bool fft_ready = false;
static complex<double> loli[FFT_LEN];
if(!fft_ready){
for(int k=0; k<FFT_LEN; k++){
loli[k] = exp(complex<double>(0, 2*pi*k/FFT_LEN));
}
fft_ready = true;
}
int n = x.size();
assert((n&-n)==n && n<=FFT_LEN && abs(inv)==1);
vector<complex<double>> X = x;
for(int i=1, j=0; i<n; i++){
for(int k=n>>1; !((j^=k)&k); k>>=1);
if(i < j){
swap(X[i], X[j]);
}
}
for(int i=2; i<=n; i*=2){
int d = (inv==1)? FFT_LEN-(FFT_LEN/i): FFT_LEN/i;
for(int j=0; j<n; j+=i){
for(int k=0, a=0; k<i/2; k++, a=(a+d)%FFT_LEN){
complex<double> s = X[j+k], t = loli[a] * X[j+k+i/2];
X[j+k] = s + t;
X[j+k+i/2] = s - t;
}
}
}
if(inv == -1){
for(int i=0; i<(int)X.size(); i++){
X[i] /= n;
}
}
return X;
}
template<class R> class polynomial{
private:
vector<R> a;
polynomial<R> slow_multiplication(const polynomial<R> &another) const{
if(!size() || !another.size()){
return polynomial<R>();
}
polynomial<R> result(size()+another.size()-1);
for(int i=0; i<(int)size(); i++) for(int j=0; j<(int)another.size(); j++){
result[i+j] += a[i] * another[j];
}
return result;
}
public:
polynomial(const size_t &n = 0){
a = vector<R>(n);
}
polynomial(const vector<R> &coef){
a = coef;
}
size_t size() const{
return a.size();
}
void resize(const size_t &n){
a.resize(n);
}
R& operator [](const int &i){
assert(0<=i && i<(int)a.size());
return a[i];
}
const R& operator [](const int &i) const{
assert(0<=i && i<(int)a.size());
return a[i];
}
polynomial<R> operator *(const polynomial<R> &another) const{
if(is_same<R, complex<double>>::value){
int n = size()+another.size()-1;
if(!size() || !another.size() || n<=32){
return slow_multiplication(another);
}
for(; (n&-n)!=n; n+=n&-n);
vector<complex<double>> x(n), y(n);
for(int i=0; i<(int)size(); i++){
x[i] = a[i];
}
for(int i=0; i<(int)another.size(); i++){
y[i] = another[i];
}
x = fft(x, 1);
y = fft(y, 1);
for(int i=0; i<n; i++){
x[i] *= y[i];
}
polynomial<complex<double>> result(fft(x, -1));
result.resize(size()+another.size()-1);
return result;
}else if(is_same<R, double>::value || is_same<R, int>::value || is_same<R, long long>::value){
polynomial<complex<double>> f(size()), g(another.size());
for(int i=0; i<(int)size(); i++){
f[i] = a[i];
}
for(int i=0; i<(int)another.size(); i++){
g[i] = another[i];
}
polynomial<complex<double>> h = f * g;
polynomial<R> result(h.size());
if(is_same<R, double>::value){
for(int i=0; i<(int)h.size(); i++){
result[i] = h[i].real();
}
}else{
for(int i=0; i<(int)h.size(); i++){
result[i] = (R)floor(h[i].real()+0.5);
}
}
return result;
}else{
return slow_multiplication(another);
}
}
};
int main(){
polynomial<int> f(2), g(2);
f[1] = 1, f[0] = 1;
g[1] = 1, g[0] = -1;
polynomial<int> h = f*g;
for(int i=(int)h.size()-1; i>=0; i--){
printf("%d%c", h[i], i? ' ': '\n');
}
return 0;
}