#include <assert.h>

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <vector>

#define SUBMIT

#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
					  << " " << __FILE__ << endl;

using namespace std;

const int64_t CYCLES_PER_SEC = 3000000000;
struct Timer {
	int64_t start;
	Timer() { reset(); }
	void reset() { start = getCycle(); }
	void plus(double a) { start -= (a * CYCLES_PER_SEC); }
	inline double get() { return (double)(getCycle() - start) / CYCLES_PER_SEC; }
	inline int64_t getCycle() {
		uint32_t low, high;
		__asm__ volatile("rdtsc"
						 : "=a"(low), "=d"(high));
		return ((int64_t)low) | ((int64_t)high << 32);
	}
};
class XorShift {
   public:
	unsigned int x, y, z, w;
	double nL[65536];

	XorShift() {
		init();
	}

	void init() {
		x = 314159265;
		y = 358979323;
		z = 846264338;
		w = 327950288;
		double n = 1 / (double)(2 * 65536);
		for (int i = 0; i < 65536; i++) {
			nL[i] = log(((double)i / 65536) + n);
		}
	}

	inline unsigned int next() {
		unsigned int t = x ^ x << 11;
		x = y;
		y = z;
		z = w;
		return w = w ^ w >> 19 ^ t ^ t >> 8;
	}

	inline double nextLog() {
		return nL[next() & 0xFFFF];
	}

	inline int nextInt(int m) {
		return (int)(next() % m);
	}

	int nextInt(int min, int max) {
		return min + nextInt(max - min + 1);
	}

	inline double nextDouble() {
		return (double)next() / ((long long)1 << 32);
	}
};
XorShift rnd;
struct FastSet {
	vector<int> list;
	vector<int> pos;
	void init(int N) {
		pos.resize(N, -1);
		list.reserve(N);
	}
	void insert_all() {
		list.clear();
		list.resize(pos.size());
		for (int i = 0; i < list.size(); i++) {
			pos[i] = list[i] = i;
		}
	}
	void insert(int a) {
		if (pos[a] == -1) {
			pos[a] = list.size();
			list.push_back(a);
		}
	}
	void erase(int a) {
		if (pos[a] >= 0) {
			swap(list[pos[a]], list.back());
			pos[list[pos[a]]] = pos[a];
			pos[a] = -1;
			list.pop_back();
		}
	}
	void flip(int a) {
		if (pos[a] == -1) {
			pos[a] = list.size();
			list.push_back(a);
		} else {
			swap(list[pos[a]], list.back());
			pos[list[pos[a]]] = pos[a];
			pos[a] = -1;
			list.pop_back();
		}
	}
	inline int size() {
		return list.size();
	}
	inline int rand() {
		return list[rnd.nextInt(list.size())];
	}
	inline void erase_all() {
		for (int i : list) {
			pos[i] = -1;
		}
		list.clear();
	}
};
struct FastSet2 {
	vector<int> list;
	vector<int> pos;
	int sz;
	void init(int N) {
		sz = 0;
		pos.resize(N);
		list.resize(N);
		for (int i = 0; i < N; i++) {
			pos[i] = list[i] = i;
		}
	}
	void insert_all() {
		sz = list.size();
	}
	int getAny() {
		return list[sz++];
	}
	void insert(int a) {
		if (pos[a] >= sz) {
			pos[list[sz]] = pos[a];
			swap(list[pos[a]], list[sz]);
			pos[a] = sz;
			sz++;
		}
	}
	void erase(int a) {
		if (pos[a] < sz) {
			sz--;
			pos[list[sz]] = pos[a];
			swap(list[pos[a]], list[sz]);
			pos[a] = sz;
		}
	}
	inline int size() {
		return sz;
	}
	inline int rand() {
		return list[rnd.nextInt(sz)];
	}
	inline void erase_all() {
		sz = 0;
	}
};

const int N = 26;
const int D = 365;
int C[N];
int S[N][D + 1];
int res[D + 1];
int A[N][D + 1];

struct Solver {
	Timer timer;

	void init() {
		for (int i = 1; i <= D; i++) {
			res[i] = i % N;
		}
	}

