//
// Created by yamunaku on 2020/06/28.
//

#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repl(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perl(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD9 998244353
#define MOD1 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)
#define CST(x) cout<<fixed<<setprecision(x)

using ll = long long;
using ld = long double;
using vi = vector<int>;
using mti = vector<vector<int>>;
using vl = vector<ll>;
using mtl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
template<typename T>
using heap = priority_queue<T, vector<T>, function<bool(const T, const T)>>;

int d;
vi c;
mti s;
vi sched;
vector<set<int>> last;
int score = 0;

unsigned long long xor128(){
    static unsigned long long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long long t = (x ^ (x << 11));
    x = y;
    y = z;
    z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

int init_score(){
    int score = 0;
    rep(t, d){
        int x = sched[t];
        last[x].insert(t);
        score += s[t][x];
        rep(i, 26){
            score -= c[i] * (t - (*last[i].rbegin()));
        }
    }
    return score;
}

inline int sub(int d){
    return d * (d - 1) / 2;
}

int del_score(int day, int from, int to){
    int delta = s[day][to] - s[day][from];
    int l, r;
    auto itr = last[from].upper_bound(day);
    r = *itr;
    itr--;
    itr--;
    l = *itr;
    delta += c[from] * (sub(day - l) + sub(r - day) - sub(r - l));
    itr = last[to].upper_bound(day);
    r = *itr;
    itr--;
    l = *itr;
    delta += c[to] * (-sub(day - l) - sub(r - day) + sub(r - l));
    return delta;
}

void change(int day, int from, int to){
    score += del_score(day, from, to);
    last[from].erase(day);
    last[to].insert(day);
    sched[day] = to;
}

int main(){
    //CFS;
    cin >> d;
    c = vi(26);
    s = mti(d, vi(26));
    rep(i, 26) cin >> c[i];
    rep(i, d){
        rep(j, 26) cin >> s[i][j];
    }
    sched = vi(d);
    rep(i, d){
        int maid = 0;
        rep(j, 26){
            if(s[i][maid] + c[maid] * 30 < s[i][j] + c[j] * 30) maid = j;
        }
        sched[i] = maid;
    }
    last = vector<set<int>>(26);
    rep(i, 26) last[i].insert(-1);
    score = init_score();
    rep(i, 26) last[i].insert(d);
    cerr << score << endl;
    rep(i, 200000){
        int day = xor128() % d;
        int to = xor128() % 26;
        int from = sched[day];
        int delta = del_score(day, from, to);
        if(delta > 0) change(day, from, to);
    }
    cerr << score << endl;

    double start_temp = 1000, end_temp = 10;
    int trial = 4000000;
    rep(i, trial){
        int pre_score = score;
        double temp = start_temp + (end_temp - start_temp) * i / trial;
        if(xor128() & 1){
            int day = xor128() % d;
            int to = xor128() % 26;
            int from = sched[day];
            if(from == to) continue;
//        int delta = del_score(day, from, to);
//        if(delta > 0) change(day, from, to);
            int today = *last[to].upper_bound(day);
            if(today == d) continue;
            int tmp = score;
            change(day, from, to);
            change(today, to, from);
            double prob = exp((score - pre_score) / temp);
            if(prob < (rand() % (1 << 30)) / (double) (1 << 30)){
                change(today, from, to);
                change(day, to, from);
            }
        }else{
            int day = xor128() % d;
            int to = xor128() % 26;
            int from = sched[day];
            int delta = del_score(day, from, to);
            double prob = exp(delta / temp);
            if(prob > (rand() % (1 << 30)) / (double) (1 << 30)) change(day, from, to);
        }
        if(score > pre_score) cerr << i << endl;
    }
    cerr << score << endl;
    rep(i, d){
        cout << sched[i] + 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 4400