#include <bits/stdc++.h>
using namespace std;

const double TL = 1.9;

class State
{
public:
    int D;
    vector<int> c;
    vector<vector<int>> s;
    vector<int> t;
    int64_t score;
    vector<vector<int>> ds;

    State(int D, vector<int> c, vector<vector<int>> s, vector<int> t) : D(D), c(c), s(s), t(t)
    {
        score = 0;
        ds = vector<vector<int>>(26);
        vector<int> last(26, -1);
        for (int d = 0; d < D; d++)
        {
            last.at(t.at(d)) = d;
            score += s.at(d).at(t.at(d));
            for (int i = 0; i < 26; i++)
            {
                if (i == t.at(d))
                    continue;
                score -= c.at(i) * (d - last.at(i));
            }
            ds.at(t.at(d)).push_back(d);
        }
    }

    int sum(int x)
    {
        return x * (x + 1) / 2;
    }

    void change(int d, int td_new)
    {
        int td_old = t.at(d);

        {
            int idx = 0;
            while (idx < (int)ds.at(td_old).size() && ds.at(td_old).at(idx) != d)
                idx++;
            int d_prev = (idx - 1 < 0) ? -1 : ds.at(td_old).at(idx - 1);
            int d_next = (idx + 1 >= (int)ds.at(td_old).size()) ? D : ds.at(td_old).at(idx + 1);
            score -= s.at(d).at(td_old);
            score += sum(d - 1 - d_prev) * c.at(td_old);
            score += sum(d_next - 1 - d) * c.at(td_old);
            score -= sum(d_next - 1 - d_prev) * c.at(td_old);
            ds.at(td_old).erase(ds.at(td_old).begin() + idx);
        }
        {
            int idx = 0;
            while (idx < (int)ds.at(td_new).size() && ds.at(td_new).at(idx) < d)
                idx++;
            int d_prev = (idx - 1 < 0) ? -1 : ds.at(td_new).at(idx - 1);
            int d_next = (idx >= (int)ds.at(td_new).size()) ? D : ds.at(td_new).at(idx);
            score += s.at(d).at(td_new);
            score -= sum(d - 1 - d_prev) * c.at(td_new);
            score -= sum(d_next - 1 - d) * c.at(td_new);
            score += sum(d_next - 1 - d_prev) * c.at(td_new);
            ds.at(td_new).insert(ds.at(td_new).begin() + idx, d);
        }

        t.at(d) = td_new;
    }
};

vector<int> greedy(int D, vector<int> c, vector<vector<int>> s)
{
    vector<int> res(D);
    vector<int> last(26, -1);
    int score = 0;
    for (int d = 0; d < D; d++)
    {
        int max_score_d = -1e9, max_td = -1;
        for (int td = 0; td < 26; td++)
        {
            int score_d = score;
            score_d += s.at(d).at(td);
            for (int i = 0; i < 26; i++)
            {
                if (i == td)
                    continue;
                score_d -= c.at(i) * (d - last.at(i));
            }
            if (max_score_d < score_d)
            {
                max_score_d = score_d;
                max_td = td;
            }
        }
        res.at(d) = max_td;
        last.at(max_td) = d;
        score = max_score_d;
    }
    return res;
}

void solve(int D, vector<int> c, vector<vector<int>> s)
{
    vector<int> t = greedy(D, c, s);
    State state = State(D, c, s, t);

    random_device rnd;
    mt19937 mt(rnd());
    uniform_int_distribution dist_d(0, D - 1);
    uniform_int_distribution dist_q(0, 25);
    while ((double)clock() / CLOCKS_PER_SEC < TL)
    {
        int d = dist_d(mt), td_new = dist_q(mt);
        int td_old = state.t.at(d);
        int64_t score_old = state.score;
        state.change(d, td_new);
        int64_t score_new = state.score;
        if (score_new < score_old)
            state.change(d, td_old);
        // cerr << d << " " << td_new << " " << score_old << " " << score_new << " " << state.score << endl;
    }

    for (int d = 0; d < D; d++)
    {
        cout << state.t.at(d) + 1 << endl;
    }
}

int main()
{
    int D;
    cin >> D;
    vector<int> c(26);
    for (int i = 0; i < 26; i++)
    {
        cin >> c.at(i);
    }
    vector<vector<int>> s(D, vector<int>(26));
    for (int i = 0; i < D; i++)
    {
        for (int j = 0; j < 26; j++)
        {
            cin >> s.at(i).at(j);
        }
    }
    solve(D, move(c), move(s));
    return 0;
}


Measured memory_bytes: 3812