#include "bits/stdc++.h"
using namespace std;

#define dump(...) DUMPOUT<<"  ";DUMPOUT<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<std::endl;DUMPOUT<<"    ";dump_func(__VA_ARGS__)
#define PI 3.14159265358979323846
#define EPS 1e-10
#define FOR(i,a,n) for(int i=(a);i<(n);++i)
#define REP(i,n)  FOR(i,0,n)
#define all(j) (j).begin(), (j).end()
#define SZ(j) ((int)(j).size())

int D = 365;
const int T = 26;

vector<int> c(T);
vector<vector<int>> s(D, vector<int>(T)); 

long long eval(vector<int> out, int k) {
    long long score = 0;
    vector<int> last(T, 0);
    REP(d, (int)out.size()) {
        last[out[d]-1] = d+1;
        REP(i, T) {
            score -= (long long)(d+1 - last[i]) * c[i];
        }
        score += s[d][out[d]-1];
    }
    FOR(d, (int)out.size(), min(D, (int)out.size()+k)) {
        REP(i, T) {
            score -= (long long)(d+1 - last[i]) * c[i];
        }
    }

    return score;
}

long long compute_score(vector<int> out) {
    long long score = 0;
    vector<int> last(T, 0);
    REP(d, (int)out.size()) {
        last[out[d]-1] = d+1;
        REP(i, T) {
            score -= (long long)(d+1 - last[i]) * c[i];
        }
        score += s[d][out[d]-1];

        // cout << score << endl;
    }

    return score;
}

vector<int> greedy_cand(int k) {
    vector<int> out;
    REP(_, D) {
        int best_i = 1;
        long long max_score = -(1e18);
        FOR(i, 1, T+1) {
            out.emplace_back(i);
            long long score = eval(out, k);
            if (max_score < score) {
                max_score = score;
                best_i = i;
            }

            out.pop_back(); 
        }
        out.emplace_back(best_i);
    }

    return out;
}

vector<int> greedy() {
    vector<int> out = greedy_cand(13);
    long long max_eval = eval(out, 13);
    REP(k, 26) {
        vector<int> o = greedy_cand(k);
        long long eval_v = eval(o, k);
        if (max_eval < eval_v) {
            out = o;
            max_eval = eval_v;
        }
    }

    return out;
}

vector<int> solve() { 
    std::random_device seed_gen;
    std::mt19937 engine(seed_gen());

    std::uniform_int_distribution<> dist(1, 26);
    std::uniform_int_distribution<> distD(0, D-1);
    std::uniform_int_distribution<> distD1(0, D-2);
    std::uniform_real_distribution<> distS(0, 1);
    vector<int> out(D);
    REP(i, D) out[i] = dist(engine);
    long long score = compute_score(out);
    double TL = 1950;
    chrono::system_clock::time_point  start, end;
    start = chrono::system_clock::now();
    end = std::chrono::system_clock::now();
    while (chrono::duration_cast<chrono::milliseconds>(end-start).count() < TL)
    {
        if (distS(engine) < 0.5) {
            int d = distD(engine);
            int q = dist(engine);
            int old = out[d];
            out[d] = q;
            long long new_score = compute_score(out);
            if (new_score < score) {
                out[d] = old;
            } else {
                score = new_score;
            }
        } else {
            int d1 = distD1(engine);
            std::uniform_int_distribution<> distD2(d1+1, min(D-1, d1+16));
            int d2 = distD2(engine);
            assert(0 <= d1 and d1 < D);
            assert(0 <= d2 and d2 < D);
            swap(out[d1], out[d2]);
            long long new_score = compute_score(out);
            if (new_score < score) {
                swap(out[d1], out[d2]);
            } else {
                score = new_score;
            }
        }
        
        end = std::chrono::system_clock::now();
    }

    return out;
}

void test_score() {
    vector<int> t(D);
    REP(i, D) cin >> t[i];
    compute_score(t);
}

int main(int argc, char const *argv[])
{
    int d_;
    cin >> d_;
    D = d_;
    
    REP(i, T) cin >> c[i];
    REP(i, D) REP(j, T) cin >> s[i][j];

    
    vector<int> out = solve();
    assert(out.size() == D);
    for (int t : out) {
        cout << t << endl;
    }

    return 0;
}


Measured memory_bytes: 3652