#include <queue>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <set>
#include <tuple>
#include <cmath>
#include <algorithm>
#include <vector>
#include <iostream>
#include <fstream>
#include <chrono>
#include <random>

using namespace std;

auto start_time = chrono::system_clock::now();

inline bool timeout(int ms) {
    auto delta = chrono::system_clock::now() - start_time;
    return chrono::duration_cast<chrono::milliseconds>(delta).count() >= ms;
}

class Pts {
public:
    Pts(int n, int d) : mem(n) {
        for (auto &a : mem) {
            a.reserve(d + 1);
            a.push_back(-1);
            a.push_back(d);
        }
    }

    inline pair<int, int> get(int t, int k) {
        auto &a = mem[k];
        auto i = lower_bound(a.begin(), a.end(), t);
        if (*i == t) return {*(i - 1), *(i + 1)};
        else return {*(i - 1), *i};
    }

    inline void set(int t, int i) {
        auto &b = mem[i];
        auto j = lower_bound(b.begin(), b.end(), t);
        b.insert(j, t);
    }

    inline void unset(int t, int i) {
        auto &a = mem[i];
        auto j = find(a.begin(), a.end(), t);
        a.erase(j);
    }

private:
    vector<vector<int>> mem;
};

const int n = 26;

class Solution {
public:
    Solution(int n, int d) :
            n(n), d(d), cost(0),
            c(n), s(d, vector<int>(n)),
            res(d), pts(n, d) {

        for (auto &x : c) cin >> x;

        for (int t = 0; t < d; t++) {
            for (int i = 0; i < n; i++) {
                cin >> s[t][i];
            }
        }

        for (int t = 0; t < d; t++) {
            int i = max_element(s[t].begin(), s[t].end()) - s[t].begin();
            res[t] = i;
            cost += s[t][i];
            int q = pts.get(t, i).first;
            cost -= c[i] * (t - q - 1) * (t - q) / 2;
            pts.set(t, i);
        }

        for (int i = 0; i < n; i++) {
            int q = pts.get(d, i).first;
            cost -= c[i] * (d - q - 1) * (d - q) / 2;
        }
    }

    int64_t estimate(int t, int j) {
        int i = res[t];
        int64_t delta = s[t][j] - s[t][i];
        {
            auto p = pts.get(t, i);
            int l = t - p.first - 1;
            int r = p.second - t - 1;
            delta += c[i] * (l * (l + 1) + r * (r + 1) - (l + r + 1) * (l + r + 2)) / 2;
        }
        {
            auto p = pts.get(t, j);
            int l = t - p.first - 1;
            int r = p.second - t - 1;
            delta -= c[j] * (l * (l + 1) + r * (r + 1) - (l + r + 1) * (l + r + 2)) / 2;
        }
        return delta;
    }

    void change(int t, int j, int64_t delta) {
        int i = res[t];
        res[t] = j;
        pts.unset(t, i);
        pts.set(t, j);
        cost += delta;
    }

    vector<int> &result() {
        return res;
    }

    int64_t get_cost() {
        return cost;
    }

private:
    int n;
    int d;
    int64_t cost;
    vector<int> c;
    vector<vector<int>> s;
    vector<int> res;
    Pts pts;
};

int main() {
    ios_base::sync_with_stdio(false);

//    fstream out;
//    out.open("output", ios_base::out);

    int d;
    cin >> d;

    Solution solution(n, d);

    mt19937 rnd(start_time.time_since_epoch().count());
    int cnt = 0;
    while (!timeout(1950)) {
        for (int t = 0; t < d; t++) {
            int i = rnd() % n;
            int64_t delta = solution.estimate(t, i);
            if (delta > 0) solution.change(t, i, delta);
        }

//        if (cnt++ % (1 << 10) == 0) cerr << "epoch: " << cnt << ": " << solution.get_cost() << '\n';
    }

    for (auto &x : solution.result()) cout << x + 1 << '\n';

    return 0;
}


Measured memory_bytes: 3652