#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define debug cerr << "-- " << __LINE__ << " --" << endl
#define MOD 1000000007
#define ALL(o) (o).begin(), (o).end()
typedef long long int ll;

using namespace std;
using namespace std::chrono;
system_clock::time_point t0; int elapsedTimeCache;
int elapsedTime(){
	return duration_cast<milliseconds>(system_clock::now() - t0).count();
}

//乱数
unsigned long xor128(void){
    static unsigned long x=123456789,y=362436069,z=521288629,w=88675123;
    unsigned long t;
    t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) );
}
#define irand xor128
double drand(){
	//return (0.0 + rand())/RAND_MAX;
	return irand()/((double)ULONG_MAX);
}


typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template <typename T> string to_string(const vector<T> &xs) {string s="["; for(int i=0;i<xs.size();i++) s += (i>0 ? " " : "") + to_string(xs[i]); return s + "]";}
template <typename T> ll argmax(const T &xs) {return distance(xs.begin(), max_element(xs.begin(), xs.end()));}
template <typename T> ll argmin(const T &xs) {return distance(xs.begin(), min_element(xs.begin(), xs.end()));}
ll nextLL(){ll x; scanf("%lld", &x); return x;}
int nextInt(){int x; scanf("%d", &x); return x;}
string nextString(){string s; cin >> s; return s;}



const int N = 26;
int D;
int c[26];
int s[365][26];


class State{
public:
	vector<int> ans;
	vector<set<int> > dayList;
	int score = 0;
	State(int D, int mode){
		ans = vector<int>(D);
		dayList = vector<set<int> > (N);
		for(int i=0;i<D;i++){
			int maxi = -1, argmaxi = -1;
			for(int j=0;j<N;j++) if (maxi < s[i][j]) {maxi = s[i][j]; argmaxi = j;}
			if (mode==0){
				ans[i] = argmaxi;
				dayList[argmaxi].insert(i);
			}else{
				ans[i] = 0;
				dayList[0].insert(i);
			}
		}
		score = computeScore();
	}
	int computeScore(){
		int ret = 0;
		int lastHeld[N];
		for(int j=0;j<N;j++) lastHeld[j] = -1;
		for(int i=0;i<D;i++){
			for(int j=0;j<N;j++){
				if (ans[i]==j) {
					ret += s[i][j];
					lastHeld[j] = i;
				}
				else ret -= c[j] * (i - lastHeld[j]);
			}
		}
		return ret;
	}
	int computeDiffScore(int idx, int newJ){
		int oldJ = ans[idx];
		if (oldJ == newJ) return 0;
		int ret = 0;
		// sの差分
		ret += s[idx][newJ] - s[idx][oldJ];
		// newJ が idx 日めに割り込む嬉しさ
		auto itr = dayList[newJ].upper_bound(idx);
		int postDay = (itr == dayList[newJ].end()) ? D : *itr;
		int preDay = -1;
		if (itr != dayList[newJ].begin()) {itr--; preDay = *itr;}
		// cerr << preDay << " " << idx << " " << postDay << endl;
		ret += (idx - preDay) * (postDay - idx) * c[newJ];
		// oldJ が idx 日めから消滅するつらさ
		auto itr2 = dayList[oldJ].lower_bound(idx);
		auto itr3 = itr2;
		itr3++;
		int postDay2 = (itr3 == dayList[oldJ].end()) ? D : *itr3;
		int preDay2 = -1;
		if (itr2 != dayList[oldJ].begin()) {itr2--; preDay2 = *itr2;}
		// cerr << preDay2 << " " << idx << " " << postDay2 << endl;
		ret -= (idx - preDay2) * (postDay2 - idx) * c[oldJ];
		return ret;
	}
	void update(int idx, int newJ){
		int oldJ = ans[idx];
		if (oldJ == newJ) return;
		score += computeDiffScore(idx, newJ);
		dayList[oldJ].erase(idx);
		dayList[newJ].insert(idx);
		ans[idx] = newJ;
	}
	void updateLight(int idx, int newJ, int diffScore){
		int oldJ = ans[idx];
		if (oldJ == newJ) return;
		score += diffScore;
		dayList[oldJ].erase(idx);
		dayList[newJ].insert(idx);
		ans[idx] = newJ;
	}
};

int main(void){
	t0 = system_clock::now();
	srand(time(NULL));

	cin >> D;
	for(int i=0;i<N;i++) cin >> c[i];
	for(int i=0;i<D;i++)for(int j=0;j<N;j++) cin >> s[i][j];


	State state(D, 0);
	int maxScore = state.score;
	State bestState = state;
	cerr << "init " << maxScore << endl;
	while(1){
		int t = elapsedTime();
		int rest = 2000 - t;
		if (rest < 50) break;

		int idx = rand()%D;
		int newJ = rand()%N;
		int diffScore = state.computeDiffScore(idx, newJ);
		double temp = 10000.0 * exp(-t / 300.0);
		// cerr << temp << endl;
		if (diffScore >= 0 || drand() < exp(diffScore/temp)){
			state.updateLight(idx, newJ, diffScore);
			if (maxScore < state.score){
				bestState = state;
				maxScore = state.score;
				cerr << maxScore << "(temp: " << temp << ")" << endl;
			}
		}
	}	
	for(int i=0;i<D;i++) cout << bestState.ans[i] + 1 << endl;
    return 0;
}




Measured memory_bytes: 4500