#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

#define PROB_B 1
#define LOCAL 1
#define SUBMIT 0

struct Random {
public:
	Random() {
		// std::random_device rd;
		// mt.seed(rd());
		// 初期 seed を固定してみる
		mt.seed(87772);
	}
	
	int next(int min_e, int max_e) {
		std::uniform_int_distribution<> rand(min_e, max_e);
		return rand(mt);
	}
	
	double next(double min_e, double max_e) {
		std::uniform_real_distribution<> rand(min_e, max_e);
		return rand(mt);
	}
	
	template<typename T>
	void shuffleVector(std::vector<T> & v) {
		std::shuffle(std::begin(v), std::end(v), mt);
	}
	
public:
	std::mt19937 mt;
} rnd;

struct Timer {
public:
	Timer() : start(now()) {}
	
	void set() { last = now(); }
	long long time() const { return difference_time(last, now()); }
	long long elapsed_time() const { return difference_time(start, now()); }
	
private:
	using time_point = std::chrono::system_clock::time_point;
	std::chrono::system_clock::time_point start, last;
	
	time_point now() const {
		return std::chrono::system_clock::now();
	}
	
	long long difference_time(const time_point & x, const time_point & y) const {
		return std::chrono::duration_cast<std::chrono::microseconds>(y - x).count();
	}
	
} timer;

template<typename T>
std::string to_string_zero(T n, int keta) {
	std::string res = std::to_string(n);
	while (res.size() < keta) res.insert(res.begin(), '0');
	return res;
}

template<typename T>
std::string to_string_comma(T n) {
	bool minus_flag = n < 0;
	if (minus_flag) n = -n;
	std::string res, s = std::to_string(n);
	for (int i = 0; i < s.size(); ++i) {
		int d = s.size() - i;
		if (i > 0 && (s.size() - i) % 3 == 0) res.push_back(',');
		res.push_back(s[i]);
	}
	if (minus_flag) res.insert(res.begin(), '-');
	return res;
}

bool output_del = 0; // 出力ファイルの削除フラグ
void arg_analysys(int argc, const char * argv[]) {
	if (argc == 1) return;
	std::vector<std::string> vs(argc - 1);
	for (int i = 1; i < argc; ++i) vs[i - 1] = argv[i];
	
	int mode = -1;
	std::map<std::string, int> mm;
	{
		std::vector<std::string> tmp_v = {"aaaa"};
		for (int i = 0; i < tmp_v.size(); ++i) mm[tmp_v[i]] = i;
	}
	for (std::string & s : vs) {
		if (s.size() > 2 && s[0] == '-' && s[1] == '-') {
			s = s.substr(2);
		}
		else {
			assert(mode != -1); // 不正な引数
			
			double num;
			try {
				num = std::stod(s);
			}
			catch (const std::exception & e) {
				std::cerr << e.what() << std::endl;
				exit(EXIT_FAILURE);
			}
			if (mode == mm["aaaa"]) continue;
		}
	}
}

constexpr int TYPE = 26;

struct Input {
	
	int D;
	vector<int> c;
	vector<vector<int>> s;
	
	void read(std::istream& in = std::cin) {
		cin >> D;
		c.resize(TYPE);
		REP(i, TYPE) cin >> c[i];
		
		s.resize(D);
		for (auto &cur : s) {
			cur.resize(TYPE);
			for (auto &v : cur) cin >> v;
		}
	}
};

struct Output {
	Input input;
	vector<int> t;
	
	Output(Input input) : input(input) {
		t.resize(input.D, -1);
	}
	
	void add_data(int d, int _t) {
		t[d] = _t;
	}
	
	void print() {
		REP(i, input.D) cout << t[i] + 1 << '\n';
		cout.flush();
	}
};

struct ScoreCalculator {
	constexpr static int proc_out = false;
	
