#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;

#define N 26
#define MAX_T 1.9
#define TRIAL 5
#define K 10

const long INF = 1L << 60;

int c[N];
int s[365][N];
int last[N];

std::chrono::time_point<std::chrono::steady_clock> start, endt;

random_device rd;
mt19937 generator(rd());
uniform_real_distribution<> dist_real(0.0, 1.0);
uniform_int_distribution<> dist_int(0, RAND_MAX);
uniform_int_distribution<> dist_int_k(0, K);

struct ContestInfo {
	int D;
	long score;
	long best_score;
	vector<int> t;
	vector<int> best_t;
	set<int> held[N];
	ContestInfo(int dd) : D(dd), score(0) {
		t.resize(D, -1);
		for (int i = 0; i < N; i++) {
			held[i].insert(-1);
			held[i].insert(D);
			score -= c[i] * D * (D + 1) / 2;
		}
	}

	void add(int dd, int qq) {
		if (t[dd] != -1) {
			cout << "Add faild!" << endl;
			exit(1);
		}

		t[dd] = qq;
		score += s[dd][qq];
		held[qq].insert(dd);
		auto itr = held[qq].find(dd);
		auto ritr = next(itr);
		auto litr = prev(itr);
		auto range = [](int l, int r) {
			int k = r - l - 1;
			return -k * (k + 1) / 2;
		};
		score -= c[qq] * range(*litr, *ritr);
		score += c[qq] * (range(*litr, *itr) + range(*itr, *ritr));
	}

	void erase(int dd) {
		if (t[dd] == -1) {
			cout << "Erase faild!" << endl;
			exit(1);
		}
		int qq = t[dd];
		t[dd] = -1;
		score -= s[dd][qq];
		auto itr = held[qq].find(dd);
		auto ritr = next(itr);
		auto litr = prev(itr);
		auto range = [](int l, int r) {
			int k = r - l - 1;
			return -k * (k + 1) / 2;
		};
		score += c[qq] * range(*litr, *ritr);
		score -= c[qq] * (range(*litr, *itr) + range(*itr, *ritr));
		held[qq].erase(itr);
	}

	void change(int dd, int qq) {
		erase(dd);
		add(dd, qq);
	}

	void swap(int d1, int q1, int d2, int q2) {
		change(d1, q2);
		change(d2, q1);
	}

	long calc_score(int dd) {
		long ret = 0;
		fill(last, last + N, -1);
		for (int i = 0; i <= dd; i++) {
			ret += s[i][t[i]];
			last[t[i]] = i;
			for (int j = 0; j < N; j++) {
				ret -= c[j] * (i - last[j]);
			}
		}
		return ret;
	}

	long evaluate(int dd, int k = K) {
		long ret = calc_score(dd);
		for (int i = dd; i < min(D, dd + k); i++) {
			for (int j = 0; j < N; j++) {
				ret -= c[j] * (i - last[j]);
			}
		}
		return ret;
	}

	void save() {
		best_t = t;
		best_score = score;
	}

	void output(bool show = false) {
		for (int i = 0; i < D; i++)
			cout << best_t[i] + 1 << endl;
		if (show) cout << best_score << endl;
	}
};

double dice() {
	return dist_real(generator);
}

double prob(double rem) {
	return 1.0 - 1e-3;
	// return 1.0 / exp(rem);
	// return 1.0 / pow(8, rem);
	// return dist_real(generator);
}

void tic() {
	start = std::chrono::steady_clock::now();
}

double toc() {
	endt = std::chrono::steady_clock::now();
	std::chrono::duration<double> elapsed_seconds = endt - start;
	return elapsed_seconds.count();
}

int main() {
	int d;
	cin >> d;
	for (int i = 0; i < N; i++)
		cin >> c[i];
	for (int i = 0; i < d; i++) {
		for (int j = 0; j < N; j++) {
			cin >> s[i][j];
		}
	}

	tic();
	int best_k = 0;
	long best_score = -INF;
	vector<ContestInfo> cis;
	for (int k = 0; k <= N && toc() < 1.85; k++) {
		auto &ci = cis.emplace_back(d);
		for (int i = 0; i < d; i++) {
			long max_score = -INF;
			int best_q = 0;
			for (int j = 0; j < N; j++) {
				ci.add(i, j);
				long new_score = ci.evaluate(i, k);
				if (max_score < new_score) {
					max_score = new_score;
					best_q = j;
				}
				ci.erase(i);
			}
			ci.add(i, best_q);
		}
		ci.save();
		if (best_score < ci.best_score) {
			best_k = k;
			best_score = ci.best_score;
		}
		// cout << k << " : " << ci.best_score << endl;
	}
	cis[best_k].output();
	// cout << best_k << " : " << cis[best_k].best_score << endl;
	// cout << toc() << endl;
}

Measured memory_bytes: 4296