	int calcScore() {
		int score = 0;
		for (int i = 0; i < N; i++) {
			for (int j = 0; j <= D; j++) {
				A[i][j] = -1;
			}
		}
		for (int i = 1; i <= D; i++) {
			A[res[i]][i] = 0;
			score += S[res[i]][i];
		}
		for (int i = 0; i < N; i++) {
			A[i][0] = 0;
		}
		for (int i = 0; i < N; i++) {
			for (int j = 1; j <= D; j++) {
				if (A[i][j] == -1) {
					A[i][j] = A[i][j - 1] + 1;
				}
				score -= A[i][j] * C[i];
			}
		}
		return score;
	}

	void SA(double timelimit) {
		double st = timer.get();
		double ti = st;

		double dd = st;
		double interval = (timelimit - st) / 10;
		double T0 = 7000;
		double T1 = 50;
		//double T0 = 10000;
		//double T1 = 5000;

		double T = T0;
		int score = calcScore();
		int bestscore = score;
		int cnt = 0;
		int best[D + 1];
		for (int i = 1; i <= D; i++) {
			best[i] = res[i];
		}

		double TT0;
		double nm = 1.0 / (timelimit - st);
		while (true) {
			ti = timer.get();
			if (ti > timelimit) break;
			if ((cnt & 0xFFFF) == 0) {
				double rem = (timelimit - ti) * nm;

				T = (T0 - T1) * rem + T1;

				if (ti > dd) {
					dd += interval;
					cerr << T << " " << score << " " << bestscore << endl;
				}
			}
			cnt++;
			int a = rnd.nextInt(D) + 1;
			int b = rnd.nextInt(N - 1);
			if (b >= res[a]) b++;

			//res[a] = b;
			int x = res[a];
			int d = A[x][a - 1] + 1;
			int diff = 0;
			int c = 1;
			for (int i = a + 1; i <= D; i++) {
				if (A[x][i] == 0) break;
				c++;
			}
			diff -= C[x] * c * d;

			d = A[b][a];
			c = 1;
			for (int i = a + 1; i <= D; i++) {
				if (A[b][i] == 0) break;
				c++;
			}
			diff += C[b] * c * d;

			diff -= S[x][a];
			diff += S[b][a];

			if (diff > T * rnd.nextLog()) {
				//if (diff > -T * rnd.nextDouble()) {
				res[a] = b;
				score += diff;
				if (bestscore < score) {
					bestscore = score;
					for (int i = 1; i <= D; i++) {
						best[i] = res[i];
					}
				}

				A[x][a] = c = A[x][a - 1] + 1;
				for (int i = a + 1; i <= D; i++) {
					if (A[x][i] == 0) break;
					A[x][i] = ++c;
				}

				A[b][a] = c = 0;
				for (int i = a + 1; i <= D; i++) {
					if (A[b][i] == 0) break;
					A[b][i] = ++c;
				}
			}
		}
		dump(cnt);
		for (int i = 1; i <= D; i++) {
			res[i] = best[i];
		}
#ifndef SUBMIT
		score = bestscore;
		cerr << score << endl;
		score = calcScore();
		cerr << score << endl;
		cerr << (score + 1000000) * 50 << endl;
#endif
	}

	int
	solve() {
		init();
#ifdef SUBMIT
		double tl = 1.95;
#else
		double tl = 1.5;
#endif
		SA(1.5);
		return 0;
	}

	void input() {
		cin.tie(0);
		ios::sync_with_stdio(false);
		int _;
		cin >> _;
		for (int i = 0; i < N; i++) {
			cin >> C[i];
		}
		for (int j = 1; j <= D; j++) {
			for (int i = 0; i < N; i++) {
				cin >> S[i][j];
			}
		}
	}
	void generate() {
		for (int i = 0; i < 20000; i++) {
			rnd.next();
		}
		for (int i = 0; i < N; i++) {
			C[i] = rnd.nextInt(101);
		}
		for (int j = 1; j <= D; j++) {
			for (int i = 0; i < N; i++) {
				S[i][j] = rnd.nextInt(20001);
			}
		}
	}

	void output() {
		for (int i = 1; i <= D; i++) {
			cout << res[i] + 1 << endl;
		}
	}
};

Solver solver;
int main(int argc, char *argv[]) {
#ifdef SUBMIT
	solver.input();
#else
	solver.generate();
#endif
	solver.solve();
#ifdef SUBMIT
	solver.output();
#endif
	cerr << "timer = " << solver.timer.get() << endl;
	return 0;
}

Measured memory_bytes: 4772