#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using ll = long long;
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
constexpr long long MOD = 1e9 + 7;

struct XORShift {
    unsigned int x, y, z, w, t;

    XORShift(int seed) {
        mt19937 rnd(seed);
        x = rnd();
        y = rnd();
        z = rnd();
        w = rnd();
        t = 1;
    }

    int rand() {
        t = x ^ (x << 11);
        x = y;
        y = z;
        z = w;
        w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
        return w & 0x7fffffff;
    }
} rnd(rand());

struct Timer {
    chrono::high_resolution_clock::time_point start, now;

    Timer() {
        start = chrono::high_resolution_clock::now();
    }

    double getTime() {
        now = chrono::high_resolution_clock::now();
        return chrono::duration<double>(now - start).count();
    }
};

constexpr int N = 26;
constexpr int D = 365;
int c[N];
int s[D][N];

struct STATE {
    int contests[D];
    int score;
};

void init(STATE& state) {
    state.score = 0;
    int last[N];
    fill(last, last + N, -1);
    rep(i, D) {
        int csum = 0;
        rep(j, N) {
            csum += c[j] * (i - last[j]);
        }
        int mx = -INF;
        int select = -1;
        rep(j, N) {
            if (s[i][j] > mx) {
                mx = s[i][j] - csum + c[j] * (i - last[j]);
                select = j;
            }
        }
        state.contests[i] = select;
        state.score += mx;
        last[select] = i;
    }
}

void modify(STATE& state) {
    int d = rnd.rand() % D, nc = rnd.rand() % N;
    int pc = state.contests[d];
    state.score -= s[d][pc];
    state.score += s[d][nc];
    int last = d;
    while (last >= 0 && state.contests[last] != nc) {
        last--;
    }
    for (int i = d; i < D; i++) {
        if (state.contests[i] == nc) break;
        state.score += c[nc] * (i - last);
        state.score -= c[nc] * (i - d);
    }
    state.contests[d] = nc;
    last = d;
    while (last >= 0 && state.contests[last] != pc) {
        last--;
    }
    for (int i = d; i < D; i++) {
        if (state.contests[i] == pc) break;
        state.score -= c[pc] * (i - last);
        state.score += c[pc] * (i - d);
    }
}

STATE state;
constexpr double TIMELIMIT = 1.9;

int cnt;

void SA() {
    init(state);
    double starttemp = 9000, endtemp = 1.0;
    Timer tmr;
    double startclock = tmr.getTime();
    double nowclock;
    while (true) {
        if (cnt % 1000 == 0) nowclock = tmr.getTime();
        if (nowclock - startclock > TIMELIMIT) break;
        STATE newstate = state;
        modify(newstate);
        double temp = starttemp + (endtemp - starttemp) *
                                      (nowclock - startclock) / TIMELIMIT;
        double prob = exp((newstate.score - state.score) / temp);
        if (prob > (rnd.rand() % (int)1e9) / 1e9) {
            state = newstate;
        }
        cnt++;
    }
}

signed main() {
    int t;
    cin >> t;
    rep(i, N) {
        cin >> c[i];
    }
    rep(i, D) {
        rep(j, N) {
            cin >> s[i][j];
        }
    }
    SA();
    rep(i, D) {
        cout << state.contests[i] + 1 << endl;
    }
    /*
    cout << "score : " << state.score << endl;
    cout << "cnt : " << cnt << endl;
    */
    return 0;
}

Measured memory_bytes: 4328