#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
vector<string> res={"0","IMPOSSIBLE","2 3","1 2 3","IMPOSSIBLE","3 2 2 1 3","1 3 2 2 1 3","IMPOSSIBLE","2 1 1 2 3 1 2 3","2 1 1 1 1 2 3 2 3","IMPOSSIBLE","1 3 1 1 2 1 1 2 2 3 3","1 1 1 3 1 1 2 1 2 2 3 3","IMPOSSIBLE","1 2 1 1 1 1 1 1 3 2 2 2 3 3","1 1 1 1 1 2 1 1 1 2 2 3 2 3 3","IMPOSSIBLE","2 1 1 3 1 1 1 1 1 1 2 2 2 2 3 3 3","1 1 2 1 1 1 3 1 1 1 1 2 2 2 2 3 3 3","IMPOSSIBLE","1 1 1 1 1 1 1 1 2 1 1 1 2 3 2 2 2 3 3 3","1 2 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 3","IMPOSSIBLE","2 1 1 1 1 2 3 1 1 1 1 1 1 1 2 2 2 2 2 3 3 3 3","1 1 1 1 1 1 1 1 1 2 3 1 1 1 1 2 2 2 2 2 3 3 3 3","IMPOSSIBLE","1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 3 2 2 3 3 3 3","1 3 1 1 1 1 1 1 2 1 1 1 1 1 1 1 2 2 2 2 2 2 3 3 3 3 3","IMPOSSIBLE","1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 2 1 1 2 2 2 2 2 2 3 3 3 3 3","2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 1 1 2 2 2 2 2 2 2 3 3 3 3 3","IMPOSSIBLE","1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3","1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 2 2 2 2 2 2 3 3 3 3 3 3","IMPOSSIBLE","1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 2 2 2 2 2 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int,2>,array<int,3>> m[N+1];
// m[0][{0,0}]={0,0,0};
// for(int i=1;i<=N;i++)
// {
// cout << "i=" << i << endl;
// for(auto p:m[i-1])
// {
// int a=p.first[0];
// int b=p.first[1];
// if(a+i<=lim) m[i][{a+i,b}]={a,b,1};
// if(b+i<=lim) m[i][{a,b+i}]={a,b,2};
// m[i][{a,b}]={a,b,3};
// }
// }
// for(int n=1;n<=100;n++)
// {
// cout << "\"";
// int s=(n*(n+1)/2);
// bool ok=((s%3)==0);
// int x=s/3;
// if(ok&&m[n].find({x-1,x})!=m[n].end())
// {
// vector<int> res(n+1,0);
// int a=x-1;
// int b=x;
// for(int i=n;i>=1;i--)
// {
// auto [pa,pb,g]=m[i][{a,b}];
// res[i]=g;
// tie(a,b)={pa,pb};
// }
// for(int i=1;i<=n;i++) cout << res[i] << (i<n?" ":"");
// }
// else cout << "IMPOSSIBLE";
// cout << "\"" << endl;
// }
return 0;
}