#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<double> VD;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<VD> VVD;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

#include <chrono>

struct Timer{
    chrono::system_clock::time_point start_t;
    void start(){
        start_t = chrono::system_clock::now();
    }
    double now(){
        chrono::system_clock::time_point now_t = chrono::system_clock::now();
        return chrono::duration_cast<std::chrono::milliseconds>(now_t - start_t).count() / 1000.0;
    }
} timer;

const int INF = 1e9;

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

ll rand(ll x){
    return xor128() % x;
}
ll rand(ll x, ll y){
    return x + (xor128() % (y - x));
}

int n, m = 26;
VI c;
VVI s;

int calc_score(VI t){
    VI last(m, -1);
    int ret = 0;
    REP(i,n){
        ret += s[i][t[i]];
        last[t[i]] = i;
        REP(j,m) ret -= c[j] * (i - last[j]);
    }
    return ret;
}

int pena(VI &t, int x, int y){
    int last_x = -1;
    int last_y = -1;
    int ret = 0;
    REP(i,n){
        if (t[i] == x){
            last_x = i;
        }else if (t[i] == y){
            last_y = i;
        }
        ret += c[x] * (i - last_x);
        ret += c[y] * (i - last_y);
    }
    return ret;
}

int calc_diff(VI &t, int i, int to){
    int from = t[i];
    int diff = s[i][to] - s[i][from];
    diff += pena(t, from, to);
    t[i] = to;
    diff -= pena(t, from, to);
    t[i] = from;
    return diff;
}

void output(VI t){
    REP(i,t.size()) {
        if (t[i] >= m) cerr << i << endl;
        printf("%d\n", t[i] + 1);
    }
}

int main(void){
    cin >> n;
    c.assign(m, 0);
    REP(i,m) c[i] = in();
    s.assign(n, VI(m));
    REP(i,n) REP(j,m) s[i][j] = in();

    VI t(n);
    REP(i,n){
        t[i] = max_element(ALL(s[i])) - s[i].begin();
    }

    int score = calc_score(t);
    int all = 100000;
    double start_temp = 500, end_temp = 1;

    REP(_,all){
        VI tt(t);
        int i = rand(n);
        int to = (tt[i] + rand(m - 1)) % m;
        int diff = calc_diff(t, i, to);

        double temp = start_temp + (end_temp - start_temp) * i / all;
        double prob = exp(diff/temp);
        if (diff >= 0 || prob > (rand(INF)/(double)INF)){
            t[i] = to;
            score += diff;
        }
    }

    // cerr << score << endl;
    output(t);

    return 0;
}


Measured memory_bytes: 4444