#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#include <random>
#include <chrono>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

class simulator{
public:
    static const int L=26;
    int D;
    vector<int> C;
    vector<vector<int>> S;

    vector<int> bestAnswer;
    int bestScore;
    set<int> position[L];

    vector<vector<int>> distribution;

    simulator(){}

    void solve(){
        input();
        preprocess();
        generate();
        //simulate();
        sa();
        output();
    }

    void input(){
        cin>>D;
        C.resize(L);
        S.resize(D);
        rep(i,L) cin>>C[i];
        rep(i,D){
            S[i].resize(L);
            rep(j,L) cin>>S[i][j];
        }
    }

    void generate(){
        bestAnswer.resize(D,0);
        random_device rng;
        rep(i,D){
            for(int j=0;j<L;j++){
                if(S[i][j]>S[i][bestAnswer[i]]) bestAnswer[i]=j;
            }
        }
        bestScore=evaluate(bestAnswer);

        rep(i,D) position[bestAnswer[i]].insert(i);
        rep(i,L){
            position[i].insert(-1);
            position[i].insert(D);
        }
    }

    void preprocess(){
        distribution.resize(D);
        rep(i,D){
            vector<pair<int,int>> v;
            /*rep(j,L) v.push_back(mkp(S[i][j]+C[i]*100,j));
            sort(all(v));

            rep(j,L){
                rep(k,j+1) distribution[i].push_back(v[j].second);
            }*/
            rep(j,L) distribution[i].push_back(j);
        }
    }

    int evaluate(vector<int> &t){
        int result=0;
        vector<int> last(L,0);
        for(int i=0;i<D;i++){
            int tar=t[i];
            result+=S[i][tar];
            last[tar]=i+1;
            for(int j=0;j<L;j++) result-=C[j]*(i+1-last[j]);
            //cout<<result<<endl;
        }
        return result;
    }

    int diffEvaluate(int d,int q){
        if(bestAnswer[d]==q) return 0;

        int result=S[d][q]-S[d][bestAnswer[d]];
        {
            auto itr=position[bestAnswer[d]].upper_bound(d);
            itr--;
            itr--;
            int l=*(itr);
            itr++;
            itr++;
            int r=*(itr);

            result-=C[bestAnswer[d]]*(d-l)*(r-d);
        }
        {
            auto itr=position[q].upper_bound(d);
            itr--;
            int l=*(itr);
            itr++;
            int r=*(itr);

            result+=C[q]*(d-l)*(r-d);
        }
        return result;
    }

    const int INF=1e9;

    void simulate(){
        int score=evaluate(bestAnswer);

        auto start = std::chrono::system_clock::now();      // 計測スタート時刻を保存
        random_device rng;

        while(1){
            auto end = std::chrono::system_clock::now();       // 計測終了時刻を保存
            auto dur = end - start;        // 要した時間を計算
            auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(dur).count();
            if(msec>=1900) break;

            //int nexd=rng()%D;
            //int nexq=rng()%L;
            int nexd=rng()%D;
            int SZ=distribution[nexd].size();
            int nexq=rng()%SZ;
            nexq=distribution[nexd][nexq];

            int diff=diffEvaluate(nexd,nexq);
            if(diff>0){
                score+=diff;
                position[bestAnswer[nexd]].erase(nexd);
                position[nexq].insert(nexd);
                bestAnswer[nexd]=nexq;
            }
        }
    }

    void sa() {
        double start_temp=10000, end_temp=10;
        auto start=std::chrono::system_clock::now(); 
        random_device rng;
        while(1){
            auto end = std::chrono::system_clock::now();       // 計測終了時刻を保存
            auto dur = end - start;        // 要した時間を計算
            auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(dur).count();
            if(msec>=1950) break;

            if(rng()%2){
                int nexd=rng()%D;
                int SZ=distribution[nexd].size();
                int nexq=rng()%SZ;
                nexq=distribution[nexd][nexq];

                int diff=diffEvaluate(nexd,nexq);

                double temp = start_temp + (end_temp - start_temp) * (msec) / 1950;
                double prob = exp((diff)/temp);

                if (diff>0||prob>(rng()%INF)/(double)INF) {
                    bestScore+=diff;
                    position[bestAnswer[nexd]].erase(nexd);
                    position[nexq].insert(nexd);
                    bestAnswer[nexd]=nexq;
                }
            }else{
                const int W=13;
                int w=rng()%W;
                int lefd=rng()%D;
                int rigd=lefd+w;
                if(rigd>=D) continue;
                int lefq=bestAnswer[lefd];
                int rigq=bestAnswer[rigd];

                int diff=0;
                {
                    diff+=diffEvaluate(lefd,rigq);
                    position[lefq].erase(lefd);
                    position[rigq].insert(lefd);
                    bestAnswer[lefd]=rigq;
                    diff+=diffEvaluate(rigd,lefq);
                    position[lefq].insert(lefd);
                    position[rigq].erase(lefd);
                    bestAnswer[lefd]=lefq;
                }

                double temp = start_temp + (end_temp - start_temp) * (msec) / 1950;
                double prob = exp((diff)/temp);

                if (diff>0||prob>(rng()%INF)/(double)INF) {
                    bestScore+=diff;
                    position[lefq].erase(lefd);
                    position[rigq].erase(rigd);
                    position[lefq].insert(rigd);
                    position[rigq].insert(lefd);

                    bestAnswer[lefd]=rigq;
                    bestAnswer[rigd]=lefq;
                }
            }
        }
    }

    void output(){
        //cout<<evaluate(bestAnswer)<<endl;
        //evaluate(bestAnswer);
        rep(i,D) cout<<bestAnswer[i]+1<<"\n";
        return;
    }

};

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

  simulator sim;
  sim.solve();

  return 0;
}


Measured memory_bytes: 4408