#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(D);
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][j] - s[i][k];
            }
        }
    }

    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){
                if(pre[j] == -1)    continue;
                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(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;
            int Score = 0;
            
            if(chmax(NxtScore, calc_score(nxt)))    ProblemType = i;
        }
        if(NxtScore > BestScore){
            BestScore = NxtScore;
            cur[Day] = ProblemType;
        }
        if(++Day == D)  Day = 0;
    }

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

Measured memory_bytes: 4988