#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

inline uint32_t xorshift128() {
	static uint32_t x = 192479812u;
	static uint32_t y = 784892731u;
	static uint32_t z = 427398108u;
	static uint32_t w = 48382934u;
	const uint32_t t = x ^ (x << 11);
	x = y;
	y = z;
	z = w;
	w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
	return w;
}
inline uint32_t modulus_random(uint32_t mod) {
	const auto t = static_cast<uint64_t>(xorshift128()) * mod;
	return static_cast<uint32_t>(t >> 32);
}

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int D; cin >> D;
	int T = 26;
	vector<int>c(T); rep(i, 0, T) { cin >> c[i]; }

	vector<vector<int>>s(D, vector<int>(T));
	rep(i, 0, D)rep(j, 0, T) { cin >> s[i][j]; }

	vector<int>t(D);
	vector<pii>v;
	rep(i, 0, T) {
		v.eb(c[i], i);
	}
	sort(all(v));
	rep(i, 0, D) {
		t[i] = v[i % 26].second;
	}
	int score = 0;
	{
		vector<int>last(T);
		rep(i, 0, D) {
			score += s[i][t[i]];
			last[t[i]] = i + 1;
			rep(j, 0, T) {
				score -= c[j] * (i + 1 - last[j]);
			}
		}
	}
	int S = 0;
	rep(i, 0, D) {
		S += s[i][t[i]];
	}
	set<int>hoge;
	hoge.insert(D + 1);
	hoge.insert(0);
	vector<set<int>>schedule(T, hoge);
	rep(i, 0, D) {
		schedule[t[i]].insert(i + 1);
	}
	int C = 0;
	rep(i, 0, T) {
		int p = 0;
		int x = 0;
		for (auto d : schedule[i]) {
			int w = d - p - 1;
			x += (w + 1)*w / 2;
			p = d;
		}
		C += c[i] * x;
	}
	assert(S - C == score);
	auto f = [](int w) {return (w + 1)*w / 2; };
	int M = 1000;
	vector<int>d(M), q(M); rep(i, 0, M) { d[i] = modulus_random(D); q[i] = modulus_random(T); }
	rep(i, 0, M) {
		auto ans = t;
		auto bbb = schedule;
		int aaa = S - C;

		S -= s[d[i]][t[d[i]]];
		S += s[d[i]][q[i]];
		t[d[i]]; // -> q[i]
		// schedule[t[d[i]]] has d[i]
		{
			auto itr = schedule[t[d[i]]].find(d[i] + 1);
			auto p = prev(itr);
			auto n = next(itr);
			int w1 = (*n) - (*itr) - 1;
			int w2 = (*itr) - (*p) - 1;
			int w3 = (*n) - (*p) - 1;
			C -= (f(w1) + f(w2))*c[t[d[i]]];
			C += f(w3)*c[t[d[i]]];
			schedule[t[d[i]]].erase(itr);
		}
		{
			t[d[i]] = q[i];
			schedule[q[i]].insert(d[i] + 1);
			auto itr = schedule[q[i]].find(d[i] + 1);
			auto p = prev(itr);
			auto n = next(itr);
			int w1 = (*n) - (*itr) - 1;
			int w2 = (*itr) - (*p) - 1;
			int w3 = (*n) - (*p) - 1;
			C -= f(w3)*c[q[i]];
			C += (f(w1) + f(w2))*c[q[i]];
		}
		if (S - C > aaa) {
			swap(t, ans);
			swap(schedule, bbb);
		}
	}
	for (auto x : t) {
		cout << x + 1 << endl;
	}



	return 0;
}


Measured memory_bytes: 3804