#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>
#include <cassert>
#include <chrono>
#include <fstream>
#include <array>
using ll = long long;

//LLONG_MAX
//#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i)=0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()

#ifdef LOCAL
#define ASSERT_DEBUG
#endif
#ifdef ASSERT_DEBUG
#define ASSERT(cond) assert(cond)
#else
#define ASSERT(cond)
#endif

class Point
{
public:
	int x;
	int y;
	Point() { this->x = 0; this->y = 0; }
	Point(int x, int y) { this->x = x; this->y = y; }
};

//time_point<system_clock> _start_time = system_clock::now();
//ll time = duration_cast<milliseconds>(system_clock::now() - _start_time).count();


//const int R = 10000;
//const double START_TEMP = pow(50.0, 2);
//const double END_TEMP = 0;
//double temp = sqrt(START_TEMP + (END_TEMP - START_TEMP) * (ms / (double)1900));
//double probability = MIN(1.0, exp((score - new_score) / temp));
//bool force_next = probability > ((xorshift32() % R) / (double)R);
//if (force_next)

using namespace std;
using namespace chrono;

unsigned int xorshift32()
{
	static int s = 7;
	s ^= (s << 13);
	s ^= (s >> 17);
	s ^= (s << 15);
	return s;
}


const int D = 365;
const int N = 26;
int C[N];
int S[N][D];


int GetScore(int schedule[D])
{
	int score = 0;
	int last[N] = {};
	for (int d = 0; d < D; d++)
	{
		score += S[schedule[d]][d];
		last[schedule[d]] = d;
		for (int n = 0; n < 26; n++)
		{
			score -= C[n] * (d - last[n]);
		}
	}
	return score;
}




int main()
{
	int _;
	cin >> _;
	REP(n, N)
	{
		cin >> C[n];
	}
	REP(d, D)
	{
		REP(n, N)
		{
			cin >> S[n][d];
		}
	}

	int schedule[D] = {};
	int best_schedule[D] = {};

	time_point<system_clock> _start_time = system_clock::now();
	int prev_score = GetScore(schedule);
	int best_score = prev_score;
	int loop = 0;
	const int TIME_LIMIT = 1980;
	while (true)
	{
		loop++;
		ll time = duration_cast<milliseconds>(system_clock::now() - _start_time).count();
		if (time > 1980)
		{
			break;
		}

		int d = xorshift32() % D;
		int n = xorshift32() % N;
		int prev = schedule[d];
		schedule[d] = n;
		int new_score = GetScore(schedule);

		const int R = 10000;
		const double START_TEMP = 10000000.0;
		const double END_TEMP = 0;
		double temp = sqrt(START_TEMP + (END_TEMP - START_TEMP) * (time / (double)1980));
		double probability = min(1.0, exp((new_score - prev_score) / temp));
		bool force_next = probability > ((xorshift32() % R) / (double)R);

		if (force_next)
		{
#if LOCAL
			//if (prev_score < new_score)
			//{
			//	cerr << "*" << endl;
			//}
			//if (prev_score != new_score)
			//{
			//	cerr << time << ":" << loop << ":" << new_score << endl;
			//}
#endif

			if (best_score < new_score)
			{
				best_score = new_score;
				memcpy(best_schedule, schedule, sizeof(best_schedule));
#if LOCAL
				//cerr << time << ":" << loop << ":" << new_score << endl;
#endif
			}

			prev_score = new_score;
		}
		else
		{
			schedule[d] = prev;
		}
	}


	int score = GetScore(best_schedule);
	cerr << "loop  : " << loop << endl;
	cerr << "score : " << score << endl;


	REP(i, D)
	{
		cout << (best_schedule[i] + 1) << endl;
	}
}

Measured memory_bytes: 4292