#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define per(i, b) gnr(i, 0, b)
#define bg begin()
#define ed end()
#define all(x) x.bg, x.ed
#define vi vector<int>
template <class t, class u>
bool chmax(t &a, u b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class t, class u>
bool chmin(t &a, u b)
{
    if (b < a)
    {
        a = b;
        return true;
    }
    return false;
}

int calc_score(vector<int> &sch, vector<int> &c, vector<vector<int>> &s)
{
    int D = sch.size();
    int score = 0;
    vector<int> lastd(26);
    rep(i, D)
    {
        //        cout << score << endl;
        score += s[i][sch[i]];
        lastd[sch[i]] = i + 1;
        rep(j, 26)
        {
            score -= c[j] * (i + 1 - lastd[j]);
        }
    }
    return score;
}

signed main()
{
    int D;
    cin >> D;
    vector<int> c(26);
    vector<vector<int>> s(D, vector<int>(26));

    rep(i, 26)
    {
        cin >> c[i];
    }
    rep(i, D)
    {
        rep(j, 26)
        {
            cin >> s[i][j];
        }
    }
    vector<int> best(D);
    rep(i, D)
    {
        best[i] = i % 26;
    }
    int best_score = -100000000;
    rep(loop, 26)
    {
        vector<int> schedule(D);
        vector<int> lastd(26);
        schedule[0] = loop;
        int score = s[0][loop];
        lastd[loop] = 1;
        rep(i, D)
        {
            if (i == 0)
            {
                continue;
            }
            int tmpscore = -1000000;
            int best_j = -1;
            rep(j, 26)
            {
                int scr = 0;
                rep(k, 26)
                {
                    if (k == j)
                    {
                        scr += s[i][j];
                    }
                    else
                    {
                        scr -= c[k] * (i + 1 - lastd[k]);
                    }
                }
                if (scr > tmpscore)
                {
                    tmpscore = scr;
                    best_j = j;
                }
            }
            schedule[i] = best_j;
            score += tmpscore;
            lastd[best_j] = i + 1;
        }
        //        cout << score << endl;
        // rep(i, D)
        // {
        //     score += s[i][schedule[i]];
        //     lastd[schedule[i]] = i + 1;
        //     rep(j, 26)
        //     {
        //         score -= c[j] * (i + 1 - lastd[j]);
        //     }
        // }

        if (score > best_score)
        {
            best = schedule;
            best_score = score;
        }
        //        cout << score << endl;
        // rep(i, D)
        // {
        //     cout << best[i] << endl;
        // }
    }
    rep(loop, 10000)
    {
        int aa = rand() % D;
        int bb = rand() % 26;
        vector<int> sch = best;
        sch[aa] = bb;
        int sc = calc_score(sch, c, s);
        if (sc > best_score)
        {
            best_score = sc;
            best = sch;
        }
    }
    rep(i, D)
    {
        cout << best[i] + 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 3680