#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
#include <numeric> //lcm
#include <iomanip> //double精度 setprecision
#include <chrono>

using namespace std;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = n-1; i >= 0; --i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define rrep1(i,n) for(int i = (n); i >= 1; --i)
#define REP(i,n,m) for(int i = (n); i < (m); ++i)
#define all(vec) (vec).begin(),(vec).end()

#define debug(vec) for(auto v : vec) cerr << v << " "; cerr << endl;
#define debug2D(vec2D, w) for(auto vec : vec2D) { for (auto v : vec) cerr << setw(w) << v << " "; cerr << endl; } 
#define debugP(vec) for(auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl;
#define debug2DP(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl; } 

const char en = '\n';

typedef long long ll;

constexpr ll INF = 1000000000; //10^10
//const ll MOD = 998244353;
constexpr ll MOD = 1000000007;

typedef ll Weight;
void add_edge(vector<vector<Weight>>& g, Weight from, Weight to, bool isDirected) {
	g[from].push_back(to);
	if (!isDirected) g[to].push_back(from);
}

template<class T> inline bool chmax(T& a, T b) { if (a <= b) { a = b; return true; } else return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } else return false; }

int d = 365;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  cin >> d;
	int c[26];
	rep(i,26) cin >> c[i];
	// int s[365][26];
	vector<vector<int>> s(d, vector<int>(26));
	// int t[365];
	vector<int> t(d);
	set<int> last[26];
	rep(i,26) last[i].insert(-1);
	auto prevday = [&last, &t](int day,int contest) {
	  auto it = last[contest].lower_bound(day);
	  if (it == last[contest].end() || *it != day) return *prev(it);
	  else /*(*it == day)*/ return day;
	};

	rep(i,d) { 
	  int maxt = -1, maxcontest = -1;
	  rep(j,26) { 
		  cin >> s[i][j];
			if (chmax(maxt, s[i][j])) maxcontest = j;
		}
		t[i] = maxcontest;
	}

	chrono::system_clock::time_point start, end;

	start = chrono::system_clock::now();

	rep(i,d) { cerr << t[i] << " ";} cerr << en;

	rep(i,d) { 
	  last[t[i]].insert(i);
	}

	//cerr << "t : ";
	//for(auto ti : t) cerr << ti << " " ; cerr << endl;
	//rep(i,26) { for(auto day : last[i])  cerr << day << " "; cerr << endl;}

	auto score = [&last, &c, &s, &t, prevday]() {
		ll ret = 0;
		rep(i, d) {
		  ret += s[i][t[i]];
			rep(j,26) ret -= (ll) c[j]*(i - prevday(i,j));
			//cout << ret << endl;
		}
		return ret;
	};

	ll ans = score();

	auto modify = [&](int day, int q) {
	  ll ans0 = 0;
	  ans0 -= s[day][t[day]];
		ans0 += c[t[day]]*(day - prevday(day,t[day]));
		last[t[day]].erase(day);
		last[q].insert(day);
		ans0 += s[day][q];
		ans0 -= c[q] * (day - prevday(day, q));

		if (ans0 >= 0) { ans += ans0;
		t[day] = q;
		}
		//cout << ans << endl;
	};

	end = chrono::system_clock::now();
	while (static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) < 1950) {
	  rep(i,d) rep(j,26) modify(i,j);
		end = chrono::system_clock::now();
		//cout << ans << endl;
	}
	for(auto ti : t) cout << ti+1 << endl;
}


Measured memory_bytes: 4152