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

const int N = 26;
const int D = 365;
const double TIMELIMIT = 1.95;
int d;
int c[N];
int s[D][N];

struct STATE {
    int contests[D];
    /*
    int pre[D][N];
    int nxt[D][N];
    */
    ll score;
};

STATE state;

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

int cnt = 0;

void SA() {
    init(state);
    //cout << state.score << endl;
    double starttemp = 9000.0, endtemp = 1.0;
    int startclock = clock();
    while (true) {
        int nowclock = clock();
        if (nowclock - startclock > TIMELIMIT * CLOCKS_PER_SEC) break;
        STATE newstate = state;
        int d = rnd.rand() % D, cc = rnd.rand() % N;
        int pc = newstate.contests[d];
        newstate.score += s[d][cc];
        int last = d;
        while (last >= 0 && newstate.contests[last] != cc) {
            last--;
        }
        for (int i = d; i < D; i++) {
            if (newstate.contests[i] == cc) break;
            newstate.score += c[cc] * (i - last);
        }
        newstate.contests[d] = cc;
        newstate.score -= s[d][pc];
        last = d;
        while (last >= 0 && newstate.contests[last] != pc) {
            last--;
        }
        for (int i = d; i < D; i++) {
            if (newstate.contests[i] == pc) break;
            newstate.score -= c[pc] * (i - last);
        }
        double temp = starttemp + (endtemp - starttemp) *
                                      (nowclock - startclock) /
                                      (TIMELIMIT * CLOCKS_PER_SEC);
        if (exp((newstate.score - state.score) / temp) >
            (rnd.rand() % INF) / (double)INF) {
            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: 4260