#include"bits/stdc++.h"
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using tp3 = tuple<int, int, int>;
using Mat = vector<vector<ll>>;
constexpr int INF = 1 << 28;
constexpr ll INFL = 1ll << 60;
constexpr int dh[4] = { 0,1,0,-1 };
constexpr int dw[4] = { -1,0,1,0 };
bool isin(const int H, const int W, const int h, const int w) {
    return 0 <= h && h < H && 0 <= w && w < W;
}
// ============ template finished ============

constexpr int D = 365;
constexpr int K = 26;
using Row = array<int, K>;
using Table = array<Row, D>;
using Result = array<int, D>;
using CPResult = array<set<int>, K>; //compressed result

constexpr float maxRand = 2000;
constexpr int LIM_MS = 1900;
constexpr unsigned long BIG = 1ll << 60;
unsigned long xor128() {
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t = (x ^ (x << 11));
    x = y; y = z; z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
bool isChange(int time, int scoreDiff) {
    //return scoreDiff > 0;
    float temp = maxRand * (LIM_MS - time) / 1900;
    float prob = expf((float)scoreDiff / temp);
    float rand = (float)(xor128() % BIG) / BIG;
    //cerr << temp << " " << scoreDiff << endl;
    //cerr << prob << " " << rand << endl;
    //cerr << endl;
    return prob > rand;
}

int penalty(const Row& c, const Row& last, const int use, const int nowDay) {
    int res = 0;
    rep(i, K)if (i != use)res += c[i] * (nowDay - last[i]);
    return res;
}

Result init(const Row& c, const Table& s) {
    Result schedule;
    Row last;
    rep(i, K)last[i] = 0;

    rep(i, D) {
        int score = -INF, res = -1;
        rep(j, K) {
            int tscore = s[i][j] - penalty(c, last, j, i);
            if (tscore > score) {
                score = tscore;
                res = j;
            }
        }
        schedule[i] = res;
        last[res] = i;
    }
    return schedule;
}

ll calcScore(const Row& c, const Table& s, const Result& schedule) {
    ll score = 0;
    Row last;
    rep(i, K)last[i] = 0;
    rep(i, D) {
        score += s[i][schedule[i]];
        last[schedule[i]] = i + 1;
        rep(j, K)score -= c[j] * (i + 1 - last[j]);
    }
    return score;
}

CPResult compress(const Result& schedule) {
    CPResult cpr;
    rep(i, D)cpr[schedule[i]].insert(i);
    return cpr;
}

int findL(const set<int>& days, const int& now) {
    auto itr = days.lower_bound(now);
    if (itr == days.begin())return 0;
    --itr;
    return *itr;
}

int findR(const set<int>& days, const int& now) {
    const auto itr = days.upper_bound(now);
    return itr == days.end() ? D : *itr;
}

int diff(const Row& c, const Table& s, const int& x, const int& kind, const set<int>& days) {
    const int l = findL(days, x), r = findR(days, x);
    return s[x][kind] + c[kind] * (r - x)*(x - l);
}

int main()
{
    using namespace std::chrono;
    auto start = system_clock::now();
    //random_device rnd;
    //mt19937 mt(rnd());
    //uniform_int_distribution<> randD(0, D - 1), randK(0, K - 1);

    int tmp;
    cin >> tmp;

    Row c;
    Table s;
    rep(i, K)cin >> c[i];
    rep(i, D)rep(j, K)cin >> s[i][j];
    auto schedule = init(c, s);
    auto cpr = compress(schedule);
    //cout << calcScore(c, s, schedule) << endl;
    //auto base = schedule;


    while (true) {
        const auto time = duration_cast<milliseconds>(system_clock::now() - start).count();
        if (LIM_MS < time)break;
        rep(i, 100) {
            int x = xor128() % D;
            int alpha = xor128() % K;
            int beta = schedule[x];
            if (alpha == beta)continue;

            int valA = diff(c, s, x, alpha, cpr[alpha]);
            int valB = diff(c, s, x, beta, cpr[beta]);
            int scoreDiff = valA - valB;
            if (isChange(time, scoreDiff)) {
                schedule[x] = alpha;
                cpr[alpha].insert(x);
                cpr[beta].erase(x);

            }
            //cout << "clear" << endl;
            //cerr << x << " " << alpha << " " << beta << " " << valA << "<-" << valB << endl;
        }
    }
    //cout << calcScore(c, s, schedule) << endl;
    //rep(i, D)if (schedule[i] != base[i])cout << i << " ";
    for (auto t : schedule)cout << t + 1 << endl;
    return 0;;
}


Measured memory_bytes: 4004