#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using Pt = pair<int, int>;


namespace
{
	class Calculater
	{
	public:
		Calculater(vi c, vvi s)
			: c_(c), s_(s), D_((int)s.size()), selection_(D_), skip_(D_){
			Initialize();
		}

		void Initialize()
		{
			vi ld(26, -1);
			for (int i = 0; i < D_; ++i)
			{
				vi u = s_[i];
				vi v(26);
				for (int j = 0; j < 26; ++j)
					v[j] = c_[j] * (i - ld[j]);
				int ttl = accumulate(v.cbegin(), v.cend(), 0);
				transform(v.begin(), v.end(), v.begin(), [ttl](int x) {return x - ttl; });
				for (int j = 0; j < 26; ++j)
					u[j] += v[j];
				int j = (int)distance(u.cbegin(), max_element(u.cbegin(), u.cend()));
				selection_[i] = j;
				ld[j] = i;
			}
			sat_ = CalcSatisfaction();
		}
		int CalcSatisfaction()
		{
			int v = 0;
			vi ld(26, -1);
			for (int i = 0; i < D_; ++i)
			{
				int x = selection_[i];
				for (int j = 0; j < 26; ++j)
				{
					if (j == x)
					{
						v += s_[i][j];
						ld[j] = i;
					}
					else
						v -= c_[j] * (i - ld[j]);
				}
			}
			return v;
		}

		const vi& Selections() const
		{
			return selection_;
		}
		int Selection(int i) const
		{
			return selection_[i];
		}

		bool Change(int d, int q)
		{
			if (skip_[d].find(q) != skip_[d].cend())
				return false;
			int p = selection_[d];
			int d0 = 1;
			for (int i = d - 1; i > -1; --i)
			{
				if (selection_[i] == p)
					break;
				++d0;
			}
			int x = d0* c_[p];
			int d1 = 1;
			for (int i = d + 1; i < D_; ++i)
			{
				if (selection_[i] == p)
					break;
				++d1;
			}
			sat_ -= d1 * x;
			sat_ -= s_[d][p];


			d0 = 1;
			for (int i = d - 1; i > -1; --i)
			{
				if (selection_[i] == q)
					break;
				++d0;
			}
			x = d0 * c_[q];
			d1 = 1;
			for (int i = d + 1; i < D_; ++i)
			{
				if (selection_[i] == q)
					break;
				++d1;
			}
			sat_ += s_[d][q];
			sat_ += d1 * x;
			selection_[d] = q;
			return true;
		}

		void Skip(int d, int q)
		{
			skip_[d].insert(q);
		}

		int Satisfaction() const { return sat_; }
	private:
		vi c_;
		vvi s_;
		int D_;
		vi selection_;
		vector<set<int> > skip_;

		int sat_;
	};

}
void Heuristics_Introduction_A()
{
	int D;
	cin >> D;
	vi c(26);
	for (auto& x : c)
		cin >> x;

	vvi s(D, vi(26));
	for (int i = 0; i < D; ++i)
	{
		for (int j = 0; j < 26; ++j)
			cin >> s[i][j];
	}


	Calculater x(c, s);

	//for (int i = 0; i < D; ++i)
	//{
	//	int t;
	//	cin >> t;
	//	x.Change(i, t - 1);
	//}

	//int M;
	//cin >> M;
	//for (int i = 0; i < M; ++i)
	//{
	//	int d, q;
	//	cin >> d >> q;
	//	--d; --q;
	//	x.Change(d, q);

	//	cout << x.Satisfaction() << endl;
	//}

	for (int k = 0; k < 10; ++k)
	{
		for (int i = 0; i < D; ++i)
		{
			int sat0 = x.Satisfaction();
			int q = x.Selection(i);
			for (int j = 0; j < 26; ++j)
			{
				if (!x.Change(i, j))
					continue;
				int sat1 = x.Satisfaction();
				if (sat1 > sat0)
				{
					sat0 = sat1;
					q = j;
				}
				else if (sat1 < 0.5 * sat0)
				{
					x.Skip(i, j);
				}
			}
			x.Change(i, q);
		}
	}

	for (int i = 0; i < D; ++i)
	{
		cout << x.Selection(i) + 1 << endl;
	}
//	cout << x.Satisfaction() << endl;
}


int main()
{
	Heuristics_Introduction_A();
	return 0;
}


Measured memory_bytes: 4192