#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 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);
}

// 基本パラメータ
#define INITIAL_SAMPLE_NUM 1
#define ANNEALING_ITERATION_NUM 3000
#define ANNEALING_SEARCH_NUM 100

// 詳細パラメータ
#define GENERATE_GREEDY_WEIGHT 100
#define GENERATE_RANDOM_WEIGHT 0

// 詳細パラメータ
#define CHANGE_1POINT_WEIGHT 50
#define CHANGE_SWAP_WEIGHT 200
#define CHANGE_ROTATE_RIGHT_WEIGHT 0
#define CHANGE_ROTATE_LEFT_WEIGHT 0

static int PARAMTYPE_MAX = 26;// paramTypeの数字の取り得る範囲
static int PARAM_SIZE = 365;// paramsの配列サイズ

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

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

	ll score = 0;
	for (int i = 0; i < D; i++) {
		vector<scoreType> s(M);
		for (int j = 0; j < M; j++) {
			s[j] = S[i][j] + C[j] * (i + 1 - last[j]);
		}

		int k = 0;
		scoreType s0 = s[0];
		for (int j = 1; j < M; j++) {
			if (s0 < s[j]) {
				k = j;
			}
		}
		dest[i] = k;
	}
}
template<typename scoreType, typename paramType> void generate_random(vector<paramType>& dest) {
	// 乱数による初期解生成
	for (int i = 0; i < PARAM_SIZE; i++) {
		dest[i] = rand(0, PARAMTYPE_MAX - 1);
	}
}
template<typename scoreType, typename paramType> vector<paramType> generate() { // ランダムに初期値を生成する
	vector<paramType> v(PARAM_SIZE);
	if (rand(0, INF) < (double)INF * (double)GENERATE_GREEDY_WEIGHT / (GENERATE_GREEDY_WEIGHT + GENERATE_RANDOM_WEIGHT)) {
		generate_greedy<scoreType, paramType>(v);
	}
	else {
		generate_random<scoreType, paramType>(v);
	}

	return v;
}
template<typename scoreType, typename paramType> void change_1point(vector<paramType>& params) {
	int k = rand(0, PARAM_SIZE - 1);
	params[k] = rand(0, PARAMTYPE_MAX - 1);
}
template<typename scoreType, typename paramType> void change_swap(vector<paramType>& params) {
	int p = rand(0, PARAM_SIZE - 1), q = rand(0, PARAM_SIZE - 1);
	auto temp = params[p];
	params[p] = params[q];
	params[q] = temp;
}
template<typename scoreType, typename paramType> void change_rotate_right(vector<paramType>& params) {
	int len = rand(3, PARAM_SIZE - 1);
	int x = rand(0, PARAM_SIZE - len);
	auto temp = params[x + len - 1];
	for (int i = x + len - 1; i > x; i--) {
		params[i] = params[i - 1];
	}
	params[x] = temp;
}
template<typename scoreType, typename paramType> void change_rotate_left(vector<paramType>& params) {
	int len = rand(3, PARAM_SIZE - 1);
	int x = rand(0, PARAM_SIZE - len);
	auto temp = params[x];
	for (int i = x; i < x + len - 1; i++) {
		params[i] = params[i + 1];
	}
	params[x + len - 1] = temp;
}
template<typename scoreType, typename paramType> vector<paramType> change(vector<paramType>&params) { // パラメータの一部を変える
	vector<paramType> v(PARAM_SIZE);
	for (int i = 0; i < PARAM_SIZE; i++) {
		v[i] = params[i];
	}

	double r = rand(0, INF) / (double)INF;
	double CHANGE_WEIGHT_SUM = CHANGE_1POINT_WEIGHT + CHANGE_SWAP_WEIGHT + CHANGE_ROTATE_RIGHT_WEIGHT + CHANGE_ROTATE_LEFT_WEIGHT;
	if (r < (double)CHANGE_1POINT_WEIGHT / CHANGE_WEIGHT_SUM) {
		change_1point<scoreType, paramType>(v);
	}
	else if (r < (double)(CHANGE_1POINT_WEIGHT + CHANGE_SWAP_WEIGHT) / CHANGE_WEIGHT_SUM) {
		change_swap<scoreType, paramType>(v);
	}
	else if (r < (double)(CHANGE_1POINT_WEIGHT + CHANGE_SWAP_WEIGHT + CHANGE_ROTATE_RIGHT_WEIGHT) / CHANGE_WEIGHT_SUM) {
		change_rotate_right<scoreType, paramType>(v);
	}
	else {
		change_rotate_left<scoreType, paramType>(v);
	}

	return v;
}
template<typename scoreType, typename paramType> scoreType calc(vector<paramType> &params) { // パラメータをもとにスコアを計算する
	vector<ll> last(26, 0);
	ll score = 0;
	for (int i = 0; i < PARAM_SIZE; 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;
	PARAM_SIZE = D;
	S.resize(PARAM_SIZE);
	for (int i = 0; i < M; i++) {
		cin >> C[i];
	}
	for (int i = 0; i < PARAM_SIZE; i++) {
		S[i].resize(M);
		for (int j = 0; j < M; j++) {
			cin >> S[i][j];
		}
	}

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

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

	return 0;
}


Measured memory_bytes: 3580