import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdlib, std.datetime;

immutable int N = 26;
//immutable int D = 365;
int D;
long[] C;
long[][] S;

void main() {
    auto stattime = Clock.currTime();
    D = readln.chomp.to!int;
    C = readln.split.map!(to!long).array;
    S = iota(D).map!(_ => readln.split.map!(to!long).array).array;

    auto ans = gen_initital_ans();
    auto score = calc_score(ans);

    while ((Clock.currTime - stattime).total!"msecs" < dur!"msecs"(1980).total!"msecs") {
        auto idx = uniform(0, D);
        auto next = uniform(0, N);
        auto cur = ans[idx];

        ans[idx] = next;
        auto next_score = calc_score(ans);
        if (next_score >= score) {
            score = next_score;
        } else {
            ans[idx] = cur;
        }
    }

    ans.each!(a => writeln(a+1));
}

int[] gen_initital_ans() {
    auto ans = new int[](D);
    auto prev = new int[](N);
    prev[] = -1;

    foreach (i; 0..D) {
        int best_idx = -1;
        long best_score = -(1L << 59);
        foreach (j; 0..N) {
            long minus = (i - prev[j]) * C[j];
            long plus = S[i][j];
            long score = minus + plus;
            if (score >= best_score) {
                best_score = score;
                best_idx = j;
            }
        }
        ans[i] = best_idx;
        prev[best_idx] = i;
    }
    return ans;
}

long calc_score(const ref int[] ans) {
    auto prev = new int[](N);
    long score = 0;
    foreach (i, a; ans) {
        score += S[i][a];
        score -= decrease(C[a], prev[a], i.to!int);
        prev[a] = i.to!int;
    }
    foreach (a; 0..26) {
        score -= decrease(C[a], prev[a], D-1);
    }
    return score;
}

long decrease(long c, int prev, int cur) {
    return (cur - prev - 1) * (cur - prev) / 2 * c;
}
