#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
// template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

std::random_device seed_gen;
std::mt19937 engine(seed_gen());
constexpr int prob = 26;
// const double TL = 4.970;
const double TL = 1.975;
// const double TL = 0.100;

vector<ll> c,l;
vector<vector<int>> s;
int d;

ll score(vector<int> &t) {
    ll sat = 0;
    rep (i, prob) l[i] = -1;
    rep (dy, d) {
        int k = t[dy];
        sat += s[dy][k];
        l[k] = dy;
        rep (i, 26) sat -= c[i] * (dy - l[i]);
    }
    return sat;
    // return (ll)-1e18 - 1;
}

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    clock_t start = clock(), end;
    cin >> d;
    c.resize(prob); l.resize(prob);
    s.resize(d); rep (i, s.size()) s[i].resize(prob);
    rep (i, c.size()) cin >> c[i];
    rep (i, s.size()) { rep (j, s[0].size()) { cin >> s[i][j]; }}

    vector<int> t(d), tmp;
    vector<int> sum(prob + 1);
    rep (i, prob) sum[i + 1] = sum[i] + c[i];
    rep (i, prob) l[i] = -1;
    rep (i, d) {
        int k = -1, x = -1;
        rep (j, prob) if (chmax(x, s[i][j] + (int)c[j] * (i - (int)l[j]))) k = j;
        t[i] = k;
        l[k] = i;
    }
    tmp = t;
    ll max_score = -(ll)1e18;
    int count = 1, k, l;
    double temp = pow(2, 28), TMP = 0.0001, tim = 0;
    while (true) {
        // write here
        
        do {
            k = engine() % d;
            l = engine() % prob;
        } while (l == t[k]
        || s[k][l] < 12000
        );
        tmp[k] = l;
        // if (chmax(max_score, score(tmp))) t = tmp;
        ll sc = score(tmp);
        if (chmax(max_score, sc)) {
            t = tmp;
            eprintf("*");
        }

        if (count % 100 == 0) {
            end = clock();
            tim = static_cast<double>(end - start) / CLOCKS_PER_SEC;
            if (tim > TL) break;
        }
        count++;
    }
    
    rep (i, d) cout << t[i] + 1 << "\n";
    eprintf("count: %d\n", count);
    eprintf("max_score: %lld\n", max_score);
    return 0;
}

Measured memory_bytes: 3728