#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

const int D = 365;
vector<int> c(26);
vector<vector<int>> s(D, vector<int>(26));

struct State {
    vector<int> contest;
    vector<ll> scores;
    ll score = -1;
    int type, before, after, day, day1, day2;
    ll prevscore_before, prevscore_after;

    State() {
        contest.resize(D);
        scores.resize(26);
    }

    void move() {
        type = rng.next_int(2);
        if (type == 0) {
            // pick a day and change the contest type
            day = rng.next_int(D);
            before = contest[day];
            after = rng.next_int(26);
            contest[day] = after;
        } else {
            // swap two days
            day1 = rng.next_int(D);
            day2 = rng.next_int(D);
            before = contest[day1];
            after = contest[day2];
            swap(contest[day1], contest[day2]);
        }

        prevscore_before = scores[before];
        prevscore_after = scores[after];
        score -= scores[before] + scores[after];
        scores[before] = calc_contest_score(before);
        scores[after] = calc_contest_score(after);
        score += scores[before] + scores[after];
    }

    void move_back() {
        score -= scores[before] + scores[after];
        scores[before] = prevscore_before;
        scores[after] = prevscore_after;
        score += scores[before] + scores[after];

        if (type == 0) {
            contest[day] = before;
        } else {
            swap(contest[day1], contest[day2]);
        }
    }

    ll calc_contest_score(int i) {
        int last = 0;
        scores[i] = 0;
        REP(d, D) {
            if (i == contest[d]) {
                scores[i] += s[d][i];
                last = d + 1;
            }
            scores[i] -= (d + 1 - last) * c[i];
        }
        return scores[i];
    }

    ll calc_score() {
        score = 1e6;
        REP(i, 26) score += calc_contest_score(i);
        return score = max(score, 0ll);
    }
};

State best_state;

double accept(ll prev_score, ll cur_score, double temperature) {
    if (prev_score < cur_score) return 1.0;
    return exp((double) (cur_score - prev_score) / temperature);
}

void simulated_annealing(ll duration) {

    const double BASE_TEMPERATURE = 2e3;
    double temperature = BASE_TEMPERATURE;

    State cur_state = best_state;
    int iter = 0;
    ll cur_time = 0;
    timer.start();

    while ((cur_time = timer.get_time()) < duration) {
        temperature = BASE_TEMPERATURE * (duration - cur_time) / duration;

        #ifdef DEBUG
        if (iter % 50000 == 0) cerr << temperature << endl;
        #endif

        ll prev_score = cur_state.score;
        cur_state.move();

        if (accept(prev_score, cur_state.score, temperature) > rng.next_double()) {
            if (cur_state.score > best_state.score) {
                best_state = cur_state;
            }
        } else {
            cur_state.move_back();
        }

        iter++;
    }

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

void greedy() {
    for (int factor = 1; factor <= 5; factor++) {
        vector<int> last(26);
        State state;
        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] * factor;
                if (nscore > score) {
                    j = i;
                    score = nscore;
                }
            }
            last[j] = d + 1;
            state.contest[d] = j;
        }
        state.calc_score();
        if (state.score > best_state.score) {
            best_state = state;
        }
    }
}

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(1950);

    REP(d, D) cout << best_state.contest[d] + 1 << endl;
}

Measured memory_bytes: 4472