#include <bits/stdc++.h>
#include <chrono>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define MOD 1000000007
#define MOD2 998244353
#define INF MOD
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;

#define KIND 26

int D;
int c[KIND];
int s[400][KIND];
Int last[KIND];
std::chrono::time_point<std::chrono::steady_clock> start;


Int range(Int l, Int r) {
    Int len = r - l - 1;
    return -len * (len + 1) / 2;
}

void tic() {
    start = std::chrono::steady_clock::now();
}


double toc() {
    auto now = std::chrono::steady_clock::now();
    std::chrono::duration<double> duration = now - start;
    return duration.count();
}

struct ContestInfo {
    set<Int> held[KIND]; // 開催日
    vector<Int> t;
    int D;
    Int score = 0;
    ContestInfo(int D) : D(D) {
        t.resize(D, -1);
        for (int i = 0; i < KIND; i++) {
            held[i].insert(-1);
            held[i].insert(D);
            score += c[i] * range(-1, D);
        }
    }

    void add(int d, int q) {
        if (t[d] != -1) {
            cout << "add failed" << endl;
            exit(1);
        }
        t[d] = q;
        score += s[d][q];
        held[q].insert(d);
        auto it = held[q].find(d);
        auto rit = next(it);
        auto lit = prev(it);
        score -= c[q] * range(*lit, *rit);
        score += c[q] * range(*it,*rit);
        score += c[q] * range(*lit,*it);
    }

    void erase(int d) {
        if (t[d] == -1) {
            cout << "erase failed" << endl;
            exit(1);
        }
        int q = t[d];
        t[d] = -1;
        score -= s[d][q];
        auto it = held[q].find(d);
        auto rit = next(it);
        auto lit = prev(it);
        score += c[q] * range(*lit, *rit);
        score -= c[q] * range(*it,*rit);
        score -= c[q] * range(*lit,*it);
        held[q].erase(it);
    }
    void change(int d, int q) {
        erase(d);
        add(d, q);
    }

    void output() {
        for (int d = 0; d < D; d++) {
            cout << t[d] + 1 << endl;
        }
    }

};



Int calc_score(vector<Int> t) {
    Int score = 0;
    fill(last, last + KIND, -1);
    for (int d = 0; d < D; d++) {
        score += s[d][t[d]];
        last[t[d]] = d;
        for (int i = 0; i < KIND; i++) {
            score -= c[i] * (d - last[i]);
        }
        // cout << score << endl;
    }
    return score;
}


int main() {
    tic();

    cin >> D;

    for (int i = 0; i < KIND; i++) {
        cin >> c[i];
    }
    for (Int d = 0; d < D; d++) {
        for (Int i = 0; i < KIND; i++) {
            cin >> s[d][i];
        }
    }

    ContestInfo ci(D);
    for (int d = 0; d < D; d++) {
        Int t;
        t = rand() % KIND;
        ci.add(d, t);
    }

    Int current_score = ci.score;

    while (toc() < 1.9) {
        // cout << toc() << endl;
        int d, q;
        d = rand() % D;
        q = rand() % KIND;
        int old = ci.t[d];
        ci.change(d, q);
        Int new_score = ci.score;
        // cout << new_score << endl;
        
        if (new_score < current_score) {
            ci.change(d, old);    
        }
        else {
            current_score = new_score;
        }
        current_score = new_score;
    }
    ci.output();
}

Measured memory_bytes: 3712