#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<numeric>
#include<stack>
#include<map>
#include<queue>
#include<unordered_map>
#include<cmath>
#include<utility>

#include<ctime>
#include<random>

using ULL = unsigned long long;
using LL = long long;
using String = std::string;
using Ints = std::vector<int>;
using Doubles = std::vector<double>;
using Bools = std::vector<bool>;
using Strings = std::vector<std::string>;
using ULLs = std::vector<ULL>;
using LLs = std::vector<LL>;

// pythonのdictionary相当
template <typename T1, typename T2>
using Dict = std::unordered_map<T1,T2>;



int culc(Ints &r, std::vector<Ints> &s, Ints &c){
    int res = 0;
    Ints last(26, 0);

    for(int i=0;i<(int)r.size();i++){
        last[r[i]-1] = i+1;
        for(int j=0;j<26;j++){
            if(r[i]-1==j) res+=s[i][j];
            else res-=c[i]*(i+1-last[j]);
        }
    }

    return res;
}

int main(void) {
    int t = std::clock();

    int D;
    std::cin >> D;
    Ints c;
    std::vector<Ints> s(D, Ints(26, 0));

    for(int i=0;i<26;i++){
        int _c;
        std::cin >> _c;
        c.push_back(_c);
    }

    for(int i=0;i<D;i++){
        for(int j=0;j<26;j++){
            int _s;
            std::cin >> _s;
            s[i][j] = _s;
        }
    }

    Ints res(D, 1);
    std::vector<Ints> ss = s;
    Ints cnt(D, 0);

    for(int i=0;i<D;i++){
        std::sort(ss[i].begin(), ss[i].end(), std::greater<int>());
        auto itr = std::find(s[i].begin(), s[i].end(), ss[i].front());
        size_t index = std::distance(s[i].begin(), itr);
        res[i] = (int)index + 1;
    }

    LL nowp = culc(res, s, c);

    std::random_device rnd;
    std::mt19937 mt(rnd());
    while(static_cast<int>((double)(std::clock() - t) / CLOCKS_PER_SEC * 1000.0) < 1960){
        int max_day = 0;
        int max_day_p = 0;
        int max_day_idx = 0;
        int max_day_con = 0;
        for(int i=0;i<D;i++){
            //std::cout << cnt[i] << "UUUU" << std::endl;
            //std::cout << static_cast<int>(mt() % 2 == 0 ? 1 : -1) * static_cast<int>(mt() % 2 + 1) << "JJJ" << std::endl;
            int contest = std::min(std::max(cnt[i] + static_cast<int>(mt() % 2 == 0 ? 1 : -1) * static_cast<int>(mt() % 3 + 1), 0), 25);
            //std::cout << contest << "!!!" << nowp << std::endl;
            auto itr = std::find(s[i].begin(), s[i].end(), ss[i][contest]);
            int index = (int)std::distance(s[i].begin(), itr);

            Ints res_tmp = res;
            res_tmp[i] = index + 1;
            LL tmpp = culc(res_tmp, s, c);
            if(max_day_p < tmpp){
                max_day_p = tmpp;
                max_day = i;
                max_day_idx = contest;
                max_day_con = index;
            }
        }

        if(nowp < max_day_p){
            cnt[max_day] = max_day_idx;
            res[max_day] = max_day_con + 1;
            nowp = max_day_p;
        }

        /*
        int day = mt() % D;
        int contest = mt() % 26;
        Ints res_tmp = res;
        res_tmp[day] = contest + 1;
        LL tmpp = culc(res_tmp, s, c);
        if(nowp < tmpp){
            res[day] = contest + 1;
            nowp = tmpp;

            std::cout << tmpp << " " << day << " " << contest << std::endl;
        }
         */
    }

    for(auto r : res) std::cout << r << std::endl;

    return 0;
}

Measured memory_bytes: 3736