#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;
template <class T>
inline void chmin(T &a, const T &b) { a = min(a, b); }
template <class T>
inline void chmax(T &a, const T &b) { a = max(a, b); }
template <class T>
inline bool kbit(const T &x, const int &k) { return ((x >> k) & 1LL); }
inline int popcount(const int &n) { return __builtin_popcount(n); }
inline ll popcountll(const ll &n) { return __builtin_popcountll(n); }
inline ll mask(const ll &k) { return (1LL << k) - 1LL; }
template <class T>
void zip(V<T> &v) {
    sort(all(v));
    v.erase(unique(all(v)), v.end());
}
template <class T>
int lwb(V<T> &v, const T &x) { return lower_bound(all(v), x) - v.begin(); }
void dump() {
    cerr << '\n';
}
template <class Head, class... Tail>
void dump(Head &&head, Tail &&... tail) {
    cerr << head << (sizeof...(Tail) == 0 ? " " : ", ");
    dump(std::move(tail)...);
}
template <class T>
void print(const vector<T> &v) {
    for (int i = 0; i < v.size(); i++) cout << v[i] << (i + 1 == v.size() ? '\n' : ' ');
}
template <class T>
void read(vector<T> &v) {
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}
constexpr char sp = ' ', newl = '\n';
constexpr int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll MOD = 1e9 + 7;
//////////////////////////////////////////////INSERT ABOVE HERE
int n, m;
int c[26];
int s[400][26];
int t[400], ssc[400];
void input() {
    cin >> n;
    m = 26;
    for (int i = 0; i < m; i++) cin >> c[i];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> s[i][j];
        }
    }
}
void output() {
    for (int i = 0; i < n; i++) {
        cout << t[i] + 1 << newl;
    }
}
int score() {
    V<int> last(m, -1);
    int res = 0;
    memset(ssc, 0, sizeof(ssc));
    for (int i = 0; i < n; i++) {
        res += s[i][t[i]];
        last[t[i]] = i;
        ssc[t[i]] += s[i][t[i]];
        for (int j = 0; j < m; j++) {
            res -= c[j] * (i - last[j]);
            ssc[j] -= c[j] * (i - last[j]);
        }
    }
    return res;
}
inline int cal(int x) {
    return x * (x + 1) / 2;
}
set<int> st[26];
int add(int id, int d) {
    st[id].insert(d);
    int res = s[d][id];
    auto it = st[id].lower_bound(d);
    int l = *prev(it), r = *next(it);
    res -= c[id] * (cal(d - l - 1) + cal(r - d - 1) - cal(r - l - 1));
    return res;
}
int del(int id, int d) {
    int res = -s[d][id];
    auto it = st[id].lower_bound(d);
    int l = *prev(it), r = *next(it);
    res += c[id] * (cal(d - l - 1) + cal(r - d - 1) - cal(r - l - 1));
    st[id].erase(it);
    return res;
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    input();
    for (int i = 0; i < m; i++) {
        st[i].insert(-1);
        st[i].insert(n);
    }
    int lim = 4000000;
    random_device rd;
    mt19937 mt(rd());
    uniform_int_distribution<> rn(0, n - 1), rn1(0, n - 2), rc(0, m - 1);
    uniform_real_distribution<> r1(0, 1);
    int mid = max_element(c, c + 26) - c;
    for (int i = 0; i < n; i++) {
        t[i] = mid;
        st[t[i]].insert(i);
    }
    int now = score();
    double mat = 3000;
    double tmp = mat;
    for (int co = 0; co < lim; co++) {
        if (r1(mt) < 0.8) {
            int d = rn(mt), i = rc(mt);
            int be = t[d];
            t[d] = i;
            int d1 = del(be, d), d2 = add(i, d);
            int sc = now + d1 + d2;
            if (sc > now || exp(-(now - sc) / tmp) > r1(mt)) {
                now = sc;
            } else {
                t[d] = be;
                add(be, d);
                del(i, d);
            }
        } else {
            int d = rn1(mt);
            if (t[d] == t[d + 1]) continue;
            int b1 = t[d], b2 = t[d + 1];
            swap(t[d], t[d + 1]);
            int d1 = add(b1, d + 1) + del(b1, d), d2 = add(b2, d) + del(b2, d + 1);
            int sc = now + d1 + d2;
            if (sc > now || exp(-(now - sc) / tmp) > r1(mt)) {
                now = sc;
            } else {
                t[d] = b1, t[d + 1] = b2;
                add(b1, d);
                del(b1, d + 1);
                del(b2, d);
                add(b2, d + 1);
            }
        }
        tmp -= mat / double(lim);
    }
    output();
    cerr << now << newl;
    /* ifstream ifs("sc.txt");
    ll tt;
    ifs >> tt;
    ofstream ofs("sc.txt");
    ofs << tt + now << endl;*/
}
/*
0.95 21115581
0.9 21179098
0.8 19475382
0.5 19425431
0.2 17832584
ya 0.9 23048616
mat=3000 25563774
0.7 32377837
0.8 32643687
0.9 32624825
mat=10000 31919822
mat=4000 
33622765

*/


Measured memory_bytes: 4308