#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#include <numeric>
#define IINF 1000000000
#define INF 9223372036854775807
#define MOD 1000000007
#define mod 1000000007
#define INT_MAX_ 2147483647
#define EPS (1e-10)
#define REP(i, a, n) fo-r (ll i = a; i < (ll)(n); i++)
#define REPE(i, a, n) for (ll i = a; i <= (ll)(n); i++)
//#define rep(i,n)for (ll i = 0; i < (ll)(n); i++)
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
#define me memset
#define bit(n,k) ((n>>k)&1)
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<int,int>Pin;
typedef pair<ll,ll>Pll;
template<class T> using V=vector<T>;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
long long GCD(long long a, long long b) {return b?GCD(b,a%b):a;}
long long LCM(long long a, long long b) {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
ll cmp1(pair<ll,ll> a,pair<ll,ll> b){
        if(a.se!=b.se)
        return a.se<b.se;
        else
        return a.fi>b.fi;
}
//----------------------------------------------------------------------
ll D;
ll c[26],s[366][26];
ll lastd[366];
ll score[366];
ll hiper_memory;
ll scoring(ll lastscore,ll t,ll day,int out){
    ll res=lastscore;
    ll pre_lastd=lastd[t];
    lastd[t]=day+1;
    res+=s[day][t];
    for(ll i=0;i<26;i++){
        res-=c[i]*(day+1-lastd[i]);
    }
    if(out==0)
        lastd[t]=pre_lastd;
    else if(out==2)hiper_memory=pre_lastd;
    return res;
}
//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_t=clock();
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //------------------------------
    cin>>D;
    for(ll i=0;i<26;i++)cin>>c[i];
    for(ll i=0;i<D;i++){
        for(ll j=0;j<26;j++){
            cin>>s[i][j];
        }
    }
    V<ll>ans(D);
    for(ll i=0;i<D;i++){
        ll minc=-INF;
        ll usej=-1,usek=-1;
        if(i==D-2){
            for(ll j=0;j<26;j++){
                ll lastscore;
                if(i==0)lastscore=0;
                else lastscore = score[i-1];
                ll this_score;
                if(i==0)this_score = scoring(lastscore,j,i,0);
                else this_score = scoring(lastscore,j,i,0)-lastscore;
                if(minc<this_score){
                    minc=this_score;
                    usej=j;
                }
            }
        }
        else{
            for(ll j=0;j<26;j++){
                for(ll k=0;k<26;k++){
                    ll lastscore;
                    if(i==0)lastscore=0;
                    else lastscore = score[i-1];

                    ll now1 = scoring(lastscore,j,i,2);
                    ll now2 = scoring(now1,k,i+1,0);
                    ll this_score;
                    if(i==0)this_score = now2;
                    else this_score = now2-lastscore;
                    if(minc<this_score){
                        minc=this_score;
                        usej=j;
                        usek=k;
                    }
                    lastd[j] = hiper_memory;
                }
            }
        }
        ll lastscore;
        if(i==0)lastscore=0;
        else lastscore = score[i-1];
        score[i]=scoring(lastscore,usej,i,1);
        ans[i]=usej+1;
    }
    for(ll i=0;i<D;i++){
        cout<<ans[i]<<endl;
    }

    //------------------------------
    //fclose(stdin);
    //fclose(stdout);
    //ll end_t=clock();cout<<"time="<<end_t-begin_t<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------








































Measured memory_bytes: 3760