#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    ll D;
    cin >> D;
    Vi c(26);
    matrix s(D,Vi(26));
    rp(i,26) cin >> c[i];
    rp(i,D){
        rp(j,26) cin >> s[i][j];
    }
    Vi last(26,-1);
    Vi t(D);
    rp(i,D){
        ll con;
        ll maxi=-INF;
        rp(j,26){
            if(chmax(maxi,s[i][j]+c[i]*(i-last[j]))){
                con=j;
            }
        }
        t[i]=con;
        last[con]=i;
    }
    ll score=0;
    Vi llast(26,-1);
    rp(i,D){
        score+=s[i][t[i]];
        rp(j,26){
            if(j==t[i]) {
                llast[t[i]]=i;
                continue;
            }
            score-=c[j]*(i-last[j]);
        }
    }
    rp(i,130000){
        ll store=score;
        ll d= rand()%D;
        ll q;
        do {q= rand()%26;}
        while(q==t[d]);
        ll l=-1,r=-1;
        for(ll c=d+1; c<D; c++){
            if(t[c]==t[d]) {
                r=c;
                break;
            }
        }
        if(r==-1) r=D;
        for(ll c=d-1; c>=0; c--){
            if(t[c]==t[d]){
                l=c;
                break;
            }
        } 
        score -= c[t[d]]*(d-l)*(r-d);
        l=-1; r=-1;
        for(ll c=d+1; c<D; c++){
            if(t[c]==q) {
                r=c;
                break;
            }
        }
        if(r==-1) r=D;
        for(ll c=d-1; c>=0; c--){
            if(t[c]==q){
                l=c;
                break;
            }
        }
        score += c[q]*(d-l)*(r-d);
        score += s[d][q]-s[d][t[d]];
        if(store<score)
        t[d]=q;
        else{
            score=store;
        }
    }
    for(auto i:t){
        print(i+1);
    }
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 3736