#include<bits/stdc++.h>
using namespace std;
#define ll long long
inline int read()
{
	char ch=getchar(); int ne=0; while(!isdigit(ch)) {if(ch=='-') ne=1; ch=getchar();}
	int ans=0; while(isdigit(ch)) ans=ans*10+ch-'0',ch=getchar();
	if(ne) return -ans;
	else return ans;
}
#define mod 998244353
inline int add(int x,int y) {return x+y>=mod?x+y-mod:x+y;}
inline int sub(int x,int y) {return x-y<0?x-y+mod:x-y;}
inline int mul(int x,int y) {return 1LL*x*y%mod;}
inline int add(int x,int y,int z) {return add(add(x,y),z);}
inline int mul(int x,int y,int z) {return mul(mul(x,y),z);}
int qpow(int x,ll y)
{
	int ans=1;
	while(y)
	{
		if(y&1) ans=mul(ans,x);
		x=mul(x,x),y>>=1;
	}
	return ans;
}
int Inv(int x) {return qpow(x,mod-2);}
mt19937 rnd((long long) new char);
int Rnd(int l,int r) {return rnd()%(r-l+1)+l;}
void work()
{
	int n=Rnd(1,250)*2,q=5,x=Rnd(1,n),lim=500;
	printf("%d %d %d %d\n",n,q,x,lim);
	for(int i=1;i<=n;i++) printf("%d%c",Rnd(0,mod-1)," \n"[i==n]);
}
signed main()
{
	freopen("noodle.in","w",stdout);
	int T=1,se=Rnd(1,1e9);
	printf("%d %d %d\n",0,T,se);
	while(T--) work();
	return 0;
}

