#include <iostream>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <map>
#include <algorithm>
#include <functional>
#include <string>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>
using namespace std;

#define REP(i,p,n) for(ll i=p;i<ll(n);++i)
#define rep(i,n) REP(i,0,n)

using ll = long long int;
using pll = pair<ll, ll>;

const ll T = 26;

ll D;
vector<ll> C;
vector< vector<ll> > S;
vector<ll> A, B;
ll HighScore;

//------------------------------------------------------------------------------
// 乱数生成
//------------------------------------------------------------------------------
unsigned long xor128()
{
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t=(x^(x<<11));x=y;y=z;z=w;
    return (w=(w^(w>>19))^(t^(t>>8)));
}

//------------------------------------------------------------------------------
// 入力
//------------------------------------------------------------------------------
void input()
{
    cin >> D;

    C.assign(D, 0);
    rep (t, T) { cin >> C[t]; }

    S.assign(D, vector<ll>(T, 0));
    rep (d, D) { rep (t, T) { cin >> S[d][t]; } }

    A.assign(D, 0);
    B.assign(D, 0);
}

//------------------------------------------------------------------------------
// 出力
//------------------------------------------------------------------------------
void output()
{
    rep (d, D) { cout << A[d] + 1 << endl; }
}

//------------------------------------------------------------------------------
// 報酬が良い順に貪欲に解く (+ランダム)
//------------------------------------------------------------------------------
ll solveImpl(bool isRandom = false)
{
    ll res = 0;
    vector<ll> L(T, 0);

    rep (d, D)
    {
        ll xx = 0, tt = 0;

        rep (t, T)
        {
            const ll r = isRandom ? (xor128() % 1024LL) : 0;
            const ll x = S[d][t] + (d + 1 - L[t]) * C[t] + r;
            if (xx <= x) { xx = x; tt = t; }
        }

        B[d] = tt;
        L[tt] = d + 1;

        res += S[d][tt];
        rep (t, T) { res -= C[t] * (d + 1 - L[t]); }
    }

    return res;
}

//------------------------------------------------------------------------------
// 報酬が良い順に貪欲に解く
//------------------------------------------------------------------------------
void solveStep1()
{
    HighScore = solveImpl();
    rep (d, D) { A[d] = B[d]; }
}

//------------------------------------------------------------------------------
// 報酬が良い順に貪欲に解く + ランダム
//------------------------------------------------------------------------------
void solveStep2()
{
    rep (i, 1000)
    {
        const ll score = solveImpl(true);
        // cerr << "1: HighScore: " << HighScore << ", Score: " << score << endl;

        if (HighScore < score)
        {
            HighScore = score;
            rep (d, D) { A[d] = B[d]; }
        }
    }
}

//------------------------------------------------------------------------------
// スコア計算
//------------------------------------------------------------------------------
ll calcScore()
{
    vector<ll> L(T, 0);

    ll res = 0;

    rep (d, D)
    {
        L[A[d]] = d + 1;
        res += S[d][A[d]];
        rep (t, T) { res -= C[t] * (d + 1 - L[t]); }
    }

    return res;
}

//------------------------------------------------------------------------------
// 現状の最適解を改変してみる
//------------------------------------------------------------------------------
void solveStep3()
{
    rep (i, 1000)
    {
        const ll dd = xor128() % static_cast<unsigned long>(D);
        const ll tt = xor128() % static_cast<unsigned long>(T);

        const ll aa = A[dd];
        A[dd] = tt;

        const ll score = calcScore();
        HighScore = max(HighScore, score);

        if (score < HighScore) { A[dd] = aa; }

        // cerr << "2: HighScore: " << HighScore << ", Score: " << score << endl;
    }
}

int main()
{
    input();

    solveStep1();
    solveStep2();
    solveStep3();

    output();

    return 0;
}


Measured memory_bytes: 3732