// Slower C++ solution:
#include<iostream>

#include<string>

#include<iomanip>

#include<cmath>

#include<vector>

#include<algorithm>

#include<utility>

#include<cstdlib>

#include<ctime>



using namespace std;



#define int long long

#define endl "\n"



constexpr long long INF = (long long)1e18;

constexpr long long MOD = 1'000'000'007; 



// struct fast_io {

	// fast_io(){

		// std::cin.tie(nullptr);

		// std::ios::sync_with_stdio(false);

	// };

// } fio;



constexpr int num = 26;

int D;

vector<int> c(num);



vector<vector<int>> s; 



int point(vector<int> &t){

	int res = 0;

	

	vector<int> last(num);

	

	for(int i = 0; i < D; i++){

		res += s[i][t[i]];

		

		for(int j = 0; j < num; j++){

			last[j]++;

		}

		

		last[t[i]] = 0;

		

		for(int j = 0; j < num; j++){

			res -= c[j] * last[j];

		}

	}

	

	return res + 1'000'000;

}



vector<int> solve(int Z){

	vector<int> t(D);

	vector<int> con(num);

	vector<int> last(num);

	

	for(int i = 0; i < D; i++){

		

		

		for(int j = 0; j < num; j++){

			cin>>s[i][j];

			

			if(s[i][t[i]] + last[t[i]] * last[t[i]]/Z * c[t[i]] < s[i][j] + last[j] * last[j]/Z * c[j]) {

				

				

				t[i] = j;

			}

		}

		

		for(int j = 0; j < num; j++){

			if(j == t[i]) {

				last[j] = 0;

			} else {

				last[j]++;

			}

		}

		

		con[t[i]]++;

	}

	

	return t;

}



vector<int> t;

int p;



void change(int U){

	vector<int> con1(D), con2(D), con(D);

	vector<int> last(num);

	vector<int> nt(t);

	

	vector<pair<int,int>> s;

	

	for(int i = 0; i < D; i++){

		if(t[i] == U) con1[i] = 0;

		else if(i) con1[i] = con1[i-1] + 1;

		else con1[i] = 1;

		

		// s.push_back({con1[i], i});

	}

	

	for(int i = D-1; i >= 0; i--){

		if(t[i] == U) con2[i] = 0;

		else if(i+1!=D) con2[i] = con2[i+1] + 1;

		else con2[i] = 1;

	}

	

	

	for(int i = 0; i < D; i++){

		s.push_back({min(con1[i], con2[i]), i});

	}

	

	// cout<<"U = "<<U<<endl;

	

	sort(s.begin(), s.end(), greater<pair<int,int>>());

	

	for(int i = 0; i < s.size(); i++){//cout<<"i = "<<i<<endl;

		nt[s[i].second] = U;

		// cout<<s[i].second<<" "<<s[i].first<<endl;

		

		int np = point(nt);

		

		if(p < np) {

			t = nt;

			p = np;

		}

	}

}



vector<pair<int,int>> con(vector<int> &t){

	vector<pair<int,int>> con(num);

	

	for(int i = 0; i < D; i++){

		con[t[i]].first++;

	}

	

	for(int i = 0; i < num; i++){

		// cout<<i<<" "<<con[i].first<<endl;

		con[i].second = i;

	}

	

	sort(con.begin(), con.end());

	

	return con;

}



signed main(){

	cout<<fixed<<setprecision(10);

	

	// vector<int> t;

	// srand(time(NULL));

	

	cin>>D;

	

	// D = 365;

	

	s.resize(D, vector<int>(num));

	t.resize(D, 0);

	

	for(int i = 0; i < num; i++){

		cin>>c[i];

		// c[i] = rand()%100;

	}

	

	// int p;

	

	p = 0;

	// cout<<1<<" "<<p<<endl;

	

	for(int i = 1; i <= 20; i++){

		vector<int> nt;

		

		nt = solve(i);

		int np = point(nt);

		

		if(p < np) {

			t = nt;

			p = np;

		}

	}

	

	vector<pair<int,int>> c = con(t);

	

	for(int i = 0; i < c.size(); i++){//cout<<i<<endl;

		// int x = rand()%num, np;

		// int x = i%num;

		int x = c[i].second;

		int tx;

		vector<int> nt;

		

		change(x);



		

	}

	

	con(t);

	

	for(int i = 0; i < D; i++){

		cout<<t[i]+1<<endl;

	}

	

	// cout<<point(t)<<endl;

	

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1301340706977894x):
#include<iostream>

#include<string>

#include<iomanip>

#include<cmath>

#include<vector>

#include<algorithm>

#include<utility>

#include<cstdlib>

#include<ctime>



using namespace std;



#define int long long

#define endl "\n"



constexpr long long INF = (long long)1e18;

constexpr long long MOD = 1'000'000'007; 



struct fast_io {

	fast_io(){

		std::cin.tie(nullptr);

		std::ios::sync_with_stdio(false);

	};

} fio;



constexpr int num = 26;

int D;

vector<int> c(num);



vector<vector<int>> s; 



int point(vector<int> &t){

	int res = 0;

	

	vector<int> last(num);

	

	for(int i = 0; i < D; i++){

		res += s[i][t[i]];

		

		for(int j = 0; j < num; j++){

			last[j]++;

		}

		

		last[t[i]] = 0;

		

		for(int j = 0; j < num; j++){

			res -= c[j] * last[j];

		}

	}

	

	return res + 1'000'000;

}



vector<int> solve(int Z){

	vector<int> t(D);

	

	vector<int> last(num);

	

	for(int i = 0; i < D; i++){

		for(int j = 0; j < num; j++){

			cin>>s[i][j];

			if(s[i][t[i]] + last[t[i]] * last[t[i]]/Z * c[t[i]] < s[i][j] + last[j] * last[j]/Z * c[j]) {

				t[i] = j;

			}

		}

		

		for(int j = 0; j < num; j++){

			if(j == t[i]) {

				last[j] = 0;

			} else {

				last[j]++;

			}

		}

	}

	

	return t;

}



signed main(){

	cout<<fixed<<setprecision(10);

	

	vector<int> t;

	

	

	cin>>D;

	

	s.resize(D, vector<int>(num));

	t.resize(D, 0);

	

	for(int i = 0; i < num; i++){

		cin>>c[i];

	}

	

	int p = 0;

	

	// for(int i = 1; i < 10; i++){

		// vector<int> nt;

		

		// nt = solve(i);

		// int np = point(nt);

		

		// if(p < np) {

			// t = nt;

			// p = np;

		// }

	// }



	t = solve(5);

	

	for(int i = 0; i < D; i++){

		cout<<t[i]+1<<endl;

	}

	

	return 0;

}