	// O(D * TYPE) 365*25 ~= 10^4
	static int calc_satis(Input &input, Output &output) {
		int satis = 0;
		vector<int> last_i(TYPE);
		
		REP(i, input.D) {
			satis += input.s[i][output.t[i]];
			last_i[output.t[i]] = i + 1;
			
			REP(j, TYPE) satis -= input.c[j] * (i + 1 - last_i[j]);
			
			if (proc_out) cout << satis << endl;
		}
		
		return satis;
	}
	
	static int calc_score(Input &input, Output &output) {
		int satis = calc_satis(input, output);
		return max(satis + 1000000, 0);
	}
};

Output solve_greedy(Input &input) {
	Output output(input);
	
	// 毎回 s が最も大きいコンテストを選ぶ
	int satis = 0;
	vector<int> last_i(TYPE, -1);
	REP(i, input.D) {
		int sel_max = -INF, sel_idx = -1;
		REP(j, TYPE) {
			int cur = input.s[i][j];
			cur += input.c[j] * (i - last_i[j] - 1);
			if (chmax(sel_max, cur)) sel_idx = j;
		}
		
		last_i[sel_idx] = i;
		output.add_data(i, sel_idx);
	}
	
	int score = ScoreCalculator::calc_satis(input, output);
	return output;
}

Output increment(Input &input, Output &orig_output, int cnt = INF) {
	int mx_satis = ScoreCalculator::calc_satis(input, orig_output);
	Output mx_output = orig_output;
	
	while (cnt > 0 && timer.elapsed_time() < 1850 * 1000) {
		int day = rnd.next(0, input.D - 1);
		int tar_t = rnd.next(0, TYPE - 1);
		
		Output cur_output = orig_output;
		cur_output.t[day] = tar_t;
		
		int cur_satis = ScoreCalculator::calc_satis(input, cur_output);
		if (chmax(mx_satis, cur_satis)) mx_output = cur_output;
		--cnt;
	}
	return mx_output;
}

Output noise(Input &input, Output &orig_output, int cnt = 10) {
	Output res_output = orig_output;
	while (cnt--) {
		int day = rnd.next(0, input.D - 1);
		int tar_t = rnd.next(0, TYPE - 1);
		res_output.t[day] = tar_t;
	}
	return res_output;
}

Output beam_search(Input &input, Output &orig_output) {
	constexpr int beam_depth = 20;
	constexpr int inc_cnt = 10;
	constexpr int inc_attempt = 10;
	
	struct Data {
		int score;
		Output output;
		
		bool operator <(const Data &rhs) {
			return score > rhs.score;
		}
	};
	
	queue<Data> que;
	int total_attempt = 0;
	que.emplace(Data{ScoreCalculator::calc_satis(input, orig_output), orig_output});
	while (timer.elapsed_time() < 1700 * 1000) {
		vector<Data> nex_pred;
		
		while (!que.empty()) {
			Data cur_data = que.front(); que.pop();
			
			Output cur_output = cur_data.output;
			REP(i, inc_attempt) {
				if (rnd.next(0, 9) == 0) cur_output = noise(input, cur_output, total_attempt > 10 ? 20 : 10);
				else cur_output = increment(input, cur_output, total_attempt > 10 ? 2 : 5);
				
				int score = ScoreCalculator::calc_satis(input, cur_output);
				nex_pred.emplace_back(Data{score, cur_output});
			}
		}
		
		sort(ALL(nex_pred));
		REP(i, beam_depth) if (i < nex_pred.size()) que.emplace(nex_pred[i]);
		++total_attempt;
	}
	// cerr << "total_attempt " << total_attempt << endl;
	return que.front().output;
}

void solveManager(Input &input) {
	Output output = solve_greedy(input);
	output = beam_search(input, output);
	output = increment(input, output);
	
	output.print();
}

int main(int argc, const char * argv[]) {
	Input input;
	input.read();
	
	solveManager(input);
}


Measured memory_bytes: 14768