#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}
template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}

// #define DEBUG_MODE
#ifdef DEBUG_MODE
#define dump(x) cerr << #x << " : " << x << " "
#define dumpL(x) cerr << #x << " : " << x << '\n'
#define LINE cerr << "line : " << __LINE__ << " "
#define LINEL cerr << "line : " << __LINE__ << '\n'
#define dumpV(v) cerr << #v << " : ["; for(auto& t : v) cerr << t << ", "; cerr<<"]" << " "
#define dumpVL(v) cerr << #v << " : ["; for(auto& t : v) cerr << t << ", "; cerr<<"]" << endl
#define STOP assert(false)
#else
#define dump(x) 
#define dumpL(x) 
#define LINE 
#define LINEL 
#define dumpV(v) 
#define dumpVL(v) 
#define STOP assert(false)
#endif
#define mp make_pair
 
namespace std {
template<class S, class T>
ostream &operator <<(ostream& out, const pair<S, T>& a) {
    out << '(' << a.fi << ", " << a.se << ')';
    return out;
}
}

unsigned int randxor()
{
    static unsigned int x=123456789,y=362436069,z=521288629,w=88675123;
    unsigned int t;
    t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) );
}

const int D = 365;
const int N = 26;
int c[N];
int s[D][N];

struct State {
    set<int> st[N];
    int ans[D];

    ll score;

    State() {
        rep(i, N) {
            st[i].insert(-1);
            st[i].insert(D);
        }

        rep(i, D) {
            ans[i] = i%N;
            st[ans[i]].insert(i);
        }
        calcScore();
    }
    ll calcScore() {
        score = 0;
        int last[N] = {};
        rep(i, N) last[i] = -1;
        rep(i, D) {
            last[ans[i]] = i;
            score += s[i][ans[i]];
            rep(j, N) score -= c[j] * (i - last[j]);
        }
        return score;
    }
    ll calcScoreC(int i) {
        return i*(i-1LL)/2;
    }
    ll chang(int i, int y) {
        int x = ans[i];
        if(x == y) return score;
        {
            int pre = *(--st[x].lower_bound(i));
            int pst = *(st[x].upper_bound(i));
            dump(pre);dumpL(pst);
            score += c[x] * calcScoreC(i - pre);
            score += c[x] * calcScoreC(pst - i);
            score -= c[x] * calcScoreC(pst - pre);
        }
        {
            int pre = *(--st[y].lower_bound(i));
            int pst = *(st[y].upper_bound(i));
            dump(pre);dumpL(pst);

            score -= c[y] * calcScoreC(i - pre);
            score -= c[y] * calcScoreC(pst - i);
            score += c[y] * calcScoreC(pst - pre);
        }
        score -= s[i][x];
        score += s[i][y];
        ans[i] = y;
        st[x].erase(i);
        st[y].insert(i);

        return score;
    }
    void output() {
        rep(i, D) {
            cout << ans[i]+1 << '\n';
        }
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    {
        int d;
        cin >> d;
        rep(i, N) cin >> c[i];
        rep(i, D) rep(j, N) cin >> s[i][j]; 
    }
    State state;

    // state.chang(1, 3);
    // state.chang(1, 2);

    ll curScore = state.score;

    rep(_, 800) {
        rep(i, D) {
            ll cur_id = state.ans[i];
            rep(j, N) {
                ll tmpScore = state.chang(i, j);
                if(tmpScore >= curScore) {
                    cur_id = j;
                    curScore = tmpScore;
                }
                else {
                    state.chang(i, cur_id);
                }
            }
        }
    }


    // cerr << curScore << '\n';
    state.output();
    return 0;
}

Measured memory_bytes: 3728