#pragma GCC optimize("Ofast")

#include <vector>
#include <iostream>
#include <utility>
#include <cmath>
#include <set>
#include <algorithm>
#include <queue>
#include <string>
#include <utility>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define int ll
#define fi first
#define se second
#define Sort(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; ++i) 
#define REP(i,n) for(int i = 0;i < (n) ; ++i) 
#define MP(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define INF LLONG_MAX/4
#define INTINF INT_MAX/2
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl
#define debug_vec(v) cerr<<#v<<":";rep(i,v.size())cerr<<" "<<v[i];cerr<<endl
template<class T> inline bool chmax(T &a, T b){if(a < b){a = b;return true;}return false;}
template<class T> inline bool chmin(T &a, T b){if(a > b){a = b;return true;}return false;}
/*----------------------------------------------------------------*/
inline unsigned long long xor128() {
	static unsigned long long rx = 123456789, ry = 986960440, rz = 738905609, rw = 23140692;
	unsigned long long rt = (rx ^ (rx << 11));
	rx = ry;ry = rz;rz = rw;
	return (rw = (rw ^ (rw >> 19)) ^ (rt ^ (rt >> 8)));
}
inline float rand128(float min = 0, float max = 1){
	return (float)(xor128() % 0xFFFF) / 0xFFFF * (max - min) + min;
}

inline uint64_t rdtsc(){
	uint32_t hi,lo;
	__asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
	return ((uint64_t)lo) | (((uint64_t)hi)<<32);
}
inline double GetSeconds() {
	// return rdtsc()/2.8e9; //Topcoder
	return rdtsc()/3.0e9; // Atcoder
}
double start_time;
const double TL = 1.95;
/*----------------------------------------------------------------*/

const int D = 365;
int c[26] = {};
int s[365][26] = {};

int best_t[365] = {};

int t[365] = {};
// int last_d[26] = {};
int best_score,score;

/*----------------------------------------------------------------*/

void input(){
	int xxx;cin >> xxx;
	rep(i,26)cin >> c[i];
	rep(i,D)rep(j,26) cin >> s[i][j];
}
void output(){
	rep(i,D)cout << best_t[i]+1 << endl;
}


int calc_all(){
	int res = 0;
	int last_d[26] = {};
	rep(d,D)res += s[d][t[d]];
	for(int d = 1; d <= D;d++){
		last_d[t[d-1]] = d;
		rep(j,26){
			res -= c[j]*(d - last_d[j]);
		}
	}
	return res;
}

int calc_sub(int nd,int nc,int pc){
	int res = score;
	res -= s[nd][pc];
	res += s[nd][nc];
	int last_d = 0;
	for(int d = 1; d <= D;d++){
		if(t[d-1] == nc)last_d = d;
		res += c[nc]*(d - last_d);
	}
	last_d = 0;
	for(int d = 1; d <= D;d++){
		if(t[d-1] == pc)last_d = d;
		res += c[pc]*(d - last_d);
	}
	last_d = 0;
	t[nd] = nc;
	for(int d = 1; d <= D;d++){
		if(t[d-1] == nc)last_d = d;
		res -= c[nc]*(d - last_d);
	}
	last_d = 0;
	for(int d = 1; d <= D;d++){
		if(t[d-1] == pc)last_d = d;
		res -= c[pc]*(d - last_d);
	}
	last_d = 0;
	t[nd] = pc;
	return res;
}

int cnt = 0;
void solve(){
	// rep(i,D)t[i] = best_t[i] = xor128()%26;
	// rep(i,D)t[i] = best_t[i] = xor128()%26;
	best_score = score = calc_all();
	cerr << "init s : " << score << endl;

	float saTimeStart    = GetSeconds() - start_time; 
  	float saTimeEnd      = TL;// Time Limit (ms)
	float Time = saTimeEnd-saTimeStart;// SAに使う時間
	float elapsed = GetSeconds() - start_time;

	while(1){
		elapsed = GetSeconds() - start_time;
		if(elapsed > TL)break;
		float time = elapsed-saTimeStart; 
		cnt++;

		int nd = xor128()%D;
		int nc = xor128()%26;
		int pc = t[nd];
		if(pc == nc)continue;
		int next_score = calc_sub(nd,nc,pc);

		t[nd] = nc;

		int diff = next_score - score;

		if(next_score >= best_score){
			rep(d,D)best_t[d] = t[d];
			best_score = next_score; 
		}

		float deadline = 4100;
		float p = rand128(0,1)*deadline*Time;
		float seni = (Time-time)*(diff+deadline);

		if(diff >= 0 || seni > p){
			score = next_score;
		}else{	
			t[nd] = pc;
		}
	}

}
void solve2(){
	// 貪欲
	int score_d = 0;
	int last_d[26] = {};
	for(int d = 1;d <= D;d++){
		int score_max = -100000000;
		int max_c = 0;
		rep(i,26){
			int sd = s[d-1][i];
			rep(j,26){
				if(j != i)sd -= c[j]*(d - last_d[j]);
			}
			if(chmax(score_max,sd))max_c = i;
		}
		t[d-1] = max_c;
		last_d[max_c] = d;
	}
	rep(i,D)best_t[i] = t[i];
}

/*----------------------------------------------------------------*/
signed main(){
	start_time = GetSeconds();

	input();
	solve2();
	// cerr << calc() << endl;
	solve();
	output();

	cerr << "score : " << best_score << endl;
	cerr << "cnt : " << cnt << endl;

	return 0;
}

/*----------------------------------------------------------------*/


Measured memory_bytes: 3720