#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <bitset>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <functional>
#include <stack>
#include <cmath>
#include <string>
#include <chrono>

using namespace std;

using ll = long long;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()

// A random number generator using Xorshift128
struct Random {
    unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;

    unsigned int xorshift() {
        unsigned int t;
        t = x ^ (x << 11);
        x = y; y = z; z = w;
        return w = w ^ (w >> 19) ^ (t ^ (t >> 8));
    }

    // returns a random integer in the range [0, n)
    int next_int(int n) {
        return xorshift() % n;
    }

    // returns a random double number in the range [0, 1)
    double next_double() {
        return xorshift() * (1.0 / 0xFFFFFFFFu);
    }
} rng;

struct Timer {
    chrono::steady_clock::time_point start_time;

    void start() {
        start_time = chrono::steady_clock::now();
    }

    long long get_time() {
        auto cur_time = chrono::steady_clock::now();
        return chrono::duration_cast<chrono::milliseconds>(cur_time - start_time).count();
    }
} timer;

/***************************************************************
 * CODE BELOW
 ***************************************************************/

#define DEBUG

int D = 365;
vector<int> c(26);
vector<vector<int>> s(D, vector<int>(26));
vector<int> solution(D);
vector<int> last(26);
vector<ll> scores(26);

ll calc_contest_score(const vector<int>& sol, int i) {
    last[i] = scores[i] = 0;
    REP(d, D) {
        if (i == sol[d]) {
            scores[i] += s[d][i];
            last[i] = d + 1;
        }
        scores[i] -= (d + 1 - last[i]) * c[i];
    }
    return scores[i];
}

ll calc_score(const vector<int>& sol) {
    ll score = 1e6;
    REP(i, 26) score += calc_contest_score(sol, i);
    return max(score, 0ll);
}

void simulated_annealing() {

    ll cur_time = 0;
    const ll DURATION = 1900;

    double temperature = 1.0;

    vector<int> cur_state = solution;

    ll cur_score = calc_score(cur_state);
    ll best_score = cur_score;

    int iter = 0;
    timer.start();

    while (true) {
        // check the time and update the temperature
        if (iter % 100 == 0) {
            cur_time = timer.get_time();
            if (cur_time > DURATION) break;
            temperature = (double) (DURATION - cur_time) / DURATION;
        }

        // get the next state
        int type = rng.next_int(2);
        int d = rng.next_int(D);
        int i = cur_state[d];
        int j = rng.next_int(26);
        cur_state[d] = j;

        // calculate the score of the next state
        // ll next_score = calc_score(cur_state);
        ll prevscore_i = scores[i], prevscore_j = scores[j];
        ll next_score = cur_score;
        next_score -= prevscore_i + prevscore_j;
        next_score += calc_contest_score(cur_state, i) + calc_contest_score(cur_state, j);

        // if the score improved or force_next is true, set the neighbor as the current node
        const ll R = 10000;
        // bool force_next = temperature > rng.next_double();
        // if (cur_time < 1000) force_next = false;
        const bool force_next = false;

        if (next_score > cur_score || force_next) {
            cur_score = next_score;
        } else {
            // roll back the change
            cur_state[d] = i;
            scores[i] = prevscore_i;
            scores[j] = prevscore_j;
        }

        // save the best state
        if (cur_score > best_score) {
            solution = cur_state;
            best_score = cur_score;
        }

        iter++;
    }

    #ifdef DEBUG
    cerr << "Time elapsed: " << cur_time << endl;
    cerr << "Iterations: " << iter << endl;
    #endif
}

void greedy() {
    fill(ALL(last), 0);

    for (int d = 0; d < D; d++) {
        int j = 0, score = 0;
        for (int i = 0; i < 26; i++) {
            int nscore = s[d][i] + (d - last[i]) * c[i] * 5;
            if (nscore > score) {
                j = i;
                score = nscore;
            }
        }
        last[j] = d + 1;
        solution[d] = j;
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int _D;
    cin >> _D;
    REP(i, 26) cin >> c[i];
    REP(i, D) REP(j, 26) cin >> s[i][j];

    greedy();
    simulated_annealing();

    REP(d, D) cout << solution[d] + 1 << endl;
}

Measured memory_bytes: 3704