#include <iostream>
using namespace std;

int main()
{
	int n,p,t=0;
	cin >> n;
	int *a = new int[n];
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			cin >> p;
			if (p == 1 || p == 3)break;
			if (j == n-1)a[t++] = i + 1;
		}
	}
	cout<<t<<endl;
	for (int i = 0; i < t; i++)
		cout<<a[i]<<" ";
	delete[] a;
	//system("pause");
	return 0;
}


#include <iostream>
#include <vector>
//#define DEBUG
using namespace std;
struct CarInfo
{
	int num,state;
};
int main()
{
	int Nmax = 100;
	int n;
	int a[Nmax][Nmax];
	cin>>n;
	vector<CarInfo> cars(n);
	for(int i = 0; i < n; i++)
	{
		cars[i].state = 1;
		for(int j = 0; j < n; j++)
		{
			cin>>a[i][j];
			if(a[i][j] == 1) cars[i].state = 0;
			if(a[i][j] == 3) cars[i].state = cars[j].state = 0;
		}
	}
	int count = 0;
	for(int i = 0; i < n; i++)
		if(cars[i].state)
		{
			cout<<i+1<<" ";
			count++;
		}
	if(!count)cout<<0<<endl;
#ifdef DEBUG
	system("pause");
#endif
	cars.clear();
	return 0;
}


#include <iostream>
//#define DEBUG
using namespace std;
int main()
{
	int Nmax = 100,n,count;
	int a[Nmax][Nmax],c[Nmax];
	cin>>n;
	count = n;
	for(int i = 0; i < n; i++)
	{
		c[i]= 1;
		for(int j = 0; j < n; j++)
		{
			cin>>a[i][j];
			c[i] = a[i][j] == 1 ? 0 : c[i];
			if(a[i][j] == 3) c[i] = c[j] = 0;
		}
		count-= c[i] == 0 ? 1 : 0;
	}
	cout<<count<<endl;
	for(int i = 0; i < n; i++)
		if(c[i])cout<<i+1<<" ";
#ifdef DEBUG
	system("pause");
#endif
	return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	int a[101][101];
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			cin >> a[i][j];
	int p[101];
	for(int i=1;i<=n;i++)
		p[i]=0;
	int ans=n;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
	 	{
	 		if((a[i][j]==1) || (a[i][j]==3))
			 {
			  p[i]=1;
			  ans--;
			 }
	 	}
	cout << ans << endl;;
	for(int i=1;i<=n;i++)
	{
		if (p[i]==0) cout << i << " ";
	}

	return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	int a[101][101];
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			cin >> a[i][j];
	int p[101];
	for(int i=1;i<=n;i++)
		p[i]=0;
	int ans=0;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
	 	{
	 		if((a[i][j]==1) || (a[i][j]==3))
			 {
			  p[i]=1;

			 }
	 	}

	for(int i=1;i<=n;i++)
	{
		if (p[i]==0)
		ans++;

	}
	cout << ans << endl;;
	for(int i=1;i<=n;i++)
	{

		if (p[i]==0) cout << i << " ";
	}
	return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	int a[101][101];
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			cin >> a[i][j];
	int p[101];
	for(int i=1;i<=n;i++)
		p[i]=0;
	int ans=n;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
	 	{
	 		if((a[i][j]==1) || (a[i][j]==3))
			 {
			  p[i]=1;
			  ans--;
			 }
	 	}
	if (ans<0) ans=0;
	cout << ans << endl;;
	for(int i=1;i<=n;i++)
	{
		if (p[i]==0) cout << i << " ";
	}

	return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
	int n;
	cin >> n;
	int a[101][101];
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			cin >> a[i][j];
	int p[101];
	for(int i=1;i<=n;i++)
		p[i]=0;
	int ans=0;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
	 	{
	 		if((a[i][j]==1) || (a[i][j]==3))
			 {
			  p[i]=1;

			 }
	 	}

	for(int i=1;i<=n;i++)
	{
		ans++;

	}
	cout << ans << endl;;
	for(int i=1;i<=n;i++)
	{

		if (p[i]==0) cout << i << " ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
long long sum=0,i;
for(i=0;i<100000000000000000000;i++)
    sum+=5;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
long long sum=0,i;
for(i=0;i<10000000000;i++)
    sum+=5;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
int n,i,j,c=0;
cin>>n;
vector<int>v(n);
int arr[n][n];
for(i=0;i<n;i++){
    for(j=0;j<n;j++){
        cin>>arr[i][j];
        if(arr[i][j]==1){
            if(v[i]==0)
                c++;
            v[i]=1;
        }
        else if(arr[i][j]==2){
            if(v[j]==0)
                c++;
            v[j]=1;
        }
        else if(arr[i][j]==3){
            if(v[i]==0)
                c++;
            if(v[j]==0)
                c++;
            v[i]=1;
            v[j]=1;
        }
    }
}
cout<<n-c<<endl;
if(n-c>0){
    for(i=0;i<n;i++){
        if(v[i]==0)
            cout<<i+1<<" ";
    }
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
long long sum=0,i;
for(i=0;i<1000000000000000000000000000000;i++)
    sum+=5;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
long long sum=0,i,j;
for(i=0;i<1000000000000000000;i++)
    j=2+3;
return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
long long sum=0,i,j;
for(i=0;i<10000000000;i++)
    j=2+3;
return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
//typedef long long LL;
//const int N=1e5+100;
//const int inf=0x7f7f7f7f;

int main()
{
    int t,n,m;
    bool ok[105];
    cin>>t;
    for(int i=1; i<=t; ++i){
        for(int j=1; j<=t; ++j){
                int x;
                cin >>x;
                if(x==1||x==3)
                    ok[i]=true;
            }
    }
    int ans=0;
    for(int i=1; i<=t; ++i){
        if(!ok[i]) ans++;
    }
     cout<<ans<<endl;
     for(int i=1; i<=t; ++i){
         if(!ok[i])
           cout<<i;
     }
     if(ans)
	 cout<<"";
     return 0;
}


#include <stdio.h>using namespace std; typedef long long LL; const int N=1e5+100; const int inf=0x7f7f7f7f; bool ok[N]; int main() { int t,n,m; memset(ok,false,sizeof(ok)); scanf(%d,&t); for(int i=1; i<=t; ++i){ for(int j=1; j<=t; ++j){ int x; scanf(%d,&x); if(x==1||x==3) ok[i]=true; } } int ans=0; for(int i=1; i<=t; ++i){ if(!ok[i]) ans++; } printf(%d ,ans); for(int i=1; i<=t; ++i){ if(!ok[i]) printf(%d ,i); } if(ans) puts(); return 0; }


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
//typedef long long LL;
//const int N=1e5+100;
//const int inf=0x7f7f7f7f;

int main()
{
    int t,n,m;
    bool ok[1000005];
    cin>>t;
    for(int i=1; i<=t; ++i){
        for(int j=1; j<=t; ++j){
                int x;
                cin>>x;
                if(x==1||x==3)
                    ok[i]=true;
            }
    }
    int ans=0;
    for(int i=1; i<=t; ++i){
        if(!ok[i])
			ans++;
    }
    cout<<ans<<endl;;
     for(int i=1; i<=t; ++i){
         if(!ok[i])
            cout << " " << i;
     }
     if(ans)
		cout<<""<<endl;
     return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
//typedef long long LL;
//const int N=1e5+100;
//const int inf=0x7f7f7f7f;

int main()
{
    int t,n,m;
    bool ok[1000005];
    scanf("%d",&t);
    for(int i=1; i<=t; ++i){
        for(int j=1; j<=t; ++j){
                int x;
                scanf("%d",&x);
                if(x==1||x==3)
                    ok[i]=true;
            }
    }
    int ans=0;
    for(int i=1; i<=t; ++i){
        if(!ok[i]) ans++;
    }
     printf("%d\n",ans);
     for(int i=1; i<=t; ++i){
         if(!ok[i])
            printf("%d ",i);
     }
     if(ans) puts("");
     return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N=1e5+100;
const int inf=0x7f7f7f7f;
bool ok[N];
int main()
{
    int t,n,m;
    bool ok[N]= false;
    scanf("%d",&t);
    for(int i=1; i<=t; ++i){
        for(int j=1; j<=t; ++j){
                int x;
                scanf("%d",&x);
                if(x==1||x==3)
                    ok[i]=true;
            }
    }
    int ans=0;
    for(int i=1; i<=t; ++i){
        if(!ok[i]) ans++;
    }
     printf("%d\n",ans);
     for(int i=1; i<=t; ++i){
         if(!ok[i])
            printf("%d ",i);
     }
     if(ans) puts("");
     return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
//typedef long long LL;
//const int N=1e5+100;
//const int inf=0x7f7f7f7f;

int main()
{
    int t,n,m;
    bool ok[105];
    scanf("%d",&t);
    for(int i=1; i<=t; ++i){
        for(int j=1; j<=t; ++j){
                int x;
                scanf("%d",&x);
                if(x==1||x==3)
                    ok[i]=true;
            }
    }
    int ans=0;
    for(int i=1; i<=t; ++i){
        if(!ok[i]) ans++;
    }
     printf("%d\n",ans);
     for(int i=1; i<=t; ++i){
         if(!ok[i])
            printf("%d ",i);
     }
     if(ans) puts("");
     return 0;
}


#include <stdio.h>
#include <string.h>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N=1e5+100;
const int inf=0x7f7f7f7f;
bool ok[N];
int main()
{
    int t,n,m;
    scanf("%d",&t);
    for(int i=1; i<=t; ++i){
        for(int j=1; j<=t; ++j){
                int x;
                scanf("%d",&x);
                if(x==1||x==3)
                    ok[i]=true;
            }
    }
    int ans=0;
    for(int i=1; i<=t; ++i){
        if(!ok[i]) ans++;
    }
     printf("%d\n",ans);
     for(int i=1; i<=t; ++i){
         if(!ok[i])
            printf("%d ",i);
     }
     if(ans) puts("");
     return 0;
}


#include <iostream>
#include<bits/stdc++.h>

using namespace std;
bool b[101];
int a[101][101];
int main(){
  int n;
  cin>>n;

  for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++)
      cin>>a[i][j];

 if(n==1)
    {cout<<"1"<<endl<<"1";
    return 0;}
int l=0;

 for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++){
      if(i!=j&&i<j){
        if(a[i][j]==1)
         b[i]=true;
       else
         if(a[i][j]==2)
          b[j]=true;
        else
          if(a[i][j]==3)
          { b[i]=true;b[j]=true;}

        }
        }
for(int i=1;i<=n;i++)
    if(!b[i])
      l++;
if(l==0)
  cout<<"0";
else
{cout<<l<<endl;
for(int i=1;i<=n;i++)
  if(!b[i])
    cout<<i<<" ";}
return 0;
}


#include <iostream>
#include<bits/stdc++.h>

using namespace std;
bool b[101];
int a[101][101];
int main(){
  int n;
  cin>>n;

  for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++)
      cin>>a[i][j];

 if(n==1)
   {cout<<"1"<<endl<<"1";return 0;}
int k=0,l=0;

 for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++){
      if(i!=j&&i<j&&k!=n){
        if(a[i][j]==1)
         b[i]=true;
       else
         if(a[i][j]==2)
          b[j]=true;
        else
          if(a[i][j]==3)
          { b[i]=true;b[j]=true;}
        }
        }
for(int i=1;i<=n;i++)
    if(b[i])
      k++;
    else
      l++;
if(k==0)
  cout<<"0";
else
{cout<<l<<endl;
for(int i=1;i<=n;i++)
  if(!b[i])
    cout<<i<<" ";}
return 0;
}


#include <iostream>
#include<bits/stdc++.h>

using namespace std;
bool b[101];
int a[101][101];
int main(){
  int n;
  cin>>n;

  for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++)
      cin>>a[i][j];

 if(n==1)
   {cout<<"1";return 0;}
int k=0,l=0;

 for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++){
      if(i!=j&&i<j&&k!=n){
        if(a[i][j]==1)
         b[i]=true;
       else
         if(a[i][j]==2)
          b[j]=true;
        else
          if(a[i][j]==3)
          { b[i]=true;b[j]=true;}
        }
        }
for(int i=1;i<=n;i++)
    if(b[i])
      k++;
    else
      l++;
if(k==0)
  cout<<"0";
else
{cout<<l<<endl;
for(int i=1;i<=n;i++)
  if(!b[i])
    cout<<i<<" ";}
return 0;
}


#include <iostream>
#include<bits/stdc++.h>

using namespace std;
bool b[101];
int a[101][101];
int main(){
  int n;
  cin>>n;
  for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++)
      cin>>a[i][j];
int k=0,l=0;

 for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++){
      if(i!=j&&i<j&&k!=n){
        if(a[i][j]==1)
         b[i]=true;
       else
         if(a[i][j]==2)
          b[j]=true;
        else
          if(a[i][j]==3)
          { b[i]=true;b[j]=true;}
        }
        }
for(int i=1;i<=n;i++)
    if(b[i])
      k++;
    else
      l++;
if(k==0)
  cout<<"0";
else
{cout<<l<<endl;
for(int i=1;i<=n;i++)
  if(!b[i])
    cout<<i<<" ";}
return 0;
}


#include <iostream>
#include<bits/stdc++.h>

