#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
#include <numeric>
#include <time.h>
#include <chrono>
#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define REP(i,a,b) for(ll i=a;i>b;i--)
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定
#define ct(a) cout<<a<<endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define repl(i,l,r) for(int i=(1);i<(r);i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
static const double pi = 3.141592653589793;
using namespace std;
typedef long long ll;
const ll MOD = 998244353;
const ll INF = 1e9 + 7;
const ll mod = 1e9 + 7;

using namespace std::chrono;
inline ll get_time_millisec(void) {
	return static_cast<ll>(duration_cast<milliseconds>(steady_clock::now().time_since_epoch()).count());
}

unsigned long xor128() {
	static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	unsigned long t = (x ^ (x << 11));
	x = y;
	y = z;
	z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

inline int getRange(int l, int r) {
	return xor128() % (r + 1 - l) + l;
}


class Solver {

private:
	//要素
	ll D;
	ll C[26];
	pair<ll,ll> c[26][365];//以降でこの種類のコンテストが開催される次期（無い時は364）
	ll S[365][26];
	ll date[365];
	ll nowscore;

	pair<int,int> change;
	
	pair<int, int> maxC;

public:

	


	void inputtest() {
		D = 365;
		FOR(i, 0, 26) {
			C[i] = getRange(0, 100);
			
		}
		FOR(i, 0, 26)FOR(j, 0, D) {
			c[i][j].first = -1;
			c[i][j].second = D-1;
		}

		FOR(i, 0, D) {
			FOR(j, 0, 26) {
				S[i][j] = getRange(0, 20000);

			}
			date[i] = xor128() % 26;


			//前回と次回のコンテスト日程を確定させていく
			for (int d = i+1; d<D; d++) {
				c[date[i]][d].first = i;
			}
			for (int d = i - 1;d>=0&& c[date[i]][d].second == D-1; d--) {
				c[date[i]][d].second = i;
			}
			
			
			
		}
	}
	void input() {
		cin >> D;
		FOR(i, 0, 26) {
			cin >> C[i];

		}
		FOR(i, 0, 26)FOR(j, 0, D) {
			c[i][j].first = -1;
			c[i][j].second = D - 1;
		}

		FOR(i, 0, D) {
			FOR(j, 0, 26) {
				cin >> S[i][j];

			}
			date[i] = xor128() % 26;


			//前回と次回のコンテスト日程を確定させていく
			for (int d = i + 1; d < D; d++) {
				c[date[i]][d].first = i;
			}
			for (int d = i - 1; d >= 0 && c[date[i]][d].second == D - 1; d--) {
				c[date[i]][d].second = i;
			}



		}
	}

	ll calcScore() {
		ll score = 0;
		ll last[365];
		FOR(i, 0, 26)last[i] = -1;


		FOR(i, 0, D) {
			score += S[i][date[i]];
			last[date[i]] = i;

			FOR(j, 0, 26) {
				ll hiku = C[j] * (i - last[j]);

				score -= hiku;
			}
		}
		nowscore = score;
		return score;
	}
	ll calcScore2() {
		ll T = change.first;
		ll K = change.second;
		ll update = S[T][date[T]] - S[T][K];
		update -= C[K] * (c[K][T].second - T+1)*(T - c[K][T].first);

		K = date[T];
		update += C[K] * (c[K][T].second - T+1)*(T - c[K][T].first);

		//cout <<" "<< update << endl;
		nowscore = nowscore + update;
		return nowscore;
	}


	void init() {



	}
	void rndchange() {
		ll t = xor128() % D;
		//changeは変更される前のその日の情報を記録
		change.first = t;
		change.second = date[t];

		date[t] = xor128() % 26;

		
		for (int i = t - 1;i>=0&& c[change.second][i].second == i; i--) {
			c[change.second][i].second = c[change.second][t].second;
		}
		for (int i = t + 1;i<D&& c[date[t]][i].first == i; i++) {
			c[date[t]][i].first = c[date[t]][t].first;
		}
		

	}

	void output() {
		FOR(i, 0, D) {
			cout << date[i] + 1 << endl;
		}
		//cout << calcScore2() << endl;
	}
};
ll cnt = 0;


Solver solve(void) {

	Solver currentSeq;

	currentSeq.input();
	currentSeq.init();


	Solver bestSeq = currentSeq;
	int bestScore = currentSeq.calcScore();
	int currentScore = bestScore;

	const ll saTimeStart = get_time_millisec();

	const ll saTimeEnd = saTimeStart+1800;//milli
	ll saTimeCurrent = saTimeStart;

	while (saTimeCurrent < saTimeEnd) {

		cnt++;

		Solver nextSeq = currentSeq;


		if(saTimeCurrent<saTimeEnd)nextSeq.rndchange();

		const int nextScore = nextSeq.calcScore2();

		const ll T = saTimeEnd - saTimeStart;
		const ll t = saTimeCurrent - saTimeStart;
		const ll R = 1000;


		//const bool FORCE_NEXT = R * (T - t) > T*((xor128()) % (R));
		const bool FORCE_NEXT = false;
		
		/*
		double startTemp = 5000;
		double endTemp = 1;
		double temp = startTemp + (endTemp - startTemp)*t / T;
		double probability = exp((nextScore - currentScore) / temp);
		const bool FORCE_NEXT = probability > (double)(xor128() % R) / (double)R;
		*/

		//const bool FORCE_NEXT = (xor128() % R) > 999;


		if (nextScore > currentScore || FORCE_NEXT) {
			/*
			cout << "!" << endl;
			cout << nextScore << endl;
			*/
			currentScore = nextScore;
			currentSeq = nextSeq;


		}


		if (currentScore > bestScore) {

			bestScore = currentScore;


			//cout << bestScore << endl;
			bestSeq = currentSeq;
		}
		saTimeCurrent = get_time_millisec();
	}

	return bestSeq;

}



int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	Solver ans = solve();
	ans.output();
	//out << cnt << endl;

	return 0;
}


Measured memory_bytes: 4340