#include <bits/stdc++.h>
using namespace std;
 
#define lli long long int
#define REP(i,s,n) for(lli i=s;i<n;i++)
#define NUM 2520
#define INF (1LL<<50)
#define DEBUG 0
#define mp(a,b) make_pair(a,b)
#define SORT(V) sort(V.begin(),V.end())
#define PI (3.141592653589794)
#define TO_STRING(VariableName) # VariableName
#define LOG(x) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<endl;
#define LOG2(x,y) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<endl;
#define LOG3(x,y,z) if(DEBUG)cout<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
#define LOG4(w,x,y,z) if(DEBUG)cout<<TO_STRING(w)<<"="<<w<<" "<<TO_STRING(x)<<"="<<x<<" "<<TO_STRING(y)<<"="<<y<<" "<<TO_STRING(z)<<"="<<z<<endl;
 
template<class T>bool chmax(T & a, const T & b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

lli d;
lli c[26];
lli s[370][26];
lli bestT[370];
lli t[370];
lli lastDay[26];
std::chrono::system_clock::time_point start;

lli score(){

	lli ans = 0;
	REP(i,0,26)lastDay[i]=0;

	REP(i,1,d+1){
		ans += s[i-1][t[i-1]];

		lastDay[t[i-1]] = i;
		REP(j,0,26){
			ans -= c[j]*(i-lastDay[j]);
		}
		//cout<<ans<<endl;
	}
	return ans;
}

lli bestScore(){
	lli ans = 0;
	REP(i,0,26)lastDay[i]=0;

	REP(i,1,d+1){
		ans += s[i-1][bestT[i-1]];

		lastDay[bestT[i-1]] = i;
		REP(j,0,26){
			ans -= c[j]*(i-lastDay[j]);
		}
		//cout<<ans<<endl;
	}
	return ans;
}

void dummyDayInput(){

	REP(i,0,d){
		cin>>t[i];
		//t[i]=1;
		t[i]--;
	}

}

void input(){
	cin>>d;
	REP(i,0,26)cin>>c[i];
	REP(i,0,d){
		REP(j,0,26){
			cin>>s[i][j];
		}
	}
}

void dummyDayChangeInput(){
	lli m;
	cin>>m;

	REP(i,0,m){
		lli d,q;
		cin>>d>>q;
		d--,q--;
		t[d] = q;
		cout<<score()<<endl;
	}
}

void init(){
	REP(i,0,365){
		lli maxD = -1;
		double maxScore = -INF;
		REP(j,0,26){
			if(maxScore<s[i][j]+c[j]*(i-lastDay[j]+1)*2){
				maxScore = s[i][j]+c[j]*(i-lastDay[j]+1)*2;
				maxD = j;
			}
		}
		t[i] = maxD;
		bestT[i] = maxD;
		lastDay[maxD] = i;
	}
}

void outputT(){
	REP(i,0,d){
		cout<<t[i]+1<<endl;
	}
}
void outputBestT(){
	REP(i,0,d){
		cout<<bestT[i]+1<<endl;
	}
}
uniform_int_distribution<int> rateR(0,9999);
mt19937 mt{std::random_device{}()};
const lli endT = 2000*1000;

lli fCnt=0;
bool force(double elapsed){
	lli R = 10000;
	return false;
	if(R*(endT-elapsed) > 4*endT*(rateR(mt)%R)){
		fCnt++;
		return true;
	}
	else return false;
}

int main(){

	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	start = std::chrono::system_clock::now();
	mt19937 mt{std::random_device{}()};

	const lli T = 1950*1000;

	input();
	init();

	uniform_int_distribution<int> contestDist(0,25);
	uniform_int_distribution<int> dayDist(0,d-1);

	lli prevScore=score();
	lli bestScore = prevScore;

	lli cnt = 0;
	bool check = false;

	double elapsed;
	while(1){
        if(check || cnt%10000==0){
	        std::chrono::system_clock::time_point now = std::chrono::system_clock::now();
    	    elapsed = std::chrono::duration_cast<std::chrono::microseconds>(now-start).count();
    	    if(elapsed > 1700*1000){
    	    	check = true;
    	    }
        	if(elapsed > T)break;
        }

        lli contestD = contestDist(mt);
        lli dayD     = dayDist(mt);

        LOG2(contestD,dayD);

        lli prevContest = t[dayD];
        t[dayD] = contestD;


        lli nowScore = score();
        bool changeForce = force(elapsed);

        LOG2(nowScore,bestScore);
        if(nowScore > bestScore){
        	REP(i,0,d){
        		bestT[i] = t[i];
        	}
        	bestScore = nowScore;
        }
        
        if(nowScore > prevScore || changeForce)
        {
        	prevScore = nowScore;
        }
        else{
        	t[dayD] = prevContest;
        }

        cnt++;
	}

	outputBestT();
	//dummyDayInput();
	//score();
	//dummyDayChangeInput();
 
	return 0;
}

Measured memory_bytes: 3760