#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<list>
#include<bitset>
#include<stack>
#include<memory>
#include<numeric>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define REP(i, n) for(int i = 0;i < (n);i++)
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const int mod=998244353 ;
const llint inf=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-10;
template <class T,class U>bool chmin(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool chmax(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class U,class T>llint LBI(const U&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class U,class T>llint UBI(const U&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
inline double getTime() {
    using namespace std::chrono;
    return duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
}
double starttime;
inline double myTime(){return getTime()-starttime;}//ミリ秒単位

int main(void){
	//焼きなましすればよさそう
	//近傍 1日のコンテスト変更
	// 2日のコンテストswap
	
	mt19937 engine(1333);
	
	std::uniform_real_distribution<> dist(0.0, 1.0);
	
	
	int D,i,j,k;cin>>D;
	int C[26]={};
	for(i=0;i<26;i++){cin>>C[i];}
	int S[26][367]={};
	for(j=1;j<=D;j++){
		for(i=0;i<26;i++){cin>>S[i][j];}
	}
	starttime=getTime();
	int syu[367]={};//なんのコンテスト
	for(i=1;i<=D;i++){syu[i]=i%26;}
	//L,Rの更新を行う
	int R[26][367]={};//次のコンテストはいつ
	int L[26][367]={};//次のコンテストはいつ
	for(i=0;i<26;i++){
		for(j=0;j<367;j++){R[i][j]=D+1;}}
	double ondo=7000;
	cerr<<"de"<<endl;
	int mae[26]={};
	int score=0;
	for(i=1;i<=D;i++){
		for(j=0;j<26;j++){L[j][i]=mae[j];}
		int a=syu[i];
		score+=S[a][i];
		score-=(i-mae[a])*(i-mae[a]-1)/2*C[a];
		//cerr<<score<<endl;
		mae[a]=i;
	}
	for(j=0;j<26;j++){
		L[j][D+1]=mae[j];
		score-=(D+1-mae[j])*(D+1-mae[j]-1)/2*C[j];
		mae[j]=D+1;
	}
	for(i=D;i>=0;i--){
		for(j=0;j<26;j++){R[j][i]=mae[j];}
		mae[syu[i]]=i;
	}
	
	cerr<<score<<endl;
	int mita=0;
	int aaa=1,bbb=0;
	for(llint kai=0;kai<1e12;kai++){
		if((kai&16383)==0){
			double zikan=myTime();
			if(zikan>1930){break;}
			ondo=(1-zikan/1930.0)*7000;
			if(zikan/70>=mita+1){
				mita=zikan/70;
				cerr<<"score="<<score<<endl;
				cerr<<"per="<<bbb*1.0/aaa<<endl;
				cerr<<"kai="<<kai<<endl;
				aaa=1;bbb=0;
			}
		}
		
		
		
		aaa++;
		if(engine()%4==0){
			//1点更新
			int x=1+engine()%D;
			int a=syu[x];
			int b=engine()%26;
			if(a==b){continue;}
			int sco=S[b][x]-S[a][x]+(x-L[b][x])*(R[b][x]-x)*C[b]-(x-L[a][x])*(R[a][x]-x)*C[a];
			if(sco>log(dist(engine))*ondo){
				//更新される
				
				int z=x;
				
				for(z=x;z>0&&syu[z]!=b;z--){R[b][z-1]=x;}
				for(z=x;z<=D&&syu[z]!=b;z++){L[b][z+1]=x;}
				syu[x]=b;
				for(z=x;z>0&&syu[z]!=a;z--){R[a][z-1]=R[a][x];}
				for(z=x;z<=D&&syu[z]!=a;z++){L[a][z+1]=L[a][x];}
				
				score+=sco;
				bbb++;
			}
		}else{
			//2点更新
			int eee=engine()%(D*11);
			int x=1+eee%D;
			int y=x+eee%11-5;
			if(y<=0||y>D){continue;}
			int a=syu[x];
			int b=syu[y];
			if(a==b){continue;}
			if(x>y){swap(x,y);swap(a,b);}
			if(R[a][x]<y||L[a][x]>y){continue;}
			if(R[b][y]<x||L[b][y]>x){continue;}
			//ax,by  -> ay,bx
			int sco=S[b][x]+S[a][y]-S[a][x]-S[b][y]
				+(x-L[b][y])*(R[b][y]-x)*C[b]-(x-L[a][x])*(R[a][x]-x)*C[a]
				-(y-L[b][y])*(R[b][y]-y)*C[b]+(y-L[a][x])*(R[a][x]-y)*C[a];
			if(sco>log(dist(engine))*ondo){
				
				int La=L[a][x],Lb=L[b][y],Ra=R[a][x],Rb=R[b][y];
				int z;
				for(z=La+1;z<y;z++){L[a][z]=La;R[a][z]=y;}
				for(z=y+1;z<Ra;z++){L[a][z]=y;R[a][z]=Ra;}
				R[a][La]=y;L[a][y]=La;R[a][y]=Ra;L[a][Ra]=y;
				for(z=Lb+1;z<x;z++){L[b][z]=Lb;R[b][z]=x;}
				for(z=x+1;z<Rb;z++){L[b][z]=x;R[b][z]=Rb;}
				R[b][Lb]=x;L[b][x]=Lb;R[b][x]=Rb;L[b][Rb]=x;
				syu[x]=b;syu[y]=a;
				score+=sco;
				bbb++;
			}
			
		}
		
	}
	
	cerr<<"score="<<score<<endl;
	for(i=1;i<=D;i++){cout<<syu[i]+1<<endl;}
	return 0;
	
}


Measured memory_bytes: 3728