#include<bits/stdc++.h>
using namespace std;

/*==============変数宣言==============*/
int N;
const int M = 26;
int n;
int m = M;
const int def = 1000000;

int c[30];
int s[400][30];

void input(){
	scanf("%d", &N);
	n = N;

	for(int i = 0;i < M;i++) scanf("%d", &c[i]);

	for(int i = 0;i < N;i++)
		for(int j = 0;j < M;j++)
			scanf("%d", &s[i][j]);
	
	return;
}

/*================関数================*/
struct RandomNumberGenerator {
  mt19937 mt;

  RandomNumberGenerator() : mt(chrono::steady_clock::now().time_since_epoch().count()) {}

  int operator()(int a, int b) { // [a, b)
    uniform_int_distribution< int > dist(a, b - 1);
    return dist(mt);
  }

  int operator()(int b) { // [0, b)
    return (*this)(0, b);
  }
};

struct Timer {
  chrono::high_resolution_clock::time_point st;

  Timer() { reset(); }

  void reset() {
    st = chrono::high_resolution_clock::now();
  }

  chrono::milliseconds::rep get() {
    auto ed = chrono::high_resolution_clock::now();
    return chrono::duration_cast< chrono::milliseconds >(ed - st).count();
  }
};

Timer timer;
RandomNumberGenerator rnd;
/*====================================*/



void init(){
	input();
	return;
}


void output(short ans[]){
	for(int i = 0;i < n;i++){
		printf("%d\n", ans[i]+1);
	}
}

int sum(int i){
	return (i*(i+1))/2;
}

int getScore(short a[]){
	int last[30] = {};
	int ans = 0;
	for(int i = 0;i < n;i++){
		ans += s[i][a[i]]; 
		ans -= c[a[i]] * sum(i-last[a[i]]);
		last[a[i]] = i+1;
	}
	for(int j = 0;j < m;j++){
		ans -= c[j] * sum(n-last[j]);
	}
	return ans;
}

int main(){
	init();

	short now[365];
	short ans[365]; 

	for(int i = 0;i < n;i++){
		ans[i] = now[i] = i%26; 
	}

	int ans_score = getScore(ans);

	int fin = 1900;
	const double C = fin*500.0;

	int now_time = 0;
	int AS = ans_score;
	short ANS[365];

	while((now_time = timer.get()) < fin){
		if(rnd(10) < 4){
			int idx = rnd(365);
			int old = now[idx];
			int nxt = rnd(26);
			if(now[idx] == nxt) continue;
			now[idx] = nxt;
			int now_score = getScore(now);

			double r = rnd(100000)/100000.0;

			double line = (fin-now_time)/C; 

			if(ans_score <= now_score || line > r){
				ans[idx] = nxt;
				ans_score = now_score;
				if(AS < ans_score){
					memcpy(ANS, ans, sizeof(ans));
					AS = ans_score;
					//cerr << "A " << AS << endl;
				}
			}else{
				now[idx] = old; 
			}
		}else{

			int idx = rnd(364);
			int idx2 = min(364, idx+rnd(20));
			swap(now[idx], now[idx2]);
			int now_score = getScore(now);

			double r = rnd(100000)/100000.0;

			double line = (fin-now_time)/C; 

			if(ans_score <= now_score || line > r){
				swap(ans[idx], ans[idx2]);
				ans_score = now_score;
				if(AS < ans_score){
					memcpy(ANS, ans, sizeof(ans));
					AS = ans_score;
					//cerr << "B " << AS << endl;
				}
			}else{
				swap(now[idx], now[idx2]);
			}
		}
	}


	memcpy(now, ANS, sizeof(ANS));

	int idx = 0; 
	int nxt = 0;
	fin = 1990;
	while((now_time = timer.get()) < fin){
		int old = now[idx];
		now[idx] = nxt;
		int now_score = getScore(now);

		if(AS < now_score){
			ANS[idx] = nxt;
			AS = now_score;
			//cerr << " " << AS << endl;
		}else{
			now[idx] = old; 
		}
		nxt++;
		if(nxt == m){
			nxt = 0;
			idx++;
			if(idx == n) idx = 0;
		}
	}
	output(ANS);

	return 0;
}


Measured memory_bytes: 3864