#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

const long long INF = 1e18;
//const ll mod = 1000000007;
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<> test(0, 364);


struct Master {
    const int D = 365;
    const int N = 26;
    int c[26];
    int s[365][26];
    int ans[365];
    set<int> st[26];
    void input() {
        int dust;
        cin >> dust;
        for(int i = 0; i < N; i++) cin >> c[i];
        for(int i = 0; i < D; i++) {
            for(int j = 0; j < N; j++) {
                cin >> s[i][j];
            }
        }
    }
    int f(int x) {
        return x * (x - 1) / 2;
    }
    void improve() {
        int day = test(mt);
        int from = ans[day];
        int delta = 0;
        int nxt = from;
        auto tmp = intervals(from, day);
        int basedelta = 0;
        basedelta += f(tmp.first) * c[from];
        basedelta += f(tmp.second) * c[from];
        basedelta -= f(tmp.first+tmp.second) * c[from];
        basedelta -= s[day][from];
        for(int i = 0; i < N; i++) {
            if(ans[day] == i) continue;
            auto tmp = intervals(from, day);
            int additional = 0;
            additional += f(tmp.first+tmp.second) * c[i];
            additional -= f(tmp.first) * c[i];
            additional -= f(tmp.second) * c[i];
            additional += s[day][i];
            if(chmax(delta, basedelta + additional)) {
                nxt = i;
            }
        }
        if(nxt != -1) {
            query(day, nxt);
        } else {
            int to = ans[day+1];
            query(day, to);
            query(day+1, from);
        }
    }
    i_i intervals(int idx, int x) {
        auto itr = st[idx].lower_bound(x);
        i_i ret;
        ret.second = *itr;
        itr--;
        ret.first = *itr;
        return ret;
    }
    void initialize() {
        vector<double> v;
        double sum = 0;
        for(int i = 0; i < N; i++) {
            double tmp = sqrt(c[i]);
            v.push_back(tmp);
            sum += tmp;
            st[i].insert(-1);
            st[i].insert(D);
        }
        uniform_real_distribution<double> test(0.0, sum);
        for(int i = 0; i < D; i++) {
            ans[i] = 0;
            double val = test(mt);
            for(int j = 0; j < v.size(); j++) {
                val -= v[j];
                if(val < 0) {
                    ans[i] = j;
                    st[j].insert(i);
                    break;
                }
            }
        }
    }
    void query(int day, int nxt) {
        int from = ans[day];
        auto itr = st[from].lower_bound(day);
        st[from].erase(itr);
        st[nxt].insert(day);
        ans[day] = nxt;
    }
    void print() {
        for(int i = 0; i < D; i++) {
            cout << ans[i] + 1 << "\n";
        }
        int Last[26];
        for(int i = 0; i < 26; i++) Last[i] = -1;
        int ansval = 0;
        for(int i = 0; i < D; i++) {
            ansval += s[i][ans[i]];
            Last[ans[i]] = i;
            for(int j = 0; j < N; j++) {
                ansval += c[j] * (i - Last[j]);
            }
        }
        cerr << ansval << endl;
    }
};

const int TL = 1980;

int main() {
    auto start = std::chrono::system_clock::now();
    Master master;
    master.input();
    master.initialize();
    while(true) {
        auto nowtimer = std::chrono::system_clock::now();
        auto dur = nowtimer - start;
        auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(dur).count();
        if(msec > TL) break;
        master.improve();
    }
    master.print();
    return 0;
}

Measured memory_bytes: 3792