/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author cherrypi59
 */

#pragma GCC optimize ("O2")
#pragma GCC optimize ("tree-vectorize")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FFOR(i, a, b) FOR(i, a, b+1)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 1, n+1)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define LEN(x) (int)(x).size()
#define DUMP(x) cerr<<__LINE__<<' '<<#x<<"="<<(x)<<endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair

using namespace std;
using lint = long long;
using pii =  pair<int, int>;
using pll =  pair<lint, lint>;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vector<T>>;
template <typename T> inline bool chmax(T &a, T b){if(a<b){a = b; return true;} return false;}
template <typename T> inline bool chmin(T &a, T b){if(a>b){a = b; return true;} return false;}

constexpr lint ten(int n) {return n==0 ? 1 : ten(n-1)*10;}

class AAtCoderContestScheduling {
public:
    const int INF = 2 * ten(9);
    int D, score = 0;
    vc<int> C, T, last;
    vvc<int> S;
    vector<set<int>> G;

    void init(){
        REP(i, D){
            // type 0を使うときのスコアを計算
            int mx = score + S[0][i], id = 0;
            FOR(j, 1, 26) mx -= C[j] * (i-last[j]);
            // j = 1...26について試す
            FOR(j, 1, 26){
                int cur = score + S[j][i];
                cur += C[j] * (i-last[j]) - C[j-1] * (i-last[j-1]);
                if(chmax(mx, cur)){
                    id = j;
                }
            }
            // 更新
            score = mx;
            T[i] = id;
            G[id].insert(i);
        }
    }

    void update(int d, int x){
        int old = T[d], cur = score;
        cur += S[x][d] - S[old][d];
        {
            auto oldItr = G[old].find(d);
            int pre = *prev(oldItr);
            int nxt = *next(oldItr);
            cur -= C[old] * (nxt-d) * (d-pre);
            G[x].insert(d);
            auto xItr = G[x].upper_bound(d);
            pre = *prev(xItr);
            nxt = *xItr;
            cur += C[x] * (nxt-d) * (d-pre);
        }
        if(cur>score){
            score = cur;
            T[d] = x;
            G[old].erase(d);
            G[x].insert(d);
#ifdef DEBUG
            assert(x==T[d]);
            assert(G[x].find(d)!=G[x].end());
#endif
        }else{
#ifdef DEBUG
            assert(old==T[d]);
            assert(G[old].find(d)!=G[old].end());
#endif
        }
    }

    void solve(std::istream& in, std::ostream& out){
        ios_base::sync_with_stdio(false);
        in.tie(nullptr), out.tie(nullptr);
        in>>D;
        C.resize(26);
        T.resize(D);
        last.resize(26, -1);
        S.resize(26, vc<int>(D));
        G.resize(26, {-1, D});
        for(auto& c : C) in>>c;
        REP(i, D) REP(j, 26) in>>S[j][i];
        init();
        // 書き換え
        int M;
#ifdef DEBUG
        M = 100;
#else
        M = 2 * ten(5);
#endif
        int64_t seed = chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now().time_since_epoch()).count();
        mt19937_64 rnd(seed);
        while(M--){
            int d = rnd() % D + 1;
            int q = rnd() % 26 + 1;
            d--, q--;
            update(d, q);
        }
        REP(i, D) out<<T[i]+1<<'\n';
    }
};


int main() {
	AAtCoderContestScheduling solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 4160