#include <string>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <cmath>
#include <limits>
#include <tuple>
#include <queue>
#include <stack>
#include <bitset>
#include <chrono>
#include <cstdlib>

using namespace std;
using namespace std::chrono;
typedef long long ll;

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()

class solver {
public:
	int D;
	vector<ll> c;
	vector<vector<ll>> s;

	void init() {
		cin >> D;
		c.resize(26);
		s.resize(D);
		rep(i, 26) {
			cin >> c[i];
		}
		rep(j, D) {
			s[j].resize(26);
			rep(i, 26) {
				cin >> s[j][i];
			}
		}
	}

	vector<ll> calc(const vector<int>& t) const {
		vector<int> last(26);
		auto down = [&last, this](int d) {
			d++;
			ll v = 0;
			rep(i, 26) {
				v += c[i] * (d - last[i]);
			}
			return v;
		};
		int N = t.size();
		vector<ll> v(N);
		rep(i, N) {
			if (i > 0)
				v[i] = v[i - 1];
			v[i] += s[i][t[i]];
			last[t[i]] = i + 1;
			v[i] -= down(i);
		}
		return v;
	}

	vector<int> greedy() const {
		vector<pair<ll, int>> cs;
		rep(i, 26) {
			cs.emplace_back(c[i], i);
		}
		sort(all(cs), greater<pair<ll, int>>());

		vector<vector<pair<ll, int>>> ss(D);
		rep(j, D) {
			rep(i, 26) {
				ss[j].emplace_back(s[j][i], i);
			}
			sort(all(ss[j]), greater<pair<ll, int>>());
		}

		vector<int> ans;
		ll score = 0;
		for (auto& i : ss) {
			vector<int> ts(ans);
			ts.push_back(i[0].second);
			auto as = calc(ts);
			vector<int> tc(ans);
			tc.push_back(cs[0].second);
			auto ac = calc(tc);
			if (as.back() > ac.back()) {
				ans.push_back(i[0].second);
				score = as.back();
			}
			else {
				ans.push_back(cs[0].second);
				score = ac.back();
			}
		}

		/*
t[1..D] = 初期解(ランダム生成や、貪欲法で求めたものを利用)
while 時間のある限り:
	d と q をランダムに選ぶ。
	old = t[d] # 後で戻せるように元の値を記憶しておく
	t[d] = q
	if 変形前より解が悪化:
		t[d] = old
		*/
		system_clock::time_point start = system_clock::now();
		auto t = ans;
		for (;;) {
			system_clock::time_point now = system_clock::now();
			double elapsed = duration_cast<milliseconds>(now - start).count();
			if (elapsed > 1900)
				break;

			auto old = t;
			int d = rand() % D;
			int q = rand() % 26;
			t[d] = q;
			auto tmp = calc(t);
			
			if (score < tmp.back()) {
				score = tmp.back();
			}
			else {
				// rollback
				t = old;
			}
		}
		ans = t;
		return ans;
	}

/*
fn solve(input: &Input) -> Vec<usize> {
	const TL: f64 = 1.9;
	let mut rng = rand_pcg::Pcg64Mcg::new(890482);
	let mut out = (0..input.D).map(|_| rng.gen_range(0, 26)).collect::<Vec<_>>(); // random solution
	let mut score = compute_score(&input, &out);
	while get_time() < TL {
		if rng.gen_bool(0.5) {
			let d = rng.gen_range(0, input.D);
			let q = rng.gen_range(0, 26);
			let old = out[d];
			out[d] = q;
			let new_score = compute_score(&input, &out);
			if score > new_score {
				out[d] = old;
			} else {
				score = new_score;
			}
		} else {
			let d1 = rng.gen_range(0, input.D - 1);
			let d2 = rng.gen_range(d1 + 1, (d1 + 16).min(input.D));
			out.swap(d1, d2);
			let new_score = compute_score(&input, &out);
			if score > new_score {
				out.swap(d1, d2);
			} else {
				score = new_score;
			}
		}
	}
	out
}
*/
	vector<int> solve() const {
		auto start = system_clock::now();
		auto get_time = [start]() {return duration_cast<milliseconds>(system_clock::now() - start).count(); };
		const ll TL = 1900;
		vector<int> out(D);
		rep(i, D) {
			out[i] = rand() % 26;	// random solution
		}
		auto score = calc(out).back();
		while (get_time() < TL) {
			if (rand() % 2 == 0) {
				const int d = rand() % D;
				const int q = rand() % 26;
				const int old = out[d];
				out[d] = q;
				const ll new_score = calc(out).back();
				if (score > new_score) {
					out[d] = old;
				}
				else {
					score = new_score;
				}
			}
			else {
				const int d1 = rand() % (D-1);
				const int d2 = min(d1 + 1 + (rand() % 16), D);
				swap(out[d1], out[d2]);
				const ll new_score = calc(out).back();
				if (score > new_score) {
					swap(out[d1], out[d2]);
				}
				else {
					score = new_score;
				}
			}
		}
		return out;
	}

	/*
fn solve(input: &Input) -> Vec<usize> {
	const T0: f64 = 2e3;
	const T1: f64 = 6e2;
	const TL: f64 = 1.9;
	let mut rng = rand_pcg::Pcg64Mcg::new(890482);
	let mut state = State::new(input, (0..input.D).map(|_| rng.gen_range(0, 26)).collect());
	let mut cnt = 0;
	let mut T = T0;
	let mut best = state.score;

	let mut best_out = state.out.clone();
	loop {
		cnt += 1;
		if cnt % 100 == 0 {
			let t = get_time() / TL;
			if t >= 1.0 {
				break;
			}
			T = T0.powf(1.0 - t) * T1.powf(t);
		}
		let old_score = state.score;
		if rng.gen_bool(0.5) {
			let d = rng.gen_range(0, input.D);
			let old = state.out[d];
			state.change(input, d, rng.gen_range(0, 26));
			if old_score > state.score && !rng.gen_bool(f64::exp((state.score - old_score) as f64 / T)) {
				state.change(input, d, old);
			}
		} else {
			let d1 = rng.gen_range(0, input.D - 1);
			let d2 = rng.gen_range(d1 + 1, (d1 + 16).min(input.D));
			let (a, b) = (state.out[d1], state.out[d2]);
			state.change(input, d1, b);
			state.change(input, d2, a);
			if old_score > state.score && !rng.gen_bool(f64::exp((state.score - old_score) as f64 / T)) {
				state.change(input, d1, a);
				state.change(input, d2, b);
			}
		}
		if best.setmax(state.score) {
			best_out = state.out.clone();
		}
	}
	best_out
}	
*/
	//SimulatedAnnealing
	vector<int> sa() const {
		return {};
	}
};

int main()
{
	solver solver;
	solver.init();
	auto ans = solver.greedy();
	for (auto t : ans) {
		cout << (t + 1) << endl;
	}
	return 0;
}


Measured memory_bytes: 4032