#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <iomanip>
#include <functional>
#include <bitset>
#include <limits>
#include <cstdio>
#include <cmath>
#include <cassert>
#include <random>

#ifdef DEBUG
#include "library/Utility/debug.cpp"
#else
#define debug(...)
#endif

#define rep(i,n) for(int i=0;i<(n);++i)
#define EL '\n'
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
using lnt = long long;
struct FIO{FIO(){std::cin.tie(0);std::cout.tie(0);std::ios_base::sync_with_stdio(0);std::cout<<std::fixed<<std::setprecision(15);}}fIO;
/*-*/
#include <chrono>
struct timer
{
	std::chrono::time_point<std::chrono::steady_clock> start;
	timer() : start(std::chrono::steady_clock::now()) {}
	void ms() {
		std::chrono::duration<double> diff=std::chrono::steady_clock::now()-start;
		std::cerr << diff.count()*1000 << "ms\n";
	}
};
struct time_scope
{
	std::chrono::time_point<std::chrono::steady_clock> start;
	time_scope() : start(std::chrono::steady_clock::now()) {}
	~time_scope() {
		std::chrono::duration<double> diff=std::chrono::steady_clock::now()-start;
		std::cerr << diff.count()*1000 << "ms\n";
	}
};

template <typename T>
std::vector<int> sort_indexes(const std::vector<T> &v) {
	std::vector<int> idx(v.size());
	std::iota(idx.begin(), idx.end(), 0);
	std::sort(idx.begin(), idx.end(), [&v](int i1, int i2) {return v[i1] < v[i2];});
	return idx;
}


int main() {
	time_scope timer;
	int d;
	std::cin >> d;
	int N=26;
	std::vector<lnt> c(N);
	std::vector<std::vector<lnt> > v(d,std::vector<lnt>(N));
	rep(i,N) std::cin >> c[i];
	rep(i,d) {
		rep(j,N) {
			std::cin >> v[i][j];
		}
	}
	lnt best=-10000000;
	std::vector<int> besta;
	int xb,yb,zb;
	for(int x=0;x<2;x++) {
		for(int y=1;y<150;y++) {
			for(int z=8;z<12;z++) {
				std::vector<int> ans; ans.reserve(d);
				std::vector<int> last(N,-1);
				rep(i,d) {
					std::vector<int> idx(N);
					std::iota(idx.begin(), idx.end(), 0);
					lnt X=x; lnt Y=y; lnt Z=z;
					auto f = [&](int ix) -> lnt {
						return c[ix]*(i-last[ix]+X)*Y+v[i][ix]*Z;
					};
					std::sort(idx.begin(), idx.end(), [&](int i1, int i2) {return f(i1) > f(i2) ;});
					last[idx[0]]=i;
					ans.emplace_back(idx[0]);
					//print(idx[0]+1);
				}
				{
					lnt sum=0;
					std::vector<int> last(N,-1);
					rep(i,d) {
						int t=ans[i];
						sum+=v[i][t];
						last[t]=i;
						rep(j,N) sum-=(i-last[j])*c[j];
					}
					if(sum>best) {
						besta=ans;
						best=sum;
						xb=x; yb=y; zb=z;
					}
				}
			}
		}
	}
	int TIMES=1000;
	rep(ii,TIMES) {
		double r = static_cast <double> (rand()) / static_cast <double> (RAND_MAX);
		double rx = static_cast <double> (rand()) / static_cast <double> (RAND_MAX);
		r/=zb/6.0;
		r-=3.0/zb;
		r-=0.5;
		std::vector<int> ans; ans.reserve(d);
		std::vector<int> last(N,-1);
		rep(i,d) {
			std::vector<int> idx(N);
			std::iota(idx.begin(), idx.end(), 0);
			double X=xb+rx; double Y=yb/(double)zb+r;
			auto f = [&](int ix) -> double {
				return c[ix]*(i-last[ix]+X)*Y+v[i][ix];
			};
			std::sort(idx.begin(), idx.end(), [&](int i1, int i2) {return f(i1) > f(i2) ;});
			last[idx[0]]=i;
			ans.emplace_back(idx[0]);
			//print(idx[0]+1);
		}
		{
			lnt sum=0;
			std::vector<int> last(N,-1);
			rep(i,d) {
				int t=ans[i];
				sum+=v[i][t];
				last[t]=i;
				rep(j,N) sum-=(i-last[j])*c[j];
			}
			if(sum>best) {
				besta=ans;
				best=sum;
			}
		}
	}
	rep(i,d) {
		print(besta[i]+1);
	}
}


Measured memory_bytes: 3908