#include <cmath>
#include <cstdio>
#include <vector>
#include <iterator>
#include <iostream>
#include <algorithm>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <map>
#include <stdio.h>
#include <functional>
#include <chrono>
#include <random>
#include <time.h>
using namespace std;

#define rep(i,s,n) for(ll i=s;i<(n);++i)
using ll = long long;
using pll = pair<ll, ll>;
constexpr ll INF = (1LL << 60);
constexpr ll MAX_INF = 9223372036854775807;
//constexpr ll MOD = (1e9 + 7);
constexpr ll MOD = (998244353);

using vl = vector<ll>;
using vvl = vector<vector<ll>>;

template<class T>
vector<vector<T>> vvt(T init, ll m, ll n) {
	vector<vector<T>> ans = vector<vector<T>>(m, vector<T>(n, init));
	return move(ans);
}

template<class T>
vector<T> vt(T init, ll n) {
	vector<T> ans = vector<T>(n, init);
	return move(ans);
}

template<class T>
T maxVec(vector<T>& v) {
	T ans = -INF;
	rep(i, 0, v.size()) {
		ans = max(ans, v[i]);
	}
	return ans;
}

// 素数判定
bool judge(ll n) {
	for (ll i = 2; i * i <= n; i++) if (n %= i)return false;
	return true;
}


template <class C>
void print(const C & c, std::ostream & os = std::cout)
{
	std::copy(std::begin(c), std::end(c), std::ostream_iterator<typename C::value_type>(os, ", "));
	os << std::endl;
}
/*
ll count(ll n,ll r) {
	ll ans = 0,check = 1;
	rep(i,0, r) {
		if ((n & check) > 0) {
			ans++;
		}
		check = check << 1;
	}
	return ans;
}
*/
bool sortreverse(ll a, ll b) {
	return a > b;
}


ll kiriage(ll a, ll b) {
	if (a % b == 0)return a / b;
	return a / b + 1;
}

void warshall_floyd(ll v_num,vector<vector<long long>> &d) {
	for (long long k = 0; k < v_num; k++) {       // 経由する頂点
		for (long long i = 0; i < v_num; i++) {    // 始点
			for (long long j = 0; j < v_num; j++) {  // 終点
				d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
			}
		}
	}
}

uniform_real_distribution<> dist(0.0, 1.0);

float judge(float p, mt19937& engine) {
	float f = dist(engine);
	return p >= f;
}

float prob(float delta, float tmp) {
	return exp(delta / tmp);
}


int cost(vector<vector<int>>& s, vector<int>& c, vector<int>& ls) {
	int result = 0;
	vector<int> prev(26,-1);
	rep(i, 0, ls.size()) {
		prev[ls[i]] = i;
		result += s[i][ls[i]];
		rep(j, 0, 26) {
			result -= c[j] * (i - prev[j]);
		}
	}
	return result;
}

int cost2(vector<vector<int>>& s, vector<int>& c,vector<int> &prevLs, int prev_cost,int day,int new_val) {
	int result = prev_cost;
	vector<int> prev(26, -1);
	result -= s[day][prevLs[day]];
	int mae = -1;
	for (int i = day - 1; i >= 0; --i) {
		if (prevLs[i] == prevLs[day]) {
			mae = i;
			break;
		}
	}
	result -= c[prevLs[day]] * (day - mae);
	for (int i = day+1; i < prevLs.size(); ++i) {
		if (prevLs[day] != prevLs[i]) {
			result += c[prevLs[day]] * (i - day);
			result -= c[prevLs[day]] * (i - mae);
		}
		else {
			break;
		}
	}
	result += s[day][new_val];
	mae = -1;
	for (int i = day - 1; i >= 0; --i) {
		if (prevLs[i] == new_val) {
			mae = i;
			break;
		}
	}
	result += c[new_val] * (day - mae);
	for (int i = day + 1; i < prevLs.size(); ++i) {
		if (new_val != prevLs[i]) {
			result -= c[new_val] * (i - day);
			result += c[new_val] * (i - mae);
		}
		else {
			break;
		}
	}
	return result;
}


int main() {
	// ↓この２行が追加部分
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	random_device seed_gen;
	mt19937 engine(seed_gen());

	int d;
	cin >> d;
	int con = 0;
	vector<int> c(26);
	vector<vector<int>> s(d, vector<int>(26));
	rep(i, 0, 26) {
		cin >> c[i];
	}
	rep(i, 0, d) {
		rep(j, 0, 26) {
			cin >> s[i][j];
		}
	}

	// 初期化
	vector<int> ls(d);
	rep(i, 0, d) {
		ls[i] = con;
		++con;
		con %= 26;
	}
	
	
	int now_cost = cost(s,c,ls);

	for (int tmp = 5000; tmp > 1; tmp -= 1) {
		
		rep(k, 0, 7) {
			rep(j, 0, d) {
				int ra = rand() % 24 + 1, val = ls[j];
				int new_val = (ra + val) % 26;
				int cos = cost2(s, c, ls, now_cost, j, new_val);
				float p = prob(cos - now_cost, tmp);
				if (judge(p, engine)) {
					now_cost = cos;
					ls[j] = new_val;
				}
			}
		}
	}

	rep(i, 0, d) {
		printf("%d\n", ls[i] + 1);
	}
}

Measured memory_bytes: 4028