#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned ll
#define PI acos(-1)
#define vi vector<int>
#define pi pair<int, int>
#define pl pair<ll, ll>
template<typename T> using v2 = vector<vector<T>>;
template<typename T> using v3 = vector<vector<vector<T>>>;
template<class T> istream &operator>>(istream&is,vector<T>&v){for(auto &elemnt:v)is>>elemnt;return is;}
template<class T,class U> istream &operator>>(istream&is,pair<T,U>&p){is>>p.first>>p.second;return is;}
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; }
const int MOD = 1e9 + 7;
const int INF = 1e9 + 200;
const ll INFLL = 2e18 + 200;

struct info {
    vector<ll> contest, minus;
    ll score;

    info(ll value) {
        contest = vector<ll>();
        minus = vector<ll>(26, 0);
        score = value;
    }

    info() {
        contest = vector<ll>();
        minus = vector<ll>(26, 0);
        score = 0;
    }
};

int main() {
    ll D;
    cin >> D;
    vector<ll> c(26);
    cin >> c;
    vector<vector<ll>> satisfaction(26, vector<ll>(D + 1));
    for (int i = 1; i <= D; i++) {
        for (int j = 0; j < 26; j++) {
            ll temp;
            cin >> temp;
            satisfaction[j][i] = temp;
        }
    }
    vector<vector<info>> normal_dp(D + 1, vector<info>(26));
    vector<vector<info>> minus_dp(D + 1, vector<info>(26));
    vector<vector<info>> minus2_dp(D + 1, vector<info>(26));
    vector<vector<info>> ans_dp(D + 1, vector<info>(26));
    for (int day = 1; day <= D; day++) {
        for (int now = 0; now < 26; now++) {
            for (int before = 0; before < 26; before++) {
                auto normal = [&](info &update, info before_info) {
                    for (int i = 0; i < 26; i++) {
                        before_info.minus[i] += c[i];
                    }
                    before_info.contest.push_back(now);
                    before_info.minus[now] = 0;
                    before_info.score += satisfaction[now][day];
                    for (int i = 0; i < 26; i++) {
                        before_info.score -= before_info.minus[i];
                    }
                    if (update.contest.empty()) {
                        update = before_info;
                        return;
                    }
                    if (update.score == before_info.score) {
                        ll left = 0, right = 0;
                        for (int i = 0; i < 26; i++) {
                            left += update.minus[i];
                            right += before_info.minus[i];
                        }
                        if (left > right) update = before_info;
                        return;
                    }
                    if (update.score < before_info.score) update = before_info;
                };

                auto minus = [&](info &update, info before_info) {
                    for (int i = 0; i < 26; i++) {
                        before_info.minus[i] += c[i];
                    }
                    before_info.contest.push_back(now);
                    before_info.minus[now] = 0;
                    before_info.score += satisfaction[now][day];
                    for (int i = 0; i < 26; i++) {
                        before_info.score -= before_info.minus[i];
                    }
                    if (update.contest.empty()) {
                        update = before_info;
                        return;
                    }
                    ll left = 0, right = 0;
                    for (int i = 0; i < 26; i++) {
                        left += update.minus[i];
                        right += before_info.minus[i];
                    }
                    if (left > right) update = before_info;
                    if (left == right) {
                        if (update.score < before_info.score) update = before_info;
                    }
                    return;
                };

                auto ans = [&]() {
                    for (int i = 0; i < 4; i++) {
                        auto before_info = normal_dp[day][now];
                        if (i == 1) before_info = minus_dp[day][now];
                        if (i == 2) before_info = minus2_dp[day][now];
                        if (i == 3) before_info = ans_dp[day][now];
                        normal(ans_dp[day][now], before_info);
                    }
                };
                normal(normal_dp[day][now], normal_dp[day - 1][before]);;
                minus(minus_dp[day][now], normal_dp[day - 1][before]);
                minus(minus2_dp[day][now],  minus_dp[day - 1][before]);
                ans();
            }
        }
    }
    auto ans = ans_dp[D][0];
    for (int i = 0; i < 26; i++) {
        if (ans.score < ans_dp[D][i].score) ans = ans_dp[D][i];
        if (ans.score < normal_dp[D][i].score) ans = normal_dp[D][i];
        if (ans.score < minus_dp[D][i].score) ans = minus_dp[D][i];
        if (ans.score < minus2_dp[D][i].score) ans = minus2_dp[D][i];
    }
    for (int i = 0; i < D; i++) {
        cout << ans.contest[i] + 1 << endl;
    }
}


Measured memory_bytes: 71488