#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <chrono>
#include <complex>
#include <limits>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

// #define NDEBUG
#include <cassert>

#define ull unsigned long long
#define ll long long
#define pii pair<int, int>
#define pdi pair<double, int>
#define len(c) (int) (c.size())
#define rep(i, from, until) for (int i = (from); i < (until); i++)
#define repr(i, from, until) for (int i = (until) - 1; i >= (from); i--)
#define rep0(i, until) rep(i, 0, until)
#define rep0r(i, until) repr(i, 0, until)
#define clamp(a, minimum, maximum) min(max(a, (minimum)), (maximum))

using namespace std;

class Rnd {
public:
	Rnd(): y(135272729) {
	}

	void seed(int y) {
		this->y = y;
	}

	int next() {
		y = y ^ (y << 13); y = y ^ (y >> 17);
		return (y = y ^ (y << 15)) & 0x7fffffff;
	}
private:
	int y;
};

Rnd rnd;

void seed(int y) {
	rnd.seed(y);
}

int nextInt() {
	return rnd.next();
}

int nextInt(int n) {
	return rnd.next() % n;
}

float nextFloat() {
	return (float) rnd.next() / 0x80000000;
}

// return in ms
int timer(bool reset = false) {
	static auto st = chrono::system_clock::now();
	if (reset) {
		st = chrono::system_clock::now();
		return 0;
	} else {
		auto en = chrono::system_clock::now();
		int elapsedTotal = (int) chrono::duration_cast<chrono::milliseconds>(en - st).count();
		return elapsedTotal;
	}
}

bool debug = true;

void tracen() {
}

template <class Head, class... Tail>
void tracen(Head&& head, Tail&&... tail) {
	if (!debug) return;
	cerr << head;
	tracen(forward<Tail>(tail)...);
}

template <class... Tail>
void trace(Tail&&... tail) {
	if (!debug) return;
	tracen(forward<Tail>(tail)...);
	cerr << endl;
}

template <class	Iter>
void tracein(Iter from, Iter until) {
	if (!debug) return;
	bool first = true;
	while (from != until) {
		if (first) {
			first = false;
		} else {
			cerr << ", ";
		}
		cerr << *from;
		from++;
	}
}

template <class	Iter>
void tracei(Iter from, Iter until) {
	if (!debug) return;
	tracein(from, until);
	cerr << endl;
}

void sleepUntil(int until) {
	volatile unsigned int a = 0;
	while (timer() < until) a++;
}

void segv() {
	volatile int *a = nullptr;
	*a = 0;
}

void waitForever() {
	while (true) getchar();
}




const int D = 365;
int solution[D];
int bestSolution[D];
const int M = 26;

int cs[M];
int ss[D][M];
pii ssorted[D][M];
ll dissats[M][D + 1];

ll evaluate() {
	ll res = 0;
	int last[M] = {};
	rep0(i, D) {
		int day = i + 1;
		int type = solution[i];
		res -= dissats[type][i - last[type]];
		last[type] = day;
		res += ss[i][type];
	}
	rep0(i, M) {
		res -= dissats[i][D - last[i]];
	}
	return res;
}

void randomSolution() {
	rep0(i, D) {
		solution[i] = nextInt() % M;
	}
}

void saveBest() {
	memcpy(bestSolution, solution, sizeof(int) * D);
}

void loadBest() {
	memcpy(solution, bestSolution, sizeof(int) * D);
}

void solveGreedy(int from) {
	int last[M] = {};
	rep0(i, D) {
		if (i < from) {
			last[solution[i]] = i;
			continue;
		}
		int maxj = 0;
		double maxs = ss[i][0];
		rep0(j, M) {
			double s = ss[i][j] + dissats[j][i - last[j]] * 0.4;
			if (s > maxs) {
				maxs = s;
				maxj = j;
			}
		}
		solution[i] = maxj;
		last[maxj] = i;
	}
}

pair<ll, int> evalRec(int from, int depth) {
	if (depth <= 0) {
		solveGreedy(from);
		return make_pair(evaluate(), -1);
	}
	ll maxScore = -1000000;
	int maxType = 0;
	rep0(i, M) {
		int type = i;
		solution[from] = type;
		ll score = evalRec(from + 1, depth - 1).first;
		if (score > maxScore) {
			maxScore = score;
			maxType = type;
		}
	}
	return make_pair(maxScore, maxType);
}

void solveSearch() {
	int depth = 1;
	rep0(i, D) {
		pair<ll, int> estimated = evalRec(i, depth);
		solution[i] = estimated.second;
		//trace("estimated score: ", estimated.first);
	}
}

void solve() {
	solveSearch();
}

void read() {
	int dummy;
	cin >> dummy; // D
	rep0(i, M) cin >> cs[i];
	rep0(i, D) rep0(j, M) cin >> ss[i][j];

	rep0(i, D) {
		rep0(j, M) {
			ssorted[i][j] = make_pair(-ss[i][j], j);
		}
		sort(ssorted[i], ssorted[i + 1]);
		rep0(j, M) {
			ssorted[i][j].first *= -1;
		}
	}

	rep(i, 1, D + 1) {
		rep0(j, M) {
			dissats[j][i] = dissats[j][i - 1] + cs[j] * i;
		}
	}
}

void write() {
	rep0(i, D) cout << solution[i] + 1 << endl;
}

int main() {
	debug = false;
	timer(true);
	read();
	solve();
	write();
	return 0;
}

Measured memory_bytes: 3824