#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];

    simulator(){}

    void solve(){
        input();
        generate();
        simulate();
        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;
            }
        }

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

    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;
    }

    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>=1800) break;

            int nexd=rng()%D;
            int nexq=rng()%L;
            int diff=diffEvaluate(nexd,nexq);
            if(diff>0){
                score+=diff;
                position[bestAnswer[nexd]].erase(nexd);
                position[nexq].insert(nexd);
                bestAnswer[nexd]=nexq;
            }
        }
        /*rep(i,M){
            int diff=diffEvaluate(T[i],Q[i]);
            score+=diff;

            position[bestAnswer[T[i]]].erase(T[i]);
            position[Q[i]].insert(T[i]);
            bestAnswer[T[i]]=Q[i];
            cout<<score<<"\n";
        }*/
    }

    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: 3736