#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 score_upd(int id) {
    int last = -1;
    int ns = 0;
    for (int i = 0; i < n; i++) {
        if (t[i] == id) {
            ns += s[i][id];
            last = i;
        }
        ns -= c[id] * (i - last);
    }
    return ns - ssc[id];
}
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    input();
    int lim = 1900000;
    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);
    for (int i = 0; i < n; i++) {
        t[i] = mid;
    }
    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 = score_upd(be), d2 = score_upd(i);
            int sc = now + d1 + d2;
            if (sc > now || exp(-(now - sc) / tmp) > r1(mt)) {
                now = sc;
                ssc[be] += d1;
                ssc[i] += d2;
            } else {
                t[d] = be;
            }
        } 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 = score_upd(b1), d2 = score_upd(b2);
            int sc = now + d1 + d2;
            if (sc > now || exp(-(now - sc) / tmp) > r1(mt)) {
                now = sc;
                ssc[b1] += d1;
                ssc[b2] += d2;
            } else {
                t[d] = b1, t[d + 1] = b2;
            }
        }
        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: 4408