#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

using ll = long long;
using ull = uint64_t;
using P = pair<int, int>;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

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

struct Timer{
    chrono::high_resolution_clock::time_point st;

    Timer() { reset(); }

    void reset(){
        st = chrono::high_resolution_clock::now();
    }

    chrono::milliseconds::rep elapsed(){
        auto ed = chrono::high_resolution_clock::now();
        return chrono::duration_cast<chrono::milliseconds>(ed - st).count();
    }
};

struct RNG{
    mt19937 mt;

    RNG() : mt(chrono::steady_clock::now().time_since_epoch().count()){}

    int operator()(int a, int b){
        uniform_int_distribution<int> dist(a, b - 1);
        return dist(mt);
    }

    int operator()(int b){
        return (*this)(0, b);
    }
};

constexpr int D = 365;
vector<int> c(26);
vector<vector<int>> s(D, vector<int>(26));
Timer TimeKeeper;
RNG rng;
constexpr ll inf = 1e+15;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int kyomu;
    cin >> kyomu;
    for(int i = 0; i < 26; ++i) cin >> c[i];
    vector<int> maxe(D, -1);
    vector<int> cur(D, 0);
    for(int i = 0; i < D; ++i){
        for(int j = 0; j < 26; ++j){
            cin >> s[i][j];
            if(chmax(maxe[i], s[i][j])) cur[i] = j;
        }
    }
    vector<vector<vector<int>>> Difference(D, vector<vector<int>>(26, vector<int>(26)));
    for(int i = 0; i < D; ++i){
        for(int j = 0; j < 26; ++j){
            for(int k = 0; k < 26; ++k){
                Difference[i][j][k] = s[i][k] - s[i][j];
            }
        }
    }

    ll BestScore = 0;
    auto calc_score = [&](vector<int>& v) -> ll {
        ll res = 0;
        vector<int> pre(26, -1);
        for(int i = 0; i < D; ++i){
            res += s[i][v[i]];
            pre[v[i]] = i;
            for(int j = 0; j < 26; ++j) res -= c[j] * (i - pre[j]);
        }
        return res;
    };
    BestScore = calc_score(cur);

    vector<set<int>> Appearance(26);
    for(int i = 0; i < D; ++i)  Appearance[cur[i]].insert(i);
    for(int i = 0; i < 26; ++i){
        Appearance[i].insert(-1);
        Appearance[i].insert(D);
    }

    int Day = 0;
    while(TimeKeeper.elapsed() < 1970){
        ll NxtScore = -inf;
        int ProblemType = -1;
        vector<int> nxt = cur;
        for(int i = 0; i < 26; ++i){
            if(i == cur[Day])   continue;
            nxt[Day] = i;
            ll Score = BestScore + Difference[Day][cur[Day]][nxt[Day]];
            auto it = Appearance[cur[Day]].find(Day);
            auto LeftIte = it;
            auto RightIte = it;
            --LeftIte, ++RightIte;
            int l = *LeftIte, r = *RightIte;
            for(int j = l + 1; j < r; ++j){
                Score -= (j - l) * c[cur[Day]];
                if(j < i)   Score += (j - l) * c[cur[Day]];
                else if(j > i)  Score += (j - i) * c[cur[Day]];
            }
            RightIte = Appearance[nxt[Day]].lower_bound(Day);
            LeftIte = RightIte;
            --LeftIte;
            for(int j = l + 1; j < r; ++j){
                Score += (j - l) * c[nxt[Day]];
                if(j < i)   Score -= (j - l) * c[nxt[Day]];
                else if(j > i)  Score -= (j - i) * c[nxt[Day]];
            }
            if(chmax(NxtScore, Score))  ProblemType = i;
        }
        if(NxtScore > BestScore){
            BestScore = NxtScore;
            auto it = Appearance[cur[Day]].find(Day);
            Appearance[cur[Day]].erase(it);
            cur[Day] = ProblemType;
            Appearance[cur[Day]].insert(Day);
        }
        if(++Day == D)  Day = 0;
    }
    // cerr << BestScore << endl;

    for(int i = 0; i < D; ++i)  cout << cur[i] + 1 << '\n';
}

Measured memory_bytes: 5020