#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <random>
#include <complex>
#include <assert.h>

using namespace std;
typedef long long ll;
#define endl '\n'

template<typename T>
inline bool chmin(T& x, T a) {
	if (x >= a) { x = a; return true; }
	return false;
}

template<typename T>
inline bool chmax(T& x, T a) {
	if (x <= a) { x = a; return true; }
	return false;
}

#define INITIAL_SAMPLE_NUM 1
#define ANNEALING_ITERATION_NUM 10000
#define ANNEALING_SEARCH_NUM 15

#define INF (1LL << 60)

unsigned int SEED() {
	random_device rd;
	return rd();
}
mt19937_64 MT(SEED());
ll rand(ll a, ll b) {// [a, b]から乱数生成
	uniform_int_distribution<ll> dis(a, b);
	return dis(MT);
}

template<typename T_score, typename T_ans> T_ans generate(double param = 0.9); // ランダムに初期値を生成する関数
template<typename T_score, typename T_ans> T_ans change(T_ans &params); // パラメータの一部を変える関数
template<typename T_score, typename T_ans> T_score calc(T_ans &params); // パラメータをもとにスコアを計算する

template<typename T_score, typename T_ans> T_score getDiffScale(int N = 20) {// 標準偏差を計算する
	T_score sum = 0;
	vector<T_score> v(N);
	for (int i = 0; i < N; i++) {
		T_ans g = generate<T_score, T_ans>();
		T_score a = calc<T_score, T_ans>(g);
		sum += a;
		v[i] = a;
	}
	sum /= N;
	for (int i = 0; i < N; i++) {
		v[i] -= sum;
	}
	T_score ans = 0;
	for (int i = 0; i < N; i++) {
		ans += v[i] * v[i];
	}
	return sqrt(ans);
}
template<typename T_score, typename T_ans> pair<T_score, T_ans> annealing(T_ans &initParams, T_score scale, int N) { // 焼きなまし法
	T_ans tempParams = initParams;
	T_score s0 = calc<T_score, T_ans>(tempParams);
	for (int iteration = N; iteration > 0; iteration--) {
		vector<T_ans> v(ANNEALING_SEARCH_NUM);
		vector<T_score> s(ANNEALING_SEARCH_NUM);
		for (int i = 0; i < ANNEALING_SEARCH_NUM; i++) {
			v[i] = change<T_score, T_ans>(tempParams);
			s[i] = calc<T_score, T_ans>(v[i]);
		}
		int k = 0;
		T_score smax = s[0];
		for (int i = 1; i < ANNEALING_SEARCH_NUM; i++) {
			if (s[i] > smax) {
				k = i; smax = s[i];
			}
		}
		if (smax > s0) {
			s0 = smax;
			tempParams = v[k];
		}
		else {
			double p = (double)(s0 - smax) / (double)scale;
			p *= (double)N / (double)iteration;
			if (p < 1) {
				p = 1 - p;
				p *= p;
				if ((double)rand(0, INF) < (double)INF * p) {
					s0 = smax;
					tempParams = v[k];
				}
			}
		}
	}
	return make_pair(s0, tempParams);
}
template<typename T_score, typename T_ans> pair<T_score, T_ans> optimize(T_ans &initParams) { // 初期パラメータを変化させて最適値に持っていく
	T_score scale = getDiffScale<T_score, T_ans>();
	return annealing<T_score, T_ans>(initParams, scale, ANNEALING_ITERATION_NUM);
}
template<typename T_score, typename T_ans>
inline pair<T_score, T_ans> argmax(int N) {// N個の初期値に対して最もスコアが高かったものを選択
	T_ans g0 = generate<T_score, T_ans>();
	pair<T_score, T_ans> p0 = optimize<T_score, T_ans>(g0);
	for (int i = 1; i < N; i++) {
		T_ans g = generate<T_score, T_ans>();
		pair<T_score, T_ans> p = optimize<T_score, T_ans>(g);
		if (p.first > p0.first) {
			p0 = p;
		}
	}
	return p0;
}

int D;
constexpr int M = 26;
vector<ll> C(M);
vector<vector<ll>> S;

template<typename T_score, typename T_ans> T_ans generate(double param) { // ランダムに初期値を生成する
	vector<ll> last(26, 0);
	vector<ll> v(D);

	ll score = 0;
	for (int i = 0; i < D; i++) {
		if (rand(0, INF) < INF * param) {// 貪欲
			vector<T_score> s(M);
			for (int j = 0; j < M; j++) {
				s[j] = S[i][j] + C[j] * (i + 1 - last[j]);
			}

			int k = 0;
			T_score s0 = s[0];
			for (int j = 1; j < M; j++) {
				if (s0 < s[j]) {
					k = j;
				}
			}
			v[i] = k;
		}
		else {
			v[i] = rand(0, M - 1);
		}
	}

	return v;
}
template<typename T_score, typename T_ans> T_ans change(T_ans &params) { // パラメータの一部を変える
	int k = rand(0, D - 1);
	T_ans v(D);
	for (int i = 0; i < D; i++) {
		v[i] = params[i];
	}
	v[k] = rand(0, M - 1);
	return v;
}
template<typename T_score, typename T_ans> T_score calc(T_ans &params) { // パラメータをもとにスコアを計算する
	vector<ll> last(26, 0);
	ll score = 0;
	for (int i = 0; i < D; i++) {
		score += S[i][params[i]];
		last[params[i]] = i + 1;
		for (int j = 0; j < M; j++) {
			score -= C[j] * (i + 1 - last[j]);
		}
	}
	return score;
}

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

	cin >> D;
	S.resize(D);
	for (int i = 0; i < M; i++) {
		cin >> C[i];
	}
	for (int i = 0; i < D; i++) {
		S[i].resize(M);
		for (int j = 0; j < M; j++) {
			cin >> S[i][j];
		}
	}

	pair<ll, vector<ll>> p = argmax<ll, vector<ll>>(INITIAL_SAMPLE_NUM);

	for (int i = 0; i < D; i++) {
		cout << p.second[i] + 1 << endl;
	}

	return 0;
}

Measured memory_bytes: 3336