#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] = {};

	//for (int d = 0; d < D; d++)
	//{
	//	int max_s = INT_MIN;
	//	int max_n = -1;
	//	for (int n = 0; n < N; n++)
	//	{
	//		schedule[d] = n;
	//		int score = GetScore(schedule);
	//		if (score > max_s)
	//		{
	//			max_n = n;
	//			max_s = score;
	//		}
	//	}
	//	schedule[d] = max_n;
	//}

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

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

		int score = GetScore(schedule);
		if (prev_score < score)
		{
			prev_score = score;
#if LOCAL
			cerr << time << ":" << loop << ":" << score << endl;
#endif
		}
		else
		{
			schedule[d] = prev;
		}
	}


	int score = GetScore(schedule);
	cerr << score << endl;


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

Measured memory_bytes: 3660