#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i = 0;i<((ll)(n));i++)
#define reg(i,a,b) for(ll i = ((ll)(a));i<=((ll)(b));i++)
#define irep(i,n) for(ll i = ((ll)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(ll i = ((ll)(b));i>=((ll)(a));i--)
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T = int> void print(vector<T> v){for(auto a:v)cout<<a<<" ";cout<<endl;}

struct Xor128{
	unsigned x,y,z,w;
	Xor128():x(123456789),y(362436069),z(521288629),w(88675123){};
	inline unsigned xor128(){
		unsigned t;
		t = x^(x<<11);
		x = y;
		y = z;
		z = w;
		return w = (w^(w>>19))^(t^(t>>8));
	}
	int randInt(int x,int y){//[x,y)
		return xor128()%(y-x)+x;
	}
	double randDouble(double a,double b){//[a,b)
		return (double)(xor128()&0xffff)/0xffff*(b-a)+a;
	}
};
auto rnd=Xor128();

/*
むずくね？
*/

int n=26,d,c[26],s[365][26];
int last[365][26],ilast[365][26];
double score_best,score_cur=0;
int cur[365],best[365];

double evaluation(int ne,int nv){
	ll bv = cur[ne];
	double dif = s[ne][nv] - s[ne][bv];
	ll be = -1;
	if(ne>0)be = last[ne-1][bv];
	reg(i,ne,d-1){  // 追加点
		if(last[i][nv]==i)break;
		dif -= c[nv] * ( (i-ne) - (i - last[i][nv]) );
	}
	reg(i,ne,d-1){  // 削除点
		if(i>ne && last[i][bv]==i)break;
		dif -= c[bv] * ( (i-be) - (i - last[i][bv]) );
	}
	return dif;
}

void annealing(double TLIMIT=1950, double startTemp=10.5, double endTemp=0){
	auto start = chrono::system_clock::now();
	double now_time=0;
	int itr=0;
	//init
	rep(i,d)best[i]=cur[i];
	score_best=score_cur;
	//本体
	while(now_time<=TLIMIT){
		auto end = chrono::system_clock::now();
		now_time = chrono::duration_cast<chrono::milliseconds>(end-start).count();
		// 変える箇所
		int next_pos = rnd.randInt(0,d);
		int next_val = rnd.randInt(0,n);
		while(next_val==cur[next_pos])next_val = rnd.randInt(0,n);  // 同じなら意味がないので
		// int before_val = cur[next_pos];
		double score_next = score_cur + evaluation(next_pos,next_val);
		double temp        = startTemp+(endTemp-startTemp)*now_time/TLIMIT;
		double probability = exp((score_cur-score_next)/temp);
		if(probability < rnd.randDouble(0,1)){
			// 状態遷移実行
			score_cur=score_next;
			last[next_pos][next_val] = next_pos;
			last[next_pos][cur[next_pos]] = (next_pos>0 ? last[next_pos-1][cur[next_pos]] : -1);
			reg(i,next_pos+1,d-1){  // 追加点
				if(last[i][next_val]==i)break;
				last[i][next_val] = last[i-1][next_val];
			}
			reg(i,next_pos+1,d-1){  // 削除点
				if(last[i][cur[next_pos]]==i)break;
				last[i][cur[next_pos]] = last[i-1][cur[next_pos]];
			}
			cur[next_pos] = next_val;
		}else{
			// もどす
		}
		if(score_best < score_cur){  //最高記録は保存
			//状態をコピー
			rep(i,d)best[i]=cur[i];
			score_best=score_cur;
			// cerr<<"【更新】 "<<itr<<": "<<score_best<<endl;
		}
		itr++;
	}
}
 
int main(void){
	cin>>d;
	rep(i,n)cin>>c[i];
	rep(i,d)rep(j,n)cin>>s[i][j];
	// 色々初期化
	rep(i,d)cur[i] = i%26;
	rep(j,n)last[0][j] = -1;
	last[0][cur[0]]=0;
	reg(i,1,d-1){
		rep(j,n)last[i][j] = last[i-1][j];
		last[i][cur[i]] = i;
	}
	rep(i,d){
		score_cur += s[i][cur[i]];
		rep(j,n)score_cur -= c[j]*(i-last[i][j]);
	}
	// アニーリング
	annealing(1950, 1050, 0);
	cerr<<"【最高点】 "<<": "<<score_best<<endl;
	rep(i,d)cout<<best[i]+1<<endl;
	return 0;
}

Measured memory_bytes: 4512