using namespace std;
bool b[101];
int a[101][101];
int main(){
  int n;
  cin>>n;

  for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++)
      cin>>a[i][j];

 if(n==1)
   {cout<<"0";return 0;}
int k=0,l=0;

 for(int i=1;i<=n;i++)
    for(int j=1;j<=n;j++){
      if(i!=j&&i<j&&k!=n){
        if(a[i][j]==1)
         b[i]=true;
       else
         if(a[i][j]==2)
          b[j]=true;
        else
          if(a[i][j]==3)
          { b[i]=true;b[j]=true;}
        }
        }
for(int i=1;i<=n;i++)
    if(b[i])
      k++;
    else
      l++;
if(k==0)
  cout<<"0";
else
{cout<<l<<endl;
for(int i=1;i<=n;i++)
  if(!b[i])
    cout<<i<<" ";}
return 0;
}


#include <iostream>
#include <cstdio>
#include <set>

using namespace std;

int main()
{
    int i, j, n, cou, e;
    set<int> A, B;
    scanf("%d", &n);
    for(i = 1; i <= n; i++){
        for(j = 1; j <= n; j++){
            scanf("%d", &e);
            if(e == 0){
                if(!B.count(i))A.insert(i);
                if(!B.count(j))A.insert(j);
            }
            else if(e == 1){
                if(!B.count(j))A.insert(j);

                B.insert(i);

                if(A.count(i))A.erase(A.find(i));
            }
            else if(e == 2){
                if(!B.count(i))A.insert(i);

                B.insert(j);
                if(A.count(j))A.erase(A.find(j));
            }
            else if(e == 3){
                B.insert(i);
                B.insert(j);
            }
        }
    }
    cou = A.size();
    printf("%d\n", cou);
    if(cou){
        set<int>::iterator it;
        it = A.begin();
        printf("%d", *it);
        it++;
        while(it != A.end()){
            printf(" %d", *it);
            it++;
        }
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <set>

using namespace std;

int main()
{
    int i, j, n, cou = 0, e;
    scanf("%d", &n);
    int ara[105] = {0};
    for(i = 0; i < n; i++){
        for(j = 0; j < n; j++){
            scanf("%d", &e);
            if(e == 1){
                ara[i]++;
            }
            else if(e == 2){
                ara[j]++;
            }
            else if(e == 3){
                ara[i]++;
                ara[j]++;
            }
        }
    }
    int ans = 0;
    for(int i = 0; i < n; i++)
        if(!ara[i])
            ans++;
    printf("%d\n", ans);

    for(int i = 0; i < n && ans; i++)
        if(!ara[i])
            printf("%d ", i+1);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <set>

using namespace std;

int main()
{
    int i, j, n, cou = 0, e;
    set<int> A, B;
    scanf("%d", &n);
    for(i = 1; i <= n; i++){
        for(j = 1; j <= n; j++){
            scanf("%d", &e);
            if(e == -1){
                if(!B.count(i))A.insert(i);
            }
            else if(e == 0){
                if(!B.count(i))A.insert(i);
                if(!B.count(j))A.insert(j);
            }
            else if(e == 1){
                if(!B.count(j))A.insert(j);

                B.insert(i);

                if(A.count(i))A.erase(A.find(i));
            }
            else if(e == 2){
                if(!B.count(i))A.insert(i);

                B.insert(j);
                if(A.count(j))A.erase(A.find(j));
            }
            else if(e == 3){
                B.insert(i);
                B.insert(j);
            }
        }
    }
    cou = A.size();
    printf("%d\n", cou);
    if(cou){
        set<int>::iterator it;
        it = A.begin();
        printf("%d", *it);
        it++;
        while(it != A.end()){
            printf(" %d", *it);
            it++;
        }
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <set>

using namespace std;

int main()
{
    int i, j, n, cou, e;
    set<int> A;
    scanf("%d", &n);
    for(i = 1; i <= n; i++){
        for(j = 1; j <= n; j++){
            scanf("%d", &e);
            if(e == 0){
                A.insert(i);
                A.insert(j);
            }
            else if(e == 1){
                A.insert(j);
                if(A.count(i))A.erase(A.find(i));
            }
            else if(e == 2){
                A.insert(i);
                if(A.count(j))A.erase(A.find(j));
            }
        }

    }
    cou = A.size();
    printf("%d\n", cou);
    if(cou){
        set<int>::iterator it;
        it = A.begin();
        printf("%d", *it);
        it++;
        while(it != A.end()){
            printf(" %d", *it);
            it++;
        }
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<string>
using namespace std;
int k,a;
inline int read(){
	int date=0,w=1;char c=0;
	while(!isdigit(c)){if(c=='-')w=-1;c=getchar();}
	while(isdigit(c)){date=date*10+c-'0';c=getchar();}
	return date*w;
}
int main(){
	k=read();
	a=2000-k%2000+998000;
    printf("2000\n");
    for (int i = 1; i <= 1998; i ++)
		printf("0 ");
    printf("%d %d\n",-a+(k+a)/2000,a);
}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<iostream>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
using namespace std;
int k;
int main()
{
	cin>>k;
	printf("2000\n");
	for(int i=1;i<=1998;i++) printf("0 ");
	int d=1999-(k+1999)%1999;
	int x=(k+d)/1999;
	printf("%d %d\n",-d,x);
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll k;
int n=1000;
const int inf=1e6;
ll k1=1e5+5*1e4,k2;
int n1,n2;
int a[2000];
ll sum,cnt;
int main()
{
    cin>>k;
    n1=k/k1;
    k2=(6+n1)*k1;
    k=k2-k;
    swap(k2,k);
    //cout<<k2<<"    "<<k<<endl;
    cout<<2000<<endl;
    cout<<k2;
    for(int i=2;i<=500;i++){
        cout<<' '<<-inf;
    }
    for(int i=1;i<=749;i++)cout<<' '<<1;
    cout<<' '<<-750;
    for(int i=1;i<=749;i++)cout<<' '<<0;
    cout<<' '<<k*100/k1+1<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll k;
int n=1000;
const int inf=1e6;
ll k1=1e5+5*1e4,k2;
int n1,n2;
int a[2000];
ll sum,cnt;
int main()
{
    cin>>k;
    n1=k/k1;
    k2=(6+n1)*k1;
    k=k2-k;
    swap(k2,k);
    cout<<k2<<"    "<<k<<endl;
    cout<<2000<<endl;
    cout<<k2;
    for(int i=1;i<=500;i++){
        cout<<' '<<-inf;
    }
    cout<<' '<<1;
    for(int i=502;i<=1999;i++){
        if(i%2==0)cout<<' '<<1;
        else cout<<' '<<-3;
    }
    cout<<' '<<k*100/k1-1+1498<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll k;
int n=1000;
const int inf=1e6;
ll k1=1e5+5*1e4,k2;
int n1,n2;
int a[2000];
ll sum,cnt;
int main()
{
    cin>>k;
    n1=k/k1;
    k2=(6+n1)*k1;
    k=k2-k;
    swap(k2,k);
    //cout<<k2<<"    "<<k<<endl;
    cout<<2000<<endl;
    cout<<k2;
    for(int i=2;i<=500;i++){
        cout<<' '<<-inf;
    }
    for(int i=1;i<=1498;i++)cout<<' '<<1;
    cout<<' '<<-750;
    for(int i=1;i<=749;i++)cout<<' '<<0;
    cout<<' '<<k*100/k1+1<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll k;
int n=1000;
const int inf=1e6;
ll k1=1e5+5*1e4,k2;
int n1,n2;
int a[2000];
ll sum,cnt;
int main()
{
    cin>>k;
    n1=k/k1;
    k2=(6+n1)*k1;
    k=k2-k;
    swap(k2,k);
    //cout<<k2<<"    "<<k<<endl;
    cout<<2000<<endl;
    cout<<k2;
    for(int i=2;i<=500;i++){
        cout<<' '<<-inf;
    }
    cout<<' '<<1;
    for(int i=502;i<=1999;i++){
        if(i%2==0)cout<<' '<<1;
        else cout<<' '<<-3;
    }
    cout<<' '<<k*100/k1-1+1498<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll k;
int n=1000;
const int inf=1e6;
ll k1=1e5+5*1e4,k2;
int n1,n2;
int a[2000];
ll sum,cnt;
int main()
{
    cin>>k;
    n1=k/k1;
    k2=(6+n1)*k1;
    k=k2-k;
    swap(k2,k);
    //cout<<k2<<"    "<<k<<endl;
    cout<<2000<<endl;
    cout<<k2;
    for(int i=1;i<=500;i++){
        cout<<' '<<-inf;
    }
    cout<<' '<<1;
    for(int i=502;i<=1999;i++){
        if(i%2==0)cout<<' '<<1;
        else cout<<' '<<-3;
    }
    cout<<' '<<k*100/k1-1+1498<<endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
ll k;
int n=1000;
const int inf=1e6;
ll k1=1e5+5*1e4,k2;
int n1,n2;
int a[2000];
ll sum,cnt;
int main()
{
    cin>>k;
    n1=k/k1;
    k2=(6+n1)*k1;
    k=k2-k;
    swap(k2,k);
    //cout<<k2<<"    "<<k<<endl;
    cout<<2000<<endl;
    cout<<k2;
    for(int i=2;i<=500;i++){
        cout<<' '<<-inf;
    }
    for(int i=1;i<=1498;i++)cout<<' '<<0;
    cout<<' '<<-1;
    cout<<' '<<k*100/k1+1<<endl;
    return 0;
}


// luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
int k,a;
int main()
{
    scanf("%d",&k);
	a=2000-k%2000+998000;
    printf("2000\n");
    for(int i=1;i<=1998;i++) printf("0 ");
    printf("%d %d\n",-a+(k+a)/2000,a);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int k;
int main(){
	cin>>k;
	cout<<3<<endl<<1<<' ';
	if(k&1){
		cout<<(-2)<<' '<<(k+3)/2;
	}
	else{
		cout<<(-3)<<' '<<(k+6)/2;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<string>
using namespace std;
int k, a;
int main() {
    scanf("%d", &k);a = 2000 - k % 2000 + 998000;
    printf("2000\n");
    for (int i = 1; i <= 1998; i ++) printf("0 ");
    printf("%d %d\n", -a + (k + a) / 2000, a);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
inline void read(int &a)
{
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0'||ch>'9')
	{
        if(ch=='-')
            f=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9')
	{
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    a=x*f;
}
inline void write(int x)
{
    if (x < 0) putchar('-'),x = -x;
    if (x > 9) write(x/10); putchar(x%10+'0');
}
signed main()
{
	int n,a;
    read(n);
	a=2000-n%2000+998000;
    write(2000);
    putchar('\n');
    for(int i=1;i<=1998;i++)
	{
		write(0);
		putchar(' ');
	}
    write(-a+(n+a)/2000);
	putchar(' ');
	write(a);
	printf("\n");
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
int a,k;
int main() {
    cin>>k;
	a = 2000 - k % 2000 + 998000;
    cout<<"2000"<<endl;
    for (int i = 1; i <= 1998; i ++) cout<<"0 ";
    cout<< -a + (k + a) / 2000<< a<<endl;
    return 0;
}


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

int k,n=2000,a[2040];

int main()
{
	scanf("%d",&k);
	k+=2000;
	a[1]=-1;
	int d=k/1999;
	int r=k%1999;
	for(int i=2;i<=n;i++)
	{
		if(i>n-r) a[i]=1+d;
		else a[i]=d;
	}
	printf("%d\n",n);
	for(int i=1;i<=n;i++) printf("%d ",a[i]);
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;
int k; int n;  int x;
int main(){
    scanf("%d",&k);
    x=k+2;
    if(k&1) n=(2*k+2)/(k+1);
    else    n=(2*k+2)/k;
    // 1~n-2  n-1 n
    for(int i=1;i<=n-2;++i) printf("0 ");
    printf("-1 "); printf("%d\n",x);
    return 0;
}


#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <vector>
#include <stack>
#include <map>
#include <bitset>
#define ri register
#define inf 0x7fffffff
#define E (1)
#define mk make_pair
#define int long long
//#define double long double
using namespace std; const int N=5010;
inline int read()
{
    int s=0, w=1; ri char ch=getchar();
    while(ch<'0'||ch>'9') {if(ch=='-') w=-1; ch=getchar(); }
    while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch-'0'), ch=getchar();
    return s*w;
}
void print(int x) { if(x<0) x=-x, putchar('-'); if(x>9) print(x/10); putchar(x%10+'0'); }
signed main()
{
    puts("2000");
    int K=read(); printf("-1 ");
    int now=K+2000;
    for(ri int i=2;i<=2000;i++)
    {
        if(now>1000000) printf("%d ",1000000), now-=1000000;
        else printf("%lld ",now), now=0;
    }
    puts("");
    return 0;
}


#include <bits/stdc++.h>
#define cl(a) memset(a,0,sizeof(a))
#define rep(i,a,b) for(register int i=a;i<=b;i++)
#define per(i,a,b) for(register int i=b;i>=a;i--)
using namespace std;
const int mod=1e9+7;
typedef long long ll;
inline ll read () { ll res = 0 ;int f (1) ;char ch = getchar ();
	while (!isdigit(ch)) { if (ch == '-') f = -1 ;ch = getchar();}
	while (isdigit(ch)) res = (res << 1) + (res << 3) + (ch ^ 48) ,ch = getchar(); return res * f ;
}
const int maxn=1e6;
const int inf=0x3f3f3f3f;
typedef pair<int,int>PII;
ll fpow(ll n,ll k,ll p=mod) {
	ll r=1;
	for(; k; k>>=1) {
		if(k&1)r=r*n%p;
		n=n*n%p;
	}
	return r;
}
ll inv(ll n,ll p=mod) {
	return fpow(n,p-2,p);
}
ll fact[maxn];
void init(ll p = mod) {
	fact[0]=1;
	rep(i,1,maxn-1)fact[i]=fact[i-1]*i%p;
}
ll C(ll n,ll m,ll p=mod) {
	return fact[n]*inv(fact[m])%p*inv(fact[n-m])%p;
}
ll n;
int main() {
	n=read();
	ll r = n%maxn; ll p = n/maxn; ll cnt=r?p+2:p+1;
	if(r+cnt-1>=maxn) cnt = p+3;
	else cnt=p+2;
	cout<<cnt<<endl;
	ll s = n+cnt; p = s/maxn; r =  s%maxn; cout<<-1<<" ";
	for(register int i=1; i<=p; i++) cout<<maxn<<" ";
	if(r) cout<<r<<endl;
	return 0;
}


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

int k,sum,t,ans;

int main(){
    scanf("%d",&k);
    sum=k+2000;
    printf("2000\n");
    t=sum/1998;ans=sum-1998*t;
    printf("-1 ");
    for(int i=1;i<=1998;i++) printf("%d ",t);
    printf("%d\n",ans);
}


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

int ans,sum;
int k,t;

int main(){
	cin>>k;
	sum=k+2000;
	cout<<'2000'<<endl;
	t=sum/1998;
	ans=sum-19998*t;
	cout<<"-1";
	for ( int i=0;i<1998;i++) cout<<t;
	cout<<ans<<" "<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int k;
int a;
int main() {
    scanf("%d", &k);a = 2000 - k % 2000 + 998000;
    printf("2000\n");//D;Ahdqehgfpwef
    for (int i = 1; i <= 1998; i ++) printf("0 ");
    printf("%d %d\n", -a + (k + a) / 2000, a);//SADDSEFCAFEWRQE
    return 0;
}


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

int k;

int main() {
	cin >> k;

	for (int i = 3; i <= 2000; i++) {
		// ((length - 2) * sum + k) % lenth == 0
		// (sum * length - 2 * sum + k) % length == 0
		// (-2 * sum + k) % length == 0

		// sum + 1 <= (int)1e6

		for (int sum = 1; sum + 1 <= (int)1e6; sum++) {
			long long fin = (1ll * (i - 2) * sum + k) / i + 1;

			if (fin > (long long)1e6) break;

			if ((1ll * (i - 2) * sum + k) % i != 0) {
				continue;
			}

			printf("%d\n", i);

			for (int j = 1; j < i - 2; j++) {
				printf("0 ");
			}

			printf("%d ", sum);
			printf("%d ", -(sum + 1));
			printf("%lld\n", fin);

			return 0;
		}
	}

	puts("-1");
}


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

int k;

int main() {
	cin >> k;

	for (int i = 3; i <= 2000; i++) {
		// ((length - 2) * sum + k) % lenth == 0
		// (sum * length - 2 * sum + k) % length == 0
		// (-2 * sum + k) % length == 0

		// sum + 1 <= (int)1e6

		for (int sum = 1; sum + 1 <= (int)1e6; sum++) {
			long long fin = (1ll * (i - 2) * sum + k) / i;

			if (fin > (long long)1e6) break;

			if ((1ll * (i - 2) * sum + k) % i != 0) {
				continue;
			}

			printf("%d\n", i);

			for (int j = 1; j < i - 2; j++) {
				printf("0 ");
			}

			printf("%d ", sum);
			printf("%d ", -(sum + 1));
			printf("%lld\n", fin);

			return 0;
		}
	}

	puts("-1");
}


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

int k;

int main() {
	cin >> k;

	for (int i = 3; i <= 2000; i++) {
		// ((length - 2) * sum + k) % lenth == 0
		// (sum * length - 2 * sum + k) % length == 0
		// (-2 * sum + k) % length == 0

		// sum + 1 <= (int)1e6

		for (int sum = 1; sum + 1 <= (int)1e6; sum++) {
			long long fin = (1ll * (i - 2) * sum + k) / i + 1;

			if (fin > (long long)1e6) break;

			if ((1ll * (i - 2) * sum + k) % i != 0) {
				continue;
			}

			if (fin > 1ll * (i - 2) * sum) continue;

			printf("%d\n", i);

			for (int j = 1; j < i - 2; j++) {
				printf("0 ");
			}

			printf("%d ", sum);
			printf("%d ", -(sum + 1));
			printf("%lld\n", fin);

			return 0;
		}
	}

	puts("-1");
}


#include<bits/stdc++.h>
using namespace std;
int k,ans;

int main()
{	cin>>k;
	ans=2000-k%2000+1000000000;
    cout<<2000<<endl;
    for(int i=1;i<=1998;++i)
    	cout<<0<<' ';
    cout<<-ans+(k+ans)/2000<<' '<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int k,ans;

int main()
{	cin>>k;
	ans=2000-k%2000+98000;
    cout<<2000<<endl;
    for(int i=1;i<=1998;++i)
    	cout<<0<<' ';
    cout<<-ans+(k+ans)/2000<<' '<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int k,ans;

int main()
{	cin>>k;
	ans=2000-k%2000+998000;
    cout<<2000<<endl;
    for(int i=1;i<=1998;++i)
    	cout<<0<<' ';
    cout<<-ans+(k+ans)/2000<<' '<<ans<<endl;
    return 0;
}


#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int MAXN = 2000+5;
int a[MAXN];

int main(){
	LL k;scanf("%lld",&k);
	int x = 1;
	while((k+x)%1024) ++x;
	int n = 1024,y = x-(k+x)/n;
	FOR(i,1,n-2) a[i] = 0;
	a[n-1] = -y;a[n] = x;
	FOR(i,1,n) printf("%d%c",a[i]," \n"[i==n]);
	// assert(y*(n-1)-(y-x)*n == k);
    // int res = 0;
    // int cur = 0;
    // int kk = 0;
    // DEBUG((a[n]+a[n-1])*n);
    // FOR(i,1,n){
        // cur = cur + a[i];
        // if (cur < 0){
            // cur = 0;
            // kk = i;
        // }
        // res = std::max(res, (i-kk)*cur);
        // if(i == n) DEBUG(kk);
    // }
    // DEBUG(res);
    // printf("%d\n",res);
	return 0;
}
/*
xn-y=k
*/


#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

int main(){
	LL k;scanf("%lld",&k);
	int y = 1;
	while((k+y)%1024) ++y;
	int n = 1024,x = (k+y)/n;
	printf("%d ",-x);
	FOR(i,2,n-1) printf("%d ",0);
	printf("%d\n",y);
	// assert(y*(n-1)-(y-x)*n == k);
	return 0;
}
/*
xn-y=k
*/


#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int MAXN = 2000+5;
LL a[MAXN];

int main(){
	LL k;scanf("%lld",&k);
	LL x = 1;
	while((k+x)%1024) ++x;
	LL n = 1024,y = x-(k+x)/n;
	printf("%lld\n",n);
	FOR(i,1,n-2) a[i] = 0;
	a[n-1] = -y;a[n] = x;
	FOR(i,1,n) printf("%lld%c",a[i]," \n"[i==n]);
	// assert(y*(n-1)-(y-x)*n == k);
    // int res = 0;
    // int cur = 0;
    // int kk = 0;
    // DEBUG((a[n]+a[n-1])*n);
    // FOR(i,1,n){
        // cur = cur + a[i];
        // if (cur < 0){
            // cur = 0;
            // kk = i;
        // }
        // res = std::max(res, (i-kk)*cur);
        // if(i == n) DEBUG(kk);
    // }
    // DEBUG(res);
    // printf("%d\n",res);
	return 0;
}
/*
xn-y=k
*/


#include <bits/stdc++.h>

#define fi first
#define se second
#define db double
#define U unsigned
#define P std::pair<int,int>
#define LL long long
#define pb push_back
#define MP std::make_pair
#define all(x) x.begin(),x.end()
#define CLR(i,a) memset(i,a,sizeof(i))
#define FOR(i,a,b) for(int i = a;i <= b;++i)
#define ROF(i,a,b) for(int i = a;i >= b;--i)
#define DEBUG(x) std::cerr << #x << '=' << x << std::endl

const int MAXN = 2000+5;
LL a[MAXN];

int main(){
	LL k;scanf("%lld",&k);
	LL x = 0,y = 0,n = 2000;
	for(y=1;y <= 1000000;++y){
		x = (k+y*n)/(n-1);
		if((x-y)*n-x==k) break;
	}
	printf("%lld\n",n);
	FOR(i,1,n-2) a[i] = 0;
	a[n-1] = -y;a[n] = x;
	FOR(i,1,n) printf("%lld%c",a[i]," \n"[i==n]);
	// // assert(1ll*y*(n-1)-1ll*(y-x)*n == k);
	// // DEBUG((x-y)*n-502000);
    // LL res = 0;
    // LL cur = 0;
    // LL kk = 0;
    // DEBUG(1ll*(a[n]+a[n-1])*n);
    // FOR(i,1,n){
        // cur = cur + a[i];
        // if (cur < 0){
            // cur = 0;
            // kk = i;
        // }
        // res = std::max(res, (i-kk)*cur);
        // if(i == n) DEBUG(kk);
    // }
    // printf("%lld\n",res);
	return 0;
}
/*
xn-y=k
*/


#include<bits/stdc++.h>
using namespace std;
int k, a;
signed main() {
	cin >> k;
	a = 2000 - k % 2000 + 998000;
	cout<<2000<<"\n";
    for (int i = 1; i <= 1998; i ++)
    	cout<<0<<" ";
    cout<<-a + (k + a) / 2000<<" "<< a;
    return 0;
}//sdfvsvsdcvs


/*
Hansta rehta hu tujhse mil kar kyu aajkal
Badle badle hain mere tevar kyun aajkal
Aankhein meri har jagah
Dhoondhe tujhe bewajah
Ye main hoon ya koi aur hai meri tarah

Kaise hua, kaise hua
Tu itna zaroori kaise hua
Kaise hua, kaise hua
Tu itna zaroori kaise hua

Main baarish ki boli samajhta nahi tha
Hawaaon se main yun ulajhta nahi tha
Hai seene mein dil bhi
Kahaan thi mujhe ye khabar

Kahin pe hon raatein
Kahin pe savere
Awaargi hi rahi saath mere
Thehar ja, thehar ja
Ye kehti hai teri nazar

Kya haal ho gaya hai ye mera
Aankhein meri har jagah
Dhoondhe tujhe bewajah
Ye main hoon ya koi aur hai meri tarah

Kaise hua, kaise hua
Tu itna zaroori kaise hua
Kaise hua, kaise hua
Tu itna zaroori kaise hua
Kaise hua, kaise hua
Tu itna zaroori kaise hua

Mmmm mmmm...
*/

//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;  // find_by_order() , order_of_key()

int main(){

	ll k;
	cin >> k;

	ll n=-1;

	for(int i=2;i<=2000;i++){
		if((k+i)/(i-1) <= 1000000){
			n = i;
			break;
		}
	}

	if(n==-1){
		cout << "-1\n";
		return 0;
	}

	ll x = k+n;

	cout << n << endl;
	cout << "-1 ";

	while(x>1000000){
		cout << "1000000 ";
		x -= 1000000;
	}

	cout << x << endl;

	return 0;
}


/*
Hansta rehta hu tujhse mil kar kyu aajkal
Badle badle hain mere tevar kyun aajkal
Aankhein meri har jagah
Dhoondhe tujhe bewajah
Ye main hoon ya koi aur hai meri tarah

Kaise hua, kaise hua
Tu itna zaroori kaise hua
Kaise hua, kaise hua
Tu itna zaroori kaise hua

Main baarish ki boli samajhta nahi tha
Hawaaon se main yun ulajhta nahi tha
Hai seene mein dil bhi
Kahaan thi mujhe ye khabar

Kahin pe hon raatein
Kahin pe savere
Awaargi hi rahi saath mere
Thehar ja, thehar ja
Ye kehti hai teri nazar

Kya haal ho gaya hai ye mera
Aankhein meri har jagah
Dhoondhe tujhe bewajah
Ye main hoon ya koi aur hai meri tarah

Kaise hua, kaise hua
Tu itna zaroori kaise hua
Kaise hua, kaise hua
Tu itna zaroori kaise hua
Kaise hua, kaise hua
Tu itna zaroori kaise hua

Mmmm mmmm...
*/

//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define foreach(it, v) for(auto it=(v).begin(); it != (v).end(); ++it)
#define gcd(a,b) __gcd(a,b)

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define filewr() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);

#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

template<typename S, typename T>
ostream& operator<<(ostream& out,pair<S,T> const& p){out<<'('<<p.fi<<", "<<p.se<<')';return out;}

template<typename T>
ostream& operator<<(ostream& out,vector<T> const& v){
int l=v.size();for(int i=0;i<l-1;i++)out<<v[i]<<' ';if(l>0)out<<v[l-1];return out;}

template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}

template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}

const ld PI = 3.1415926535897932384626433832795;

typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> indexed_set;  // find_by_order() , order_of_key()

int main(){

	ll k;
	cin >> k;

	ll n=-1;

	for(int i=2;i<=2000;i++){
		if((k+i+0.0)/(0.0+i-1) <= 1000000){
			n = i;
			break;
		}
	}

	if(n==-1){
		cout << "-1\n";
		return 0;
	}

	ll x = k+n;
	//tr(x);

	vector<int> ans;
	ans.pb(-1);

	while(x>=1000000){
		ans.pb(1000000);
		x -= 1000000;
	}
	//tr(x);

	for(int i=ans.size();i<n-1;i++){
		ans.pb(1);
		x -= 1;
	}

	ans.pb(x);
	cout << n << endl;
	for(int i=0;i<n;i++)cout << ans[i] << " ";
		cout << endl;

	return 0;
}


#include <bits/stdc++.h>
#define ld long double
#define LL long long
#define Accel ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define Re(a,b) memset(a,b,sizeof a)
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define ALL(X) (X).begin(), (X).end()
#define FOR(I, A, B) for (int I = (A); I <= (B); I++)
#define REP(I, N) for (int I = 0; I < (N); I++)
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define SZ(a) ((int)a.size())
#define endl "\n"
//#pragma GCC optimize(2)
using namespace std;
//typedef complex<double>C;
//const double PI(acos(-1.0));
//const double eps(1e-8);
//for(int mask=i;mask>0;mask=(mask-1)&i)
//int a[25]= { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };
//__gcd, atan2(y,x)=y/x , __int128
//c(n,k)=c(n-1,k-1)+c(n-1,k)
//c(i,r),i for r to n =c(n+1,r+1)
//void add(int x){while(x<N)BIT[x]++,x+=x&-x;}
//int sum(int x){int s=0;while(x){s+=BIT[x];x-=x&-x;}return s;}
//int find(int x){return x==p[x]?x:p[x]=find(p[x]);}
//LL pw(LL a,LL b){LL t=1;for(;b;b>>=1,a=a*a%M)b&1?t=t*a%M:0;return t;}
//log() = ln() , log(x)/log(y)=log(y)-base-x
//INT_MAX 127,INT_MIN 128
//int dw[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
//int dw[8][2]={{0,1},{1,0},{0,-1},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};
//cout<<fixed<<setprecision(12)<<ans<<endl;
//__builtin_popcount(mask)L

const int N=550;
int n;

int main(){
	cin>>n;
	if(n==1){
		cout<<-1<<endl;return 0;
	}
	int l,r;
	if(n&1){
		l=-1;r=(n+3)/2;
	}
	else{
		l=-2;r=(n+6)/2;
	}
	printf("3\n1 %d %d\n",l-1,r);
}


#include <bits/stdc++.h>
#define ld long double
#define LL long long
#define Accel ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define Re(a,b) memset(a,b,sizeof a)
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define ALL(X) (X).begin(), (X).end()
#define FOR(I, A, B) for (int I = (A); I <= (B); I++)
#define REP(I, N) for (int I = 0; I < (N); I++)
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define SZ(a) ((int)a.size())
#define endl "\n"
//#pragma GCC optimize(2)
using namespace std;
//typedef complex<double>C;
//const double PI(acos(-1.0));
//const double eps(1e-8);
//for(int mask=i;mask>0;mask=(mask-1)&i)
//int a[25]= { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };
//__gcd, atan2(y,x)=y/x , __int128
//c(n,k)=c(n-1,k-1)+c(n-1,k)
//c(i,r),i for r to n =c(n+1,r+1)
//void add(int x){while(x<N)BIT[x]++,x+=x&-x;}
//int sum(int x){int s=0;while(x){s+=BIT[x];x-=x&-x;}return s;}
//int find(int x){return x==p[x]?x:p[x]=find(p[x]);}
//LL pw(LL a,LL b){LL t=1;for(;b;b>>=1,a=a*a%M)b&1?t=t*a%M:0;return t;}
//log() = ln() , log(x)/log(y)=log(y)-base-x
//INT_MAX 127,INT_MIN 128
//int dw[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
//int dw[8][2]={{0,1},{1,0},{0,-1},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};
//cout<<fixed<<setprecision(12)<<ans<<endl;
//__builtin_popcount(mask)L

const int N=550;
int n;

int main(){
	cin>>n;
	printf("2000\n");
	if(n%1999==0){
		int k=n/1999;k--;
		for(int i=0;i<1998;i++)
			printf("0 ");
		printf("-1999 %d\n",2001+k);
	}
	else{
		int a=n/1999,k;
		k=n%1999;
		int l=-1999+k,r=2000-k;
		for(int i=0;i<1998;i++)
			printf("0 ");
		printf("%d %d\n",l,r+a);
	}
}


#include <bits/stdc++.h>
#define ld long double
#define LL long long
#define Accel ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define Re(a,b) memset(a,b,sizeof a)
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define ALL(X) (X).begin(), (X).end()
#define FOR(I, A, B) for (int I = (A); I <= (B); I++)
#define REP(I, N) for (int I = 0; I < (N); I++)
#define PII pair<int,int>
#define PLL pair<LL,LL>
#define SZ(a) ((int)a.size())
#define endl "\n"
//#pragma GCC optimize(2)
using namespace std;
//typedef complex<double>C;
//const double PI(acos(-1.0));
//const double eps(1e-8);
//for(int mask=i;mask>0;mask=(mask-1)&i)
//int a[25]= { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 };
//__gcd, atan2(y,x)=y/x , __int128
//c(n,k)=c(n-1,k-1)+c(n-1,k)
//c(i,r),i for r to n =c(n+1,r+1)
//void add(int x){while(x<N)BIT[x]++,x+=x&-x;}
//int sum(int x){int s=0;while(x){s+=BIT[x];x-=x&-x;}return s;}
//int find(int x){return x==p[x]?x:p[x]=find(p[x]);}
//LL pw(LL a,LL b){LL t=1;for(;b;b>>=1,a=a*a%M)b&1?t=t*a%M:0;return t;}
//log() = ln() , log(x)/log(y)=log(y)-base-x
//INT_MAX 127,INT_MIN 128
//int dw[4][2]={{0,1},{1,0},{0,-1},{-1,0}};
//int dw[8][2]={{0,1},{1,0},{0,-1},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};
//cout<<fixed<<setprecision(12)<<ans<<endl;
//__builtin_popcount(mask)L

const int N=550;
int n;

int main(){
	cin>>n;
	if(n%1999==0){
		int k=n/1999;k--;
		for(int i=0;i<1998;i++)
			printf("0 ");
		printf("-1999 %d\n",2001+k);
	}
	else{
		int a=n/1999,k;
		k=n%1999;
		int l=-1999+k,r=2000-k;
		for(int i=0;i<1998;i++)
			printf("0 ");
		printf("%d %d\n",l,r+a);
	}
}


#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i = a; i < b; i++)
#define FORR(i,b) FOR(i, 0, b)
#define sz(e) (int)e.size()

typedef long long ll;

const int MAXN = 500005;

vector<int> sol;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

  ll M = 500000;
	ll k;
  cin>>k;
  ll V = 2*M - (k % M);
  ll vMod = V % M;
  ll X = vMod ? vMod : M;
  ll S = k + V;
  ll L = S / M;
  FORR (i, L-2) {
    sol.push_back(0);
  }
  sol.push_back(-X);
  sol.push_back(V);

  ll check = 0LL;
  if (sz(sol) > 2000) {
    cout << "-1" << endl;
  } else {
    cout << sz(sol) << endl;
    FORR (i, sz(sol)) {
      check += sol[i];
      cout << sol[i] << " ";
    }
    cout << endl;
  }

  // check *= L;
  // cerr << (check - V) << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i = a; i < b; i++)
#define FORR(i,b) FOR(i, 0, b)
#define sz(e) (int)e.size()

typedef long long ll;

const int MAXN = 500005;

vector<int> sol;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

  ll M = 500000;
	ll k;
  cin>>k;
  ll V = 2*M - (k % M);
  ll vMod = V % M;
  ll X = vMod ? vMod : M;
  ll S = k + V;
  ll L = S / M;
  FORR (i, L-2) {
    sol.push_back(0);
  }
  sol.push_back(-X);
  sol.push_back(V);

  ll check = 0LL;
  FORR (i, sz(sol)) {
    check += sol[i];
    cout << sol[i] << " ";
  }

  cout << endl;

  // check *= L;
  // cerr << (check - V) << endl;

}


#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i = a; i < b; i++)
#define FORR(i,b) FOR(i, 0, b)
#define sz(e) (int)e.size()

typedef long long ll;

const int MAXN = 500005;

vector<int> sol;

vector<int> divisores;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

  ll k;
  cin>>k;
  FOR (M, 1, 1000001){
    ll V = 2*M - (k % M);
    if (V > 1000000) continue;
    ll vMod = V % M;
    ll X = vMod ? vMod : M;
    ll S = k + V;
    ll L = S / M;
    if (L > 2000) continue;

    FORR (i, L-2) {
      sol.push_back(0);
    }
    sol.push_back(-X);
    sol.push_back(V);

    ll check = 0LL;
    cout << sz(sol) << endl;
    FORR (i, sz(sol)) {
      check += sol[i];
      cout << sol[i] << " ";
    }
    cout << endl;

    check *= L;
    cerr << (check - V) << endl;
    return 0;
  }

  cout << "-1" << endl;
}


#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i = a; i < b; i++)
#define FORR(i,b) FOR(i, 0, b)
#define sz(e) (int)e.size()

typedef long long ll;

const int MAXN = 500005;

vector<int> sol;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

  ll M = 500000;
	ll k;
  cin>>k;
  ll V = 2*M - (k % M);
  ll vMod = V % M;
  ll X = vMod ? vMod : M;
  ll S = k + V;
  ll L = S / M;
  FORR (i, L-2) {
    sol.push_back(0);
  }
  sol.push_back(-X);
  sol.push_back(V);

  ll check = 0LL;
  cout << sz(sol) << endl;
  FORR (i, sz(sol)) {
    check += sol[i];
    cout << sol[i] << " ";
  }

  cout << endl;

  // check *= L;
  // cerr << (check - V) << endl;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 1000000;
const int MOD = 1e9 + 7;

int doFor ( int m, int n, int k ) {
  printf ( "%d\n", 2*n+1 );
  printf ( "%d %d ", m, -m-1 );
  for ( int i = 1; i < n-1; ++i )
    printf ( "%d %d ", 1, -1 );
  printf ( "1 -1 %d", k+1 );
}

int searchFor ( int p, int to ) {
  int ret = (to+p-1) / p;
  if ( ret > MAX_N ) return ret;
  while ( ret <= MAX_N and p*ret - to <= ret )
    ++ret;
  return ret;
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  int h;
  scanf ( "%d", &h );
  for ( int i = 3; i <= 1999; i+=2 ) {
    int k = searchFor ( i, h );
    if ( k > MAX_N or i*k - h > MAX_N ) continue;
    int m = i*k - h;
    if ( i == 3 )
      printf ( "3\n%d %d %d\n", m, -m-1, k+1 );
    else
      doFor ( m, (i-1)/2, k );
    break;
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 100005;
const int MOD = 1e9 + 7;

int k;

void goFor ( int x, int n ) {
  printf ( "%d\n%d ", 2*n+1, x );
  for ( int i = 0; i < n; ++i )
    printf ( "%d %d ", -x-1, x );
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  scanf ( "%d", &k );
  for ( int i = 1; i < 1000; ++i ) {
    if ( ( k + i*(2*i + 1) ) % (2*i) == 0 and ( k + i*(2*i + 1) ) / (2*i) < 1000000 ) {
      goFor ( ( k + i*(2*i + 1) ) / (2*i), i );
      break;
    }
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 100005;
const int MOD = 1e9 + 7;

int k;

void goFor ( int x, int n ) {
  printf ( "%d\n%d ", 2*n+1, x );
  for ( int i = 0; i < n; ++i )
    printf ( "%d %d ", -x-1, x );
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  scanf ( "%d", &k );
  for ( int i = 1; i < 1000; ++i ) {
    if ( ( k + i*(2*i + 1) ) % (2*i) == 0 and ( k + i*(2*i + 1) ) / (2*i) < 1000000 ) {
      goFor ( k + i*(2*i + 1) / (2*i), i );
      break;
    }
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 1000000;
const int MOD = 1e9 + 7;

int doFor ( int m, int n, int k ) {
  printf ( "%d\n", 2*n+1 );
  printf ( "%d %d ", m, -m );
  for ( int i = 1; i < n-1; ++i )
    printf ( "%d %d ", 1, -1 );
  printf ( "1 -2 %d", k+1 );
}

int searchFor ( int p, int to ) {
  int ret = (to+p-1) / p;
  if ( ret > MAX_N ) return ret;
  while ( ret <= MAX_N and p*ret - to <= ret )
    ++ret;
  return ret;
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  int h;
  scanf ( "%d", &h );
  for ( int i = 5; i <= 1999; i+=2 ) {
    int k = searchFor ( i, h );
    if ( k > MAX_N or i*k - h > MAX_N ) continue;
    int m = i*k - h;
    doFor ( m, (i-1)/2, k );
    break;
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 1000000;
const int MOD = 1e9 + 7;

int doFor ( int m, int n, int k ) {
  printf ( "%d\n", 2*n+1 );
  printf ( "%d %d ", m, -m );
  for ( int i = 1; i < n-1; ++i )
    printf ( "%d %d ", 0, 0 );
  printf ( "0 -1 %d", k+1 );
}

int searchFor ( int p, int to ) {
  int ret = (to+p-1) / p;
  if ( ret > MAX_N ) return ret;
  while ( ret <= MAX_N and p*ret - to <= ret )
    ++ret;
  return ret;
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  int h;
  scanf ( "%d", &h );
  for ( int i = 3; i <= 1999; i+=2 ) {
    int k = searchFor ( i, h );
    if ( k >= MAX_N or i*k - h > MAX_N ) continue;
    int m = i*k - h;
    doFor ( m, (i-1)/2, k );
    break;
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 1000000;
const int MOD = 1e9 + 7;

int doFor ( int m, int n, int k ) {
  printf ( "%d\n", 2*n+1 );
  printf ( "%d %d ", m, -m );
  for ( int i = 1; i < n-1; ++i )
    printf ( "%d %d ", 0, 0 );
  printf ( "0 -1 %d", k+1 );
}

int searchFor ( int p, int to ) {
  int ret = (to+p-1) / p;
  if ( ret > MAX_N ) return ret;
  while ( ret <= MAX_N and p*ret - to <= ret )
    ++ret;
  return ret;
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  int h;
  scanf ( "%d", &h );
  for ( int i = 5; i <= 1999; i+=2 ) {
    int k = searchFor ( i, h );
    if ( k >= MAX_N or i*k - h > MAX_N ) continue;
    int m = i*k - h;
    doFor ( m, (i-1)/2, k );
    break;
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 1000000;
const int MOD = 1e9 + 7;

int doFor ( int m, int n, int k ) {
  printf ( "%d\n", 2*n+1 );
  printf ( "%d %d ", m, -m );
  for ( int i = 1; i < n-1; ++i )
    printf ( "%d %d ", 1, -1 );
  printf ( "1 -2 %d", k+1 );
}

int searchFor ( int p, int to ) {
  int ret = (to+p-1) / p;
  if ( ret > MAX_N ) return ret;
  while ( ret <= MAX_N and p*ret - to <= ret )
    ++ret;
  return ret;
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  int h;
  scanf ( "%d", &h );
  for ( int i = 1999; i >= 5; i-=2 ) {
    int k = searchFor ( i, h );
    if ( k > MAX_N or i*k - h > MAX_N ) continue;
    int m = i*k - h;
    doFor ( m, (i-1)/2, k );
    break;
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 1000000;
const int MOD = 1e9 + 7;

int doFor ( int m, int n, int k ) {
  printf ( "%d\n", 2*n+1 );
  printf ( "%d %d ", m, -m );
  for ( int i = 1; i < n-1; ++i )
    printf ( "%d %d ", 1, -1 );
  printf ( "1 -2 %d", k+1 );
}

int searchFor ( int p, int to ) {
  int ret = (to+p-1) / p;
  if ( ret > MAX_N ) return ret;
  while ( ret <= MAX_N and p*ret - to <= ret )
    ++ret;
  return ret;
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  int h;
  scanf ( "%d", &h );
  for ( int i = 3; i <= 1999; i+=2 ) {
    int k = searchFor ( i, h );
    if ( k > MAX_N or i*k - h > MAX_N ) continue;
    int m = i*k - h;
    if ( i == 3 )
      printf ( "3\n%d %d %d\n", m, -m-1, k+1 );
    else
      doFor ( m, (i-1)/2, k );
    break;
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 1000000;
const int MOD = 1e9 + 7;

int doFor ( int m, int n, int k ) {
  printf ( "%d\n", 2*n+1 );
  printf ( "%d %d ", m, -m-1 );
  for ( int i = 1; i < n-1; ++i )
    printf ( "%d %d ", 1, -1 );
  printf ( "1 -1 %d", k+1 );
}

int searchFor ( int p, int to ) {
  int ret = (to+p-1) / p;
  if ( ret > MAX_N ) return ret;
  while ( ret <= MAX_N and p*ret - to <= ret )
    ++ret;
  return ret;
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  int h;
  scanf ( "%d", &h );
  for ( int i = 5; i <= 1999; i+=2 ) {
    int k = searchFor ( i, h );
    if ( k > MAX_N or i*k - h > MAX_N ) continue;
    int m = i*k - h;
    doFor ( m, (i-1)/2, k );
    break;
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 100005;
const int MOD = 1e9 + 7;

int k;

void goFor ( int x, int n ) {
  printf ( "%d\n%d ", 2*n+1, x );
  for ( int i = 0; i < n; ++i )
    printf ( "%d %d ", -x-1, x );
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  scanf ( "%d", &k );
  for ( int i = 999; i >= 0; --i ) {
    if ( ( k + i*(2*i + 1) ) % (2*i) == 0 and ( k + i*(2*i + 1) ) / (2*i) < 1000000 ) {
      goFor ( ( k + i*(2*i + 1) ) / (2*i), i );
      break;
    }
  }

  return 0;

}


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

#define mp              make_pair
#define pb              push_back
#define ff              first
#define ss              second
#define inc(A,B)        A=(A+(B))%MOD
#define mul(A,B)        (ll(A)*ll(B)%ll(MOD))
#define sub(a,b)        (((a)-(b)+MOD)%MOD)

typedef pair < int ,int > pii;
typedef long long ll;
typedef complex < ll > pt;

const int MAX_N = 1000000;
const int MOD = 1e9 + 7;

int doFor ( int m, int n, int k ) {
  printf ( "%d\n", 2*n+1 );
  printf ( "%d %d ", m, -m );
  for ( int i = 1; i < n-1; ++i )
    printf ( "%d %d ", 1, -1 );
  printf ( "1 -2 %d", k+1 );
}

int searchFor ( int p, int to ) {
  int ret = (to+p-1) / p;
  if ( ret > MAX_N ) return ret;
  while ( ret <= MAX_N and p*ret - to <= ret )
    ++ret;
  return ret;
}

int main() {

//  freopen ( "in.txt" , "r" , stdin );
//  freopen ( "out.txt" , "w" , stdout );

  int h;
  scanf ( "%d", &h );
  for ( int i = 3; i <= 1999; i+=2 ) {
    int k = searchFor ( i, h );
    if ( k >= MAX_N or i*k - h >= MAX_N ) continue;
    int m = i*k - h;
    if ( i == 3 )
      printf ( "3\n%d %d %d\n", m, -m-1, k+1 );
    else
      doFor ( m, (i-1)/2, k );
    break;
  }

  return 0;

}


#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#define maxn 2000
int a[3000],i,j,n,m,k,l,o,p,sum,now;
int main()
{
	scanf("%d",&k);
	a[++n]=-1;
	sum=k+2;now=0;
	while (now+maxn<sum&&n<2000)
	{
		a[++n]=maxn;
		now+=maxn;
		sum++;
	}
	if (now+maxn<sum)
	{
		printf("-1");
		return 0;
	}
	if (now<sum) a[++n]=sum-now;
	printf("%d\n",n);
	for (i=1;i<=n;i++)
	printf("%d ",a[i]);
}


#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<iostream>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
using namespace std;
int k;
int main()
{
	cin>>k;
	printf("2000\n");
	for(int i=1;i<=1998;i++) printf("0 ");
	int d=1999-(k+1999)%1999;
	int x=(k+d)/1999;
	printf("%d %d\n",-d,x+d);
	return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int a[100000];
int main()
{
    int k;
    cin>>k;
    int x=1000000-k%2000;
    int y=(k+x-2000*x)/2000;
    int n=2000;
    cout<<n<<endl;
    a[n-1]=y;a[n]=x;
    for(int i=1;i<=n;i++)
    {
    	cout<<a[i]<<' ';
	}
	cout<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int k;
    scanf("%d",&k);
    int x=1000000-k%2000;
    int y=(k+x-2000*x)/2000;
    printf("2000\n");
    for(int i=1;i<=1998;i++)
        printf("0 ");
    printf("%d %d\n",y,x);
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long LL;
const int MAXN = 1e5 + 5;
typedef pair<int, int> pii;

int k;
int ans[2005];

int main(int argc, char* argv[]) {
    cin >> k;
    int n = 2000, pos = 2;
    ans[1] = -1;
    for (int i = 2; i <= n; i++)
        ans[i] = 1;
    k++;

    while (k) {
        int dif;
        if (k >= 1000000) dif = 999999;
        else dif = k;
        k -= dif;
        ans[pos] += dif;
        pos++;
    }

    cout << n << endl;
    for (int i = 1; i <= n; i++)
        cout << ans[i] << " ";
    cout << endl;
    return 0;
}


//  Copyright © 2019 Diego Garcia Rodriguez del Campo. All rights reserved.
#include<bits/stdc++.h>
#define MAX 200005
#define optimiza_io cin.tie(0); ios_base::sync_with_stdio(0);
using namespace std;
typedef long long i64;

i64 N, K;
i64 a[MAX];
i64 ans[MAX];

int main()
{
    optimiza_io
    cin >> K;
    for( i64 i = 3; i <= 2000; i ++ )
    {
        if( i & 1 )
        {
            ans[i] = -1;
            continue;
        }
        ans[i] = 1;
        i64 need = ( K + 1000000  ) / i;
        for( i64 j = 0; j <= 1; j ++ )
        {
            if( need * i < K + 1000000 )
                need++;
            if( need + 2 > 1000000 )
            {
                need--;
                continue;
            }
            if( need + 2 > need*i - K )
            {
                need--;
                continue;
            }
            if( need*i - K > 1000000 )
            {
                need--;
                continue;
            }
            ans[i] = need + 2;
            ans[i - 1]--;
            ans[1] = ans[2] = need*i - K ;
            ans[2 ]*= -1;
            cout << i << "\n";
            for( i64 j = 1; j <= i; j ++ )
                cout << ans[j] << " ";
            return 0;
        }
    }
    cout << "-1\n";
    return 0;
}

/*

4
3 3 3 3

*/


//  Copyright © 2019 Diego Garcia Rodriguez del Campo. All rights reserved.
#include<bits/stdc++.h>
#define MAX 200005
#define optimiza_io cin.tie(0); ios_base::sync_with_stdio(0);
using namespace std;
typedef long long i64;

i64 N, K;
i64 a[MAX];
i64 ans[MAX];

int main()
{
    optimiza_io
    cin >> K;
    for( i64 i = 3; i <= 2000; i ++ )
    {
        if( i & 1 )
        {
            ans[i] = -1;
            continue;
        }
        ans[i] = 1;
        i64 need = ( K + 1000000  ) / i;
        need++;
        for( i64 j = 0; j <= 200; j ++ )
        {
            if( need + 2 > 1000000 )
            {
                need--;
                continue;
            }
            if( need + 2 > need*i - K )
            {
                need--;
                continue;
            }
            if( need*i - K > 1000000 )
            {
                need--;
                continue;
            }
            ans[i] = need + 2;
            ans[i - 1]--;
            ans[1] = ans[2] = need*i - K ;
            ans[2 ]*= -1;
            cout << i << "\n";
            for( i64 j = 1; j <= i; j ++ )
                cout << ans[j] << " ";
            return 0;
        }
    }
    cout << "-1\n";
    return 0;
}

/*

4
3 3 3 3

*/


//  Copyright © 2019 Diego Garcia Rodriguez del Campo. All rights reserved.
#include<bits/stdc++.h>
#define MAX 200005
#define optimiza_io cin.tie(0); ios_base::sync_with_stdio(0);
using namespace std;
typedef long long i64;

i64 N, K;
i64 a[MAX];
i64 ans[MAX];

void intenta( i64 need , i64 i )
{
    // checa 692502
        if( need + 2 > 1000000 )
            return;
        if( need + 2 > need*i - K )
            return;
        if( need*i - K > 1000000 )
            return;
        ans[i] = need + 2;
        ans[i - 1]--;
        ans[1] = ans[2] = need*i - K ;
        ans[2 ]*= -1;
        cout << i << "\n";
        for( i64 j = 1; j <= i; j ++ )
            cout << ans[j] << " ";
        exit(0);
}

int main()
{
    optimiza_io
    cin >> K;
    for( i64 i = 3; i <= 2000; i ++ )
    {
        if( i & 1 )
        {
            ans[i] = -1;
            continue;
        }
        ans[i] = 1;
        i64 need = ( K + 1000000  ) / i;
            need++;
        for( i64 j = 0; j <= 100; j ++ )
            intenta( need - j , i );

    }
    return 0;
}

/*

4
3 3 3 3

*/


//  Copyright © 2019 Diego Garcia Rodriguez del Campo. All rights reserved.
#include<bits/stdc++.h>
#define MAX 200005
#define optimiza_io cin.tie(0); ios_base::sync_with_stdio(0);
using namespace std;
typedef long long i64;

i64 N, K;
i64 a[MAX];
i64 ans[MAX];

int main()
{
    optimiza_io
    cin >> K;
    ans[3] = -1;
    for( i64 i = 4; i <= 2000; i ++ )
    {
        if( i & 1 )
        {
            ans[i] =-1;
            continue;
        }
        ans[i] = 1;
        i64 need = ( K + 1000000  ) / i;
        if( need * i < K + 1000000 )
            need++;
        if( need + 1 > 1000000 )
            continue;
        if( need + 1 > need*i - K )
            continue;
        if( need*i - K > 1000000 )
            continue;
        ans[i] = need + 1;
        ans[1] = ans[2] = need*i - K ;
        ans[2 ]*= -1;
        cout << i << "\n";
        for( i64 j = 1; j <= i; j ++ )
            cout << ans[j] << " ";
        return 0;
    }
    return 0;
}

/*

4
3 3 3 3

*/


//  Copyright © 2019 Diego Garcia Rodriguez del Campo. All rights reserved.
#include<bits/stdc++.h>
#define MAX 200005
#define optimiza_io cin.tie(0); ios_base::sync_with_stdio(0);
using namespace std;
typedef long long i64;

i64 N, K;
i64 a[MAX];
i64 ans[MAX];

int main()
{
    optimiza_io
    cin >> K;
    for( i64 i = 3; i <= 2000; i ++ )
    {
        if( i & 1 )
        {
            ans[i] = -1;
            continue;
        }
        ans[i] = 1;
        i64 need = ( K + 1000000  ) / i;
        if( need * i < K + 1000000 )
            need++;
        if( need + 1 > 1000000 )
            continue;
        if( need + 1 > need*i - K )
            continue;
        if( need*i - K > 1000000 )
            continue;
        ans[i] = need + 2;
        ans[i - 1]--;
        ans[1] = ans[2] = need*i - K ;
        ans[2 ]*= -1;
        cout << i << "\n";
        for( i64 j = 1; j <= i; j ++ )
            cout << ans[j] << " ";
        return 0;
    }
    return 0;
}

/*

4
3 3 3 3

*/


//  Copyright © 2019 Diego Garcia Rodriguez del Campo. All rights reserved.
#include<bits/stdc++.h>
#define MAX 4005
#define optimiza_io cin.tie(0); ios_base::sync_with_stdio(0);
using namespace std;
typedef long long i64;
i64 N;
i64 a[MAX];

i64 ansfake( )
{
    i64 res = 0;
    i64 cur = 0;
    i64 k = 0;
    for( i64 i = 1; i <= N; i ++ )
    {
        cur += a[i];
        if( cur < 0 )
        {
            cur = 0;
            k = i;
        }
        res = max( res , ( i - k ) * cur );
    }
    return res;
}

i64 ansreal( )
{
    i64 res = 0;
    for( i64 i = 1; i <= N; i ++ )
    {
        i64 sum = 0;
        for( i64 j = i; j <= N; j ++ )
        {
            sum += a[j];
            res = max( res , sum * ( j - i + 1 ) );
        }
    }
    return res;
}

int main()
{
    optimiza_io
    cin >> N;
    for( i64 i = 1; i <= N; i ++ )
        cin >> a[i];
    cout << ansfake( ) << " " << ansreal( );
    return 0;
}


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

int k,n,x,kk;

int main()
{
	scanf("%d",&k);
	for(int i=2;i<=2000;i++)
	{
	   if(k%(i-1)!=0) continue;
	   kk=k/(i-1)+i;
	   if(kk>1000000) continue;
	   printf("%d\n",i);
	   for(int j=1;j<i;j++) printf("-1 ");
	   printf("%d\n",kk);
	   return 0;
	}
	puts("-1");
	return 0;
}


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

int k,n,x,kk;

int main()
{
	scanf("%d",&k);
	for(int i=2;i<=2000;i++) for(int j=1;j<i;j++)
	{
	   if(k%j!=0) continue;
	   kk=k/j+i;
	   if(kk>(long long)(i-j)*1000000) continue;
	   printf("%d\n",i);
	   for(int k=1;k<=j;k++) printf("-1 ");
	   for(int k=j+1;k<=i;k++){printf("%d ",min(kk,1000000));kk=max(k-1000000,0);}
	   return 0;
	}
	puts("-1");
	return 0;
}


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

int k,n,x,kk;

int main()
{
	scanf("%d",&k);
	for(int i=2;i<=2000;i++)
	{
	   kk=k+i*(i+1);
	   if(kk%(i-1)!=0) continue;
	   kk/=i-1;
	   if(kk>1000000) continue;
	   printf("%d\n",i);
	   for(int j=1;j<i;j++) printf("-1 ");
	   printf("%d\n",kk);
	   return 0;
	}
	puts("-1");
	return 0;
}


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

int k,n,x,kk;

int main()
{
	scanf("%d",&k);
	for(int i=2;i<=2000;i++) for(int j=1;j<i;j++)
	{
	   if(k%j!=0) continue;
	   kk=k/j+i;
	   if(kk>(long long)(i-j)*1000000) continue;
	   printf("%d\n",i);
	   for(int l=1;l<=j;l++) printf("-1 ");
	   for(int l=j+1;l<=i;l++){printf("%d ",min(kk,1000000));kk=max(kk-1000000,0);}
	   return 0;
	}
	puts("-1");
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,k,i,a[10001];
int main(){
	scanf("%d",&k);
	n=2000;
	k=k+n-1;
	a[1]=-1;
	k++;
	for(i=2;i<=n;i++){
		a[i]=min(1000000,k);
		k-=min(1000000,k);
	}
	printf("%d\n",n);
	for(i=1;i<=n;i++)printf("%d ",a[i]);
}


#include<bits/stdc++.h>
using namespace std;
int k, a;
int main() {
    scanf("%d", &k);a = 2000 - k % 2000 + 998000;
    printf("2000\n");
    for (int i = 1; i <= 1998; i ++) printf("0 ");
    printf("%d %d\n", -a + (k + a) / 2000, a);
    return 0;
}


/*
Author: QAQ-Automaton
LANG: C++
PROG: B.cpp
Mail: cnyalilk@vip.qq.com
*/
#include<bits/stdc++.h>
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define Debug debug("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__)
#define all(x) x.begin(),x.end()
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define inf 0x3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f
const double eps=1e-8;
const double pi=acos(-1.0);
template<class T>int chkmin(T &a,T b){return a>b?a=b,1:0;}
template<class T>int chkmax(T &a,T b){return a<b?a=b,1:0;}
template<class T>T sqr(T a){return a*a;}
template<class T>T mmin(T a,T b){return a<b?a:b;}
template<class T>T mmax(T a,T b){return a>b?a:b;}
template<class T>T aabs(T a){return a<0?-a:a;}
template<class T>int dcmp(T a,T b){return a>b;}
template<int *a>int cmp_a(int x,int y){return a[x]<a[y];}
#define min mmin
#define max mmax
#define abs aabs
namespace io {
	const int SIZE = (1 << 21) + 1;
	char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c, qu[55]; int f, qr;
	// getchar
	#define gc() (iS == iT ? (iT = (iS = ibuf) + fread (ibuf, 1, SIZE, stdin), (iS == iT ? EOF : *iS ++)) : *iS ++)
	// print the remaining part
	inline void flush () {
		fwrite (obuf, 1, oS - obuf, stdout);
		oS = obuf;
	}
	// putchar
	inline void putc (char x) {
		*oS ++ = x;
		if (oS == oT) flush ();
	}
	// input a signed integer
	inline bool read (signed &x) {
		for (f = 1, c = gc(); c < '0' || c > '9'; c = gc()) if (c == '-') f = -1;else if(c==EOF)return 0;
		for (x = 0; c <= '9' && c >= '0'; c = gc()) x = x * 10 + (c & 15); x *= f;
		return 1;
	}

	inline bool read (long long &x) {
		for (f = 1, c = gc(); c < '0' || c > '9'; c = gc()) if (c == '-') f = -1;else if(c==EOF)return 0;
		for (x = 0; c <= '9' && c >= '0'; c = gc()) x = x * 10 + (c & 15); x *= f;
		return 1;
	}
	inline bool read (char &x) {
		x=gc();
		return x!=EOF;
	}
	inline bool read(char *x){
		while((*x=gc())=='\n' || *x==' '||*x=='\r')if(*x==EOF)return 0;
		while(!(*x=='\n'||*x==' '||*x=='\r'))*(++x)=gc();
		*x=0;
		return 1;
	}
	template<typename A,typename ...B>
	inline bool read(A &x,B &...y){
		return read(x)&&read(y...);
	}
	// print a signed integer
	inline bool write (signed x) {
		if (!x) putc ('0'); if (x < 0) putc ('-'), x = -x;
		while (x) qu[++ qr] = x % 10 + '0',  x /= 10;
		while (qr) putc (qu[qr --]);
		return 0;
	}

	inline bool write (long long x) {
		if (!x) putc ('0'); if (x < 0) putc ('-'), x = -x;
		while (x) qu[++ qr] = x % 10 + '0',  x /= 10;
		while (qr) putc (qu[qr --]);
		return 0;
	}
	inline bool write (char x) {
		putc(x);
		return 0;
	}
	inline bool write(const char *x){
		while(*x){putc(*x);++x;}
		return 0;
	}
	inline bool write(char *x){
		while(*x){putc(*x);++x;}
		return 0;
	}
	template<typename A,typename ...B>
	inline bool write(A x,B ...y){
		return write(x)||write(y...);
	}
	//no need to call flush at the end manually!
	struct Flusher_ {~Flusher_(){flush();}}io_flusher_;
}
using io :: read;
using io :: putc;
using io :: write;
int main(){
#ifdef QAQAutoMaton
	freopen("B.in","r",stdin);
	freopen("B.out","w",stdout);
#endif
	int k,n;
	read(k);
	for(int n=2;n<=2000;++n){
		for(int lw=1;lw<n;++lw)if(!((k+n)%(n-lw)) && ((k+n)/(n-lw)<=lw*1000000)){
			write(n,'\n');
			for(int i=1;i<n-lw;++i){
				write("0 ");
			}
			write("-1 ");
			int m=(k+n)/(n-lw);
			for(int i=1;i<=lw;++i){
				write(min(m,1000000),i==lw?'\n':' ');
				m-=min(m,1000000);
			}
			return 0;

		}
	}
	return write("-1\n");
}


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

const int maxn=2007;
const int t=1e6;
int ans[maxn],k,n=2000,x;

int main(){
	cin>>k;
	if (k<=t-2){
		cout<<2<<endl;
		cout<<-1<<" "<<k+2<<endl;
		return 0;
	}
	n=1999;
	x=(k+t)%n;
	cout<<n<<endl;
	int sum=(k+t-x)/n;
	for (int i=1;i<999;++i){
		cout<<1<<" "<<-2<<" ";
	}
	cout<<1<<" "<<-(t-x-998-sum)<<" ";
	cout<<t-x<<endl;
}


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

const int maxn=2007;
const int t=1e6;
int ans[maxn],k,n=2000,x;

int main(){
	cin>>k;
	if (k<1e6){
		cout<<2<<endl;
		cout<<-1<<" "<<k+1<<endl;
		return 0;
	}
	n=1999;
	x=(k+t)%n;
	cout<<n<<endl;
	int sum=(k+t-x)/n;
	for (int i=1;i<999;++i){
		cout<<1<<" "<<-2<<" ";
	}
	cout<<1<<" "<<-(t-x-998-sum)<<" ";
	cout<<t-x<<endl;
}


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

const int maxn=2007;
const int t=1e6;
int ans[maxn],k,n=2000,x;

int main(){
	cin>>k;
	if (k<=t-2){
		cout<<2<<endl;
		cout<<-1<<" "<<k+2<<endl;
		return 0;
	}
	n=1999;
	x=(k+t)%n;
	cout<<n<<endl;
	int sum=(k+t-x)/n;
	for (int i=1;i<999;++i){
		cout<<1<<" "<<-2<<" ";
	}
	cout<<1<<" "<<-(t-x-998-sum)-1<<" ";
	cout<<t-x<<endl;
	cout<<sum<<endl;
}


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

const int maxn=2007;
const int t=1e6;
int ans[maxn],k,n=2000,x;

int main(){
	cin>>k;
	if (k<=t-2){
		cout<<2<<endl;
		cout<<-1<<" "<<k+2<<endl;
		return 0;
	}
	n=1999;
	x=(k+t)%n;
	cout<<n<<endl;
	int sum=(k+t-x)/n;
	for (int i=1;i<999;++i){
		cout<<1<<" "<<-2<<" ";
	}
	cout<<1<<" "<<-(t-x-998-sum)-1<<" ";
	cout<<t-x<<endl;
}


#include<bits/stdc++.h>
using namespace std;
//#define %d %lld
//#define int long long
typedef long long ll;
#define sqr(x) ((x)*(x))
#define pb push_back
#define mp make_pair
#define F first
#define S second
const int N=1000002,M=998244353;
void Max(int &x,int y){if(y>x)x=y;}void Min(int &x,int y){if(y<x)x=y;}
void inc(int &x,int y){x+=y;if(x>=M)x-=M;}void dec(int &x,int y){x-=y;if(x<0)x+=M;}
int pw(int x,int y){int z=1;for(;y;y>>=1,x=1ll*x*x%M)if(y&1)z=1ll*z*x%M;return z;}
void read(int *a,int n){for(int i=1;i<=n;i++)scanf("%d",&a[i]);}
//struct node{int to,ne}e[];
//void add(int x,int y){e[++tot]=(node){y,h[x]},h[x]=tot;}
int n,k,i,x,y,t,cnt,l,a[2002];
signed main(){
	scanf("%d",&k),n=2000;
	l=n/3+1,t=n-l,k+=n,cnt++;
	while (k%t!=0) k+=n,cnt++;
	x=k/t;
	y=x+cnt;
	printf("%d\n",n);
	for (i=1;i<=l;i++) printf("%d ",a[i]=x/l+(i<=x%l));
	t=n-2*l;
	for (i=1;i<=t;i++) printf("%d ",a[i+l]=-(y/t+(i<=y%t)));
	for (i=1;i<=l;i++) printf("%d ",a[i+l+t]=x/l+(i<=x%l));
//	int sum=0;
//	for (i=1;i<=l;i++) sum+=a[i];
//	if (sum!=x) puts("xmy");
//	for (i=1;i<=n;i++)
//		if (abs(a[i])>1e6) puts("xmy");
//	sum=0;
//	for (i=l+1;i<=l+t;i++) sum+=a[i];
//	if (sum!=-y) puts("xmy");
}


#include<bits/stdc++.h>
using namespace std;
//#define %d %lld
//#define int long long
typedef long long ll;
#define sqr(x) ((x)*(x))
#define pb push_back
#define mp make_pair
#define F first
#define S second
const int N=1000002,M=998244353;
void Max(int &x,int y){if(y>x)x=y;}void Min(int &x,int y){if(y<x)x=y;}
void inc(int &x,int y){x+=y;if(x>=M)x-=M;}void dec(int &x,int y){x-=y;if(x<0)x+=M;}
int pw(int x,int y){int z=1;for(;y;y>>=1,x=1ll*x*x%M)if(y&1)z=1ll*z*x%M;return z;}
void read(int *a,int n){for(int i=1;i<=n;i++)scanf("%d",&a[i]);}
//struct node{int to,ne}e[];
//void add(int x,int y){e[++tot]=(node){y,h[x]},h[x]=tot;}
int k,n,i;
signed main(){
	scanf("%d",&k),n=1999;
	k+=n+1;
	printf("%d\n",n+1);
	printf("-1 ");
	for (i=1;i<=n;i++) printf("%d ",k/n+(i<=k%n));
}


#include<bits/stdc++.h>
using namespace std;
//#define %d %lld
//#define int long long
typedef long long ll;
#define sqr(x) ((x)*(x))
#define pb push_back
#define mp make_pair
#define F first
#define S second
const int N=1000002,M=998244353;
void Max(int &x,int y){if(y>x)x=y;}void Min(int &x,int y){if(y<x)x=y;}
void inc(int &x,int y){x+=y;if(x>=M)x-=M;}void dec(int &x,int y){x-=y;if(x<0)x+=M;}
int pw(int x,int y){int z=1;for(;y;y>>=1,x=1ll*x*x%M)if(y&1)z=1ll*z*x%M;return z;}
void read(int *a,int n){for(int i=1;i<=n;i++)scanf("%d",&a[i]);}
//struct node{int to,ne}e[];
//void add(int x,int y){e[++tot]=(node){y,h[x]},h[x]=tot;}
int n,k,i,x,y,t,cnt,l;
signed main(){
	scanf("%d",&k),n=2000;
	l=n/3+1,t=n-l,k+=n,cnt++;
	while (k%t!=0) k+=n,cnt++;
	x=k/t;
	y=x+cnt;
	for (i=1;i<=l;i++) printf("%d ",x/l+(i<=x%l));
	t=n-2*l;
	for (i=1;i<=t;i++) printf("%d ",-(y/t+(i<=y%t)));
	for (i=1;i<=l;i++) printf("%d ",x/l+(i<=x%l));
}


#include<bits/stdc++.h>
using namespace std;
//#define %d %lld
//#define int long long
typedef long long ll;
#define sqr(x) ((x)*(x))
#define pb push_back
#define mp make_pair
#define F first
#define S second
const int N=1000002,M=998244353;
void Max(int &x,int y){if(y>x)x=y;}void Min(int &x,int y){if(y<x)x=y;}
void inc(int &x,int y){x+=y;if(x>=M)x-=M;}void dec(int &x,int y){x-=y;if(x<0)x+=M;}
int pw(int x,int y){int z=1;for(;y;y>>=1,x=1ll*x*x%M)if(y&1)z=1ll*z*x%M;return z;}
void read(int *a,int n){for(int i=1;i<=n;i++)scanf("%d",&a[i]);}
//struct node{int to,ne}e[];
//void add(int x,int y){e[++tot]=(node){y,h[x]},h[x]=tot;}
int k,n,i;
signed main(){
	scanf("%d",&k),n=1999;
	k+=n+1;
	printf("-1 ");
	for (i=1;i<=n;i++) printf("%d ",k/n+(i<=k%n));
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int N = 5005;

int k;

int main(){

    scanf("%d", &k);

    for(int n = 2; n <= 2000; n++){
        for(int l = 1; l < n; l++){
            int d = n - l;
            if(k > d * 1000000LL * l - d) continue;
            printf("%d\n", n);
            for(int i = 1; i < l; i++){
                printf("0 ");
            }
            k += d;
            printf("-1 ");
            for(int i = l + 1; i <= n; i++){
                int tmp = min(1000000, k / l);
                printf("%d%c", tmp, " \n"[i == n]);
                k -= tmp * l;
            }
            return 0;
        }
    }

    printf("-1\n");

}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int N = 5005;

int k;

int a[N];

ll find_answer(int n){
    ll res = 0;
    ll cur = 0;
    ll all = 0;
    int kk = -1;
    for(int i = 0; i < n; i++){
        cur += a[i];
        all += a[i];
        cout << a[i] << endl;
        if(cur < 0){
            cur = 0;
            kk = i;
        }
        res = max(res, (i - kk) * cur);
    }
    return n * all - res;
}

int main(){

    scanf("%d", &k);

    for(int n = 2; n <= 2000; n++){
        for(int l = 1; l < n; l++){
            int d = n - l;
            if(k > d * 1000000LL * l - d - l) continue;
            if((k + n) % l) continue;
            printf("%d\n", n);
            for(int i = 1; i < l; i++){
                printf("0 "), a[i - 1] = 0;
            }
            k += d + l;
            k /= l;
            printf("-1 ");
            a[l - 1] = -1;
            for(int i = l + 1; i <= n; i++){
                int tmp = min(1000000, k);
                printf("%d%c", tmp, " \n"[i == n]);
                a[i - 1] = tmp;
                k -= tmp;
                if(k < 0) k = 0;
            }
            return 0;
        }
    }

    printf("-1\n");

}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const int N = 5005;

int k;

int main(){

    scanf("%d", &k);

    for(int n = 2; n <= 2000; n++){
        for(int l = 1; l < n; l++){
            int d = n - l;
            if(k > d * 1000000LL * l - d) continue;
            printf("%d\n", n);
            for(int i = 1; i < l; i++){
                printf("0 ");
            }
            k += d + l;
            printf("-1 ");
            for(int i = l + 1; i <= n; i++){
                int tmp = min(1000000, k / l);
                printf("%d%c", tmp, " \n"[i == n]);
                k -= tmp * l;
            }
            return 0;
        }
    }

    printf("-1\n");

}


#include<bits/stdc++.h>
#define inf 1000000007
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define mod 234
typedef long long ll;
using namespace std;   // lyt
int n,m,ma,tmp;
int gets(){
	int v=0;char ch;bool f=0;
	while(!isdigit(ch=getchar())) if(ch=='-') f=1; v=ch-48;
	while( isdigit(ch=getchar())) v=(v<<1)+(v<<3)+ch-48;
	return f?-v:v;
}
int main ()
{
	m=gets();
	n=2000; ma=1000000;
	while(1){
		tmp=m+ma;
		if(tmp%2000==0){
			tmp/=2000;
			break;
		}
		ma--;
	}
	for(int i=1;i<=n-2;i++) cout<<"0 ";
	cout<<tmp-ma<<" "<<ma<<endl;
	return 0;
}


#include<bits/stdc++.h>
#define inf 1000000007
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define mod 234
typedef long long ll;
using namespace std;   // lyt
int n,m,ma,tmp;
int gets(){
	int v=0;char ch;bool f=0;
	while(!isdigit(ch=getchar())) if(ch=='-') f=1; v=ch-48;
	while( isdigit(ch=getchar())) v=(v<<1)+(v<<3)+ch-48;
	return f?-v:v;
}
int main ()
{
	m=gets();
	n=2000; ma=1000000;
	cout<<"2000\n";
	while(1){
		tmp=m+ma;
		if(tmp%2000==0){
			tmp/=2000;
			break;
		}
		ma--;
	}
	for(int i=1;i<=n-2;i++) cout<<"0 ";
	cout<<tmp-ma<<" "<<ma<<endl;
	return 0;
}


import java.util.*;
import java.io.*;
public class Solution
{
    public static int MIN(int a,int b)
    {
        if(a<b)
            return a;
        return b;
    }
    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int t = Integer.parseInt(br.readLine());
        while(t-->0)
        {
            String[] inp = br.readLine().split(" ");
            int[] a = new int[3];
            a[0] = Integer.parseInt(inp[0]);
            a[1] = Integer.parseInt(inp[1]);
            a[2] = Integer.parseInt(inp[2]);
            String[] inp2 = br.readLine().split(" ");
            int[] b = new int[3];
            b[0] = Integer.parseInt(inp2[0]);
            b[1] = Integer.parseInt(inp2[1]);
            b[2] = Integer.parseInt(inp2[2]);
            int sum = 0;
            sum += 2*MIN(a[2],b[1]);
            int p = MIN(a[2],b[1]);
            a[2] -= p;
            b[1] -= p;
            if(a[2]>0)
            {
                int q = MIN(a[2],b[0]);
                a[2] -= q;
                b[0] -= q;
            }
            if(a[2]>0)
            {
                b[2] -= a[2];
                a[2]=0;
            }
            int k = MIN(a[1],b[0]);
            a[1] -= k;
            b[0] -= k;
            int l = MIN(a[1],b[1]);
            a[1] -= l;
            b[1] -= l;
            if(a[1]>0)
                sum -= 2*a[1];
            bw.write(sum+"\n");
        }
        bw.flush();
    }
}


import java.util.*;

public class CodeforcesContest {

    private static int sport(int a0, int a1, int a2, int b0, int b1, int b2) {
        if (a2 <= b1) {
            int k = Math.max(0, b2 - a0);
            return 2 * a2 - k;
        }
        int k = Math.max(0, b2 - a0 - a2 + b1);
        return 2 * b1 - k;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int exp = sc.nextInt();
        for (int i = 0; i < exp; i++) {
            int a0 = sc.nextInt();
            int a1 = sc.nextInt();
            int a2 = sc.nextInt();
            int b0 = sc.nextInt();
            int b1 = sc.nextInt();
            int b2 = sc.nextInt();
            int ans = sport(a0, a1, a2, b0, b1, b2);
            System.out.println(ans);
        }
    }
}


package com;

import java.util.*;

public class CodeforcesContest {

    private static int sport(int a0, int a1, int a2, int b0, int b1, int b2) {
        if (a2 <= b1) {
            return 2 * a2 - 2 * Math.max(0, b2 - a0);
        } else {
            int k = 0;
            if (b1 == 0) {
                k = 0;
            } else {
                k = 2 * Math.min(a2, b1);
            }
            return k - 2 * Math.max(0, b2 - a2 + b1 - a0);
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int exp = sc.nextInt();
        for (int i = 0; i < exp; i++) {
            int a0 = sc.nextInt();
            int a1 = sc.nextInt();
            int a2 = sc.nextInt();
            int b0 = sc.nextInt();
            int b1 = sc.nextInt();
            int b2 = sc.nextInt();
            int ans = sport(a0, a1, a2, b0, b1, b2);
            System.out.println(ans);
        }
    }
}


import java.util.*;

public class CodeforcesContest {

    private static int sport(int a0, int a1, int a2, int b0, int b1, int b2) {
        if (a2 <= b1) {
            return 2 * a2 - 2 * Math.max(0, b2 - a0);
        } else {
            int k = 0;
            if (b1 == 0) {
                k = 0;
            } else {
                k = 2 * Math.min(a2, b1);
            }
            return k - 2 * Math.max(0, b2 - a2 + b1 - a0);
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int exp = sc.nextInt();
        for (int i = 0; i < exp; i++) {
            int a0 = sc.nextInt();
            int a1 = sc.nextInt();
            int a2 = sc.nextInt();
            int b0 = sc.nextInt();
            int b1 = sc.nextInt();
            int b2 = sc.nextInt();
            int ans = sport(a0, a1, a2, b0, b1, b2);
            System.out.println(ans);
        }
    }
}


import java.util.Scanner ;
public class Main
{
    public static void main ( String[] args )
    {
        Scanner scan = new Scanner ( System.in ) ;
        int t = scan.nextInt() ;
        while ( t -- > 0 )
        {
            long x1 = scan.nextLong() ;
            long y1 = scan.nextLong() ;
            long z1 = scan.nextLong() ;
            long x2 = scan.nextLong() ;
            long y2 = scan.nextLong() ;
            long z2 = scan.nextLong() ;
            Long x = Math.min ( z1 , y2 ) ;
            Long pro = 0L ;
            pro = x * 2 ;
            z1 = z1 - x ;
            y2 = y2 - x ;
            Long diff = ( y1 - ( x2 + y2 ) ) ;
            if ( diff > 0 )
            {
                pro = pro - ( diff * ( -2 ) ) ;
            }
            System.out.println( pro ) ;
        }
    }
}


import java.util.* ;
import java.lang.Math ;
public class Main
{
    public static void main ( String[] args )
    {
        Scanner scan = new Scanner ( System.in ) ;
        Long t = scan.nextLong() ;
        while ( t -- > 0 )
        {
            long x1 = scan.nextLong() ;
            long y1 = scan.nextLong() ;
            long z1 = scan.nextLong() ;
            long x2 = scan.nextLong() ;
            long y2 = scan.nextLong() ;
            long z2 = scan.nextLong() ;
            Long pro1 = Math.min  ( z1 , y2 ) * 2 ;
            z1 = z1 - ( Math.min ( z1 , y2 ) ) ;
            y2 = y2 - ( Math.min ( z1 , y2 ) ) ;
            Long pro2 = 0L ;
            if ( z2 > ( x1 + z1 ) )
            {
                if ( y1 > ( x2 + y2 ) )
                {
                    Long m1 = z2 - ( x1 + z1 ) ;
                    Long m2 = y1 - ( x2 + y2 ) ;
                    pro2 = Math.min ( m1 , m2 ) * ( -2 ) ;
                }
            }
            System.out.println( pro1 + pro2 ) ;
        }
    }
}


import java.util.* ;
import java.lang.Math ;
public class Main
{
    public static void main ( String[] args )
    {
        Scanner scan = new Scanner ( System.in ) ;
        int t = scan.nextInt() ;
        while ( t -- > 0 )
        {
            long x1 = scan.nextLong() ;
            long y1 = scan.nextLong() ;
            long z1 = scan.nextLong() ;
            long x2 = scan.nextLong() ;
            long y2 = scan.nextLong() ;
            long z2 = scan.nextLong() ;
            Long pro1 = Math.min  ( z1 , y2 ) * 2 ;
            z1 = z1 - ( Math.min ( z1 , y2 ) ) ;
            y2 = y2 - ( Math.min ( z1 , y2 ) ) ;
            Long x = y1 - ( x2 + y2 ) ;
            if ( x > 0 )
            {
                pro1 = pro1 + ( -2 ) ;
            }
            System.out.println( pro1 ) ;
        }
    }
}


import java.util.Scanner ;
public class Main
{
    public static void main ( String[] args )
    {
        Scanner scan = new Scanner ( System.in ) ;
        int t = scan.nextInt() ;
        while ( t -- > 0 )
        {
            Long x1 = scan.nextLong() ;
            Long y1 = scan.nextLong() ;
            Long z1 = scan.nextLong() ;
            Long x2 = scan.nextLong() ;
            Long y2 = scan.nextLong() ;
            Long z2 = scan.nextLong() ;
            Long pro = 0L ;
            Long x = Math.min ( z1 , y2 ) ;
            pro = pro + x * 2 ;
            z1 = z1 - x ;
            y2 = y2 - x ;
            Long y = ( y1 - ( x2 + y2 ) ) ;
            if ( y > 0 )
            {
                pro = pro - ( ( - 2 ) * y ) ;
            }
            System.out.println( pro ) ;
        }
    }
}


import java.util.Scanner ;
public class Main
{
    public static void main ( String[] args )
    {
        Scanner scan = new Scanner ( System.in ) ;
        int t = scan.nextInt() ;
        while ( t -- > 0 )
        {
            long x1 = scan.nextLong() ;
            long y1 = scan.nextLong() ;
            long z1 = scan.nextLong() ;
            long x2 = scan.nextLong() ;
            long y2 = scan.nextLong() ;
            long z2 = scan.nextLong() ;
            Long x = Math.min ( z1 , y2 ) ;
            Long pro = 0L ;
            pro = x * 2 ;
            z1 = z1 - x ;
            y2 = y2 - x ;
            Long diff = ( y1 - ( x2 + y2 ) ) ;
            if ( diff > 0 )
            {
                pro = pro - ( diff * ( 2 ) ) ;
            }
            System.out.println( pro ) ;
        }
    }
}


import java.util.*;
public class q2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
Scanner s=new Scanner(System.in);
int t=s.nextInt();
while(t-->0) {
	int x1=s.nextInt();
	int y1=s.nextInt();
	int z1=s.nextInt();
	int x2=s.nextInt();
	int y2=s.nextInt();
	int z2=s.nextInt();

	int n=Math.min(z1, y2);
	z1=z1-n;
	y2=y2-n;
	if((x1+x2)>=(y1+y2+z1+z2)) {
		System.out.println(n*2);
		continue;
	}

	y2=y2-Math.min(y1, y2);
	y1=y1-Math.min(y1, y2);
	z1=z1-Math.min(z1, z2);
	z2=z2-Math.min(z1, z2);

	int temp=Math.min((z2-x1),(y1-x2));
	if(temp>0) {
		System.out.println((2*n)-(2*temp));
	}

}
	}

}


import java.util.*;
public class q2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
Scanner s=new Scanner(System.in);
int t=s.nextInt();
while(t-->0) {
	int x1=s.nextInt();
	int y1=s.nextInt();
	int z1=s.nextInt();
	int x2=s.nextInt();
	int y2=s.nextInt();
	int z2=s.nextInt();

	int n=Math.min(z1, y2)*2;
	System.out.println(n);
}
	}

}


import java.util.*;
public class q2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
Scanner s=new Scanner(System.in);
int t=s.nextInt();
while(t-->0) {
	int x1=s.nextInt();
	int y1=s.nextInt();
	int z1=s.nextInt();
	int x2=s.nextInt();
	int y2=s.nextInt();
	int z2=s.nextInt();

	int n=Math.min(z1, y2);
	z1=z1-n;
	y2=y2-n;
	if((x1+x2)>=(y1+y2+z1+z2)) {
		System.out.println(n*2);
	}else {

	y2=y2-Math.min(y1, y2);
	y1=y1-Math.min(y1, y2);
	z1=z1-Math.min(z1, z2);
	z2=z2-Math.min(z1, z2);
	if(z2-x1>=0 && y1-x2>=0) {
	int temp=Math.min((z2-x1),(y1-x2));
	if(temp>=0) {
		System.out.println((2*n)-(2*temp));
	}
	}else {
		System.out.println(2*n);
	}
	}
}
	}

}


import java.util.*;
public class q2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
Scanner s=new Scanner(System.in);
int t=s.nextInt();
while(t-->0) {
	int x1=s.nextInt();
	int y1=s.nextInt();
	int z1=s.nextInt();
	int x2=s.nextInt();
	int y2=s.nextInt();
	int z2=s.nextInt();

	int n=Math.min(z1, y2);
	z1=z1-n;
	y2=y2-n;
	if((x1+x2)>=(y1+y2+z1+z2)) {
		System.out.println(n*2);
	}else {

	y2=y2-Math.min(y1, y2);
	y1=y1-Math.min(y1, y2);
	z1=z1-Math.min(z1, z2);
	z2=z2-Math.min(z1, z2);

	int temp=Math.min((z2-x1),(y1-x2));
	if(temp>=0) {
		System.out.println((2*n)-(2*temp));
	}
	}

}
	}

}


import java.util.Scanner;
public class cf665_2_2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		sc.close();
	}

}


import java.util.*;

public class ternary{
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
            while(t-->0) {
                int x1 = sc.nextInt();
                int y1 = sc.nextInt();
                int z1 = sc.nextInt();
                int x2 = sc.nextInt();
                int y2 = sc.nextInt();
                int z2 = sc.nextInt();
                long ans = 0;
                int com = Math.min(z1, y2);
                ans += com*2;
                z1 -= com;
                y2 -= com;
                com = Math.min(z1, z2);
                z1 -= com;
                z2 -= com;
                com = Math.min(x1, z2);
                x1 -= com;
                z2 -= com;
                if(z2 != 0) {
                    ans -= z2*2;
                }

                System.out.println(ans);
            }
    }
}


import java.util.*;
public class cf665_2_2 {

	public static void main(String[] aansgs) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-- > 0) {
			int x=sc.nextInt(),y=sc.nextInt(),z=sc.nextInt();
			int x1=sc.nextInt(),y1=sc.nextInt(),z1=sc.nextInt();

			long ans=0;
			if(y<=x1)
			{
				 ans=2*Math.min(z,y1);
				 System.out.println(ans);
			}
			else if(y<=x1+y1)
			{
				 ans=2*Math.min(z,y1-(y-x1));
				 System.out.println(ans);
			}
			else if(y>x1+y1)
			{
				 ans=-2*Math.min(z1,y-x1-y1);
				 System.out.println(ans);
			}
			else
				System.out.println(0);
		}
		sc.close();
	}

}


import java.io.*;
import java.util.*;

public class Main{
	static BufferedReader reader;
	static StringTokenizer tokenizer;
	static PrintWriter writer;

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}
	static String nexts() throws IOException {
	  	  tokenizer = new StringTokenizer(reader.readLine());
	   	 String s="";
	   	 while (tokenizer.hasMoreTokens()) {
			s+=tokenizer.nextElement()+" ";
		}
		return s;
	}

	//String str=nextToken();
	//String[] s = str.split("\\s+");

	public static int gcd(int x, int y){
		if (y == 0) return x; else return gcd(y, x % y);
	}

	public static boolean isPrime(int n)
	    {
	        // Corner cases
	        if (n <= 1){
		 return false; }
	        if (n <= 3){
		 return true; }

	        // This is checked so that we can skip
	        // middle five numbers in below loop
	        if (n % 2 == 0 || n % 3 == 0){
		 return false; }

	        for (int i = 5; i * i <= n; i = i + 6) {    //Checking 6i+1 & 6i-1
	            if (n % i == 0 || n % (i + 2) == 0) {
	            	return false;  }
	            }
			//O(sqrt(n))
	        return true;
	    }

	public static void shuffle(int[] A) {
		for (int i = 0; i < A.length; i++) {
			int j = (int)(i * Math.random());
			int tmp = A[i];
			A[i] = A[j];
			A[j] = tmp;
		}
	}

	 public static long power(int x, long n)
	{
	    long mod = 1000000007;
		if (n == 0) {
			return 1;
		}

		long pow = power(x, n / 2);

		if ((n & 1) == 1) {
			return (x * pow * pow)%mod;
		}
		return (pow * pow)%mod;
	}
	 static long ncr(int n, int k)
   	 {

     		  long res = 1;
  		   // Since C(n, k) = C(n, n-k)
 		       if (k > n - k) {
     		       k = n - k;
      		  }
  		  // Calculate value of [n*(n-1)*---*(n-k+1)] / [k*(k-1)*---*1]
     		   for (int i = 0; i < k; ++i) {
        		    res *= (n - i);
         		   res /= (i + 1);
     		   }
  		  return res;
    }
	public static int lower_bound(int[] A, int lo, int hi, int x) {
		if (A[lo] >= x) {
			return lo;
		} else if (A[hi] < x) {
			return hi + 1;
		}
		while (lo <= hi) {
			int mid = (lo + hi) / 2;
			if (A[mid] >= x) {
				hi = mid - 1;
			} else {
				lo = mid + 1;
			}
		}
		return hi + 1;
	}
	 static class R implements Comparable<R>{
	        int x, y;
	        public  R(int x, int y) {
	            this.x = x;
	            this.y = y;
	        }
	        public int compareTo(R o) {
            		return x-o.x;     //Increasing order(Which is usually required)
        		}
	    }
	// int t=a[i];
	// a[i]=a[j];
	// a[j]=t;
	//double d=Math.sqrt(Math.pow(Math.abs(x2-x1),2)+Math.pow(Math.abs(y2-y1),2));
	public static void main(String[] args) throws IOException {
		reader = new BufferedReader(new InputStreamReader(System.in));
		tokenizer = null;
		writer = new PrintWriter(System.out);
		solve();
		reader.close();
		writer.close();
	}

	private static void solve() throws IOException {
		int t = nextInt();
		while(t-->0){
			//long n = nextLong();
			//String s= nextToken();
			//long[] a=new long[n];
			//ArrayList<Integer> ar=new ArrayList<Integer>();
			//HashSet<Integer> set=new HashSet<Integer>();
			//HashMap<Integer,String> h=new HashMap<Integer,String>();
			//R[] a1=new R[n];
			//char[] c=nextToken().toCharArray();

		int x1 = nextInt();
		int y1 = nextInt();
		int z1 = nextInt();
		int x2 = nextInt();
		int y2 = nextInt();
		int z2 = nextInt();

		//int n=x1+y1+z1;
		int c=0;

		int d=Math.min(z1,y2);
		c+=(2*d);
		z1-=d;
		y2-=d;

		d=Math.min(z1,z2);
		z2-=d;
		z1-=d;

	    d=Math.min(z2,x1);
	    z2-=d;
	    x1-=d;
	    //writer.println(z2);

	    d=Math.min(y1,z2);
	    c-=(2*d);
	    writer.println(c);
		}
	}
}