#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

auto start = chrono::system_clock::now();

inline double get_time() {
    auto end = chrono::system_clock::now();
    auto dur = end - start;
    double msec = chrono::duration_cast<chrono::milliseconds>(dur).count();
    return msec;
}

int D;
vector<int> c(26);
vector<vector<int>> s;

inline int compute_score(const vector<int>& out) {
    int score = 0;
    vector<int> last(26, -1);
    rep(d, sz(out)) {
        score += s[d][out[d]];
        last[out[d]] = d;
        rep(i, 26) score -= c[i] * (d - last[i]);
    }
    return score;
}

// inline int evaluate(const vector<int>& out, int k) {
//     int score = 0;
//     vector<int> last(26, -1);
//     rep(d, sz(out)) {
//         score += s[d][out[d]];
//         last[out[d]] = d;
//         rep(i, 26) score -= c[i] * (d - last[i]);
//     }
//     for (int d = sz(out); d < min(sz(out) + k, D); ++d) {
//         rep(i, 26) score -= c[i] * (d - last[i]);
//     }
//     return score;
// }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    cin >> D;
    rep(i, 26) cin >> c[i];
    s.resize(D, vector<int>(26));
    rep(i, D) rep(j, 26) cin >> s[i][j];

    // vector<int> best_out;
    // int best_score = numeric_limits<int>::lowest();
    
    // rep(k, 27) {
    //     vector<int> out;
    //     rep(_, D) {
    //         int max_score = numeric_limits<int>::lowest();
    //         int best_i = 0;
    //         rep(i, 26) {
    //             out.push_back(i);
    //             int score = evaluate(out, k);
    //             if (chmax(max_score, score)) best_i = i;
    //             out.pop_back();
    //         }
    //         out.push_back(best_i);
    //     }
    //     int total_score = compute_score(out);
    //     if (chmax(best_score, total_score)) best_out = out;
    // }

    // rep(d, D) cout << best_out[d] + 1 << endl;

    random_device rnd;
    mt19937 mt(rnd());
    uniform_int_distribution<> rand_d(0, D-1);
    uniform_int_distribution<> rand_d1(0, D-2);
    uniform_int_distribution<> rand_i(0, 25);
    uniform_int_distribution<> rand_type(0, 1);
    // int to_d = rand_d(mt);
    // int to_t = rand_t(mt);

    vector<int> out(D);
    rep(i, D) out[i] = rand_i(mt);
    int score = compute_score(out);
    const int TL = 1950;
    while (get_time() < TL) {
        if (rand_type(mt) == 0) {
            int d = rand_d(mt);
            int i = rand_i(mt);
            int old = out[d];
            out[d] = i;
            int new_score = compute_score(out);
            if (!chmax(score, new_score)) out[d] = old;
        } else {
            int d1 = rand_d1(mt);
            uniform_int_distribution<> rand_d2(d1 + 1, min(D - 1, d1 + 16));
            int d2 = rand_d2(mt);
            swap(out[d1], out[d2]);
            int new_score = compute_score(out);
            if (!chmax(score, new_score)) swap(out[d1], out[d2]);
        }
    }
    
    rep(i, D) cout << out[i] + 1 << endl;
}


Measured memory_bytes: 3692