#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPi(i, a, b) for(int i=int(a); i<int(b); i++)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define mp make_pair
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll MOD = 1e9+7;

#define T 26

int D;
ll C[30];
ll S[400][30];

void input(){
    cin >> D;
    REP(i,T)
        scanf("%lld", &C[i]);
    REP(i,D)
        REP(j,T)
            scanf("%lld", &S[i][j]);
}

void output(ll X[]){
    REP(i,D)
        printf("%lld\n", X[i]+1);
}

class CalcScore{
    int num;
    int last[T];
    int last_bak[T];

    public:
    CalcScore(int X){
        num = X;
        REP(t,num)
            last[t] = -1;
    }

    void backup(){
        REP(t,num)
            last_bak[t] = last[t];
    }

    void restore(){
        REP(t,num)
            last[t] = last_bak[t];
    }

    //TODO : restart
    // O(DT) = O(365 * 26) = O(10 ** 4)
    void calc_score(ll score[], ll ans[]){
        vector<int> test_last(num, -1);
        ll s = 0;
        REP(d,D){
            s += S[d][ans[d]];
            test_last[ans[d]] = d;

            REP(i,T){
                s -= C[i] * (d - test_last[i]);
            }
            score[d] = s;
        }
    }
};

void evaluate01(vector<ll>& X, vector<ll>& last, ll day){
    ll minus = 0;
    REP(i, T){
        minus += C[i] * (day - last[i]);
    }

    REP(i, T){
        ll m = minus - C[i] * (day - last[i]);
        ll plus = S[day][i];
        X[i] = plus - m;
    }
}

// eval on (day+k)
void evaluate02(vector<ll>& X, vector<ll>& last, ll day, ll k){
    ll minus = 0;
    ll fin = min((ll)D, day+k);
    REPi(d,day,fin)
        REP(i, T){
            minus += C[i] * (d - last[i]);
        }

    REP(i, T){
        ll m = minus;
        REPi(d,day,fin)
            m -= C[i] * (d - last[i]);
        REPi(d,day,fin)
            m += C[i] * (d - day);
        ll plus = S[day][i];
        X[i] = plus - m;
    }
}

void greedy(ll X[]){
    vector<ll> last(T, -1);
    REP(d, D){
        vector<ll> val(T);

        evaluate02(val, last, d, 4);

        ll high = -1e15;
        ll t;
        REP(i, T){
            if(high < val[i]){
                high = val[i];
                t = i;
            }
        }
        X[d] = t;
        last[t] = d;
    }
}

int main(){
    input();

    ll ans[400];

    // greedy
    greedy(ans);

    //ll V[400];
    ll S[400];
    CalcScore sc(T);
    sc.calc_score(S, ans);
    ll score = S[D-1];

    while(1){
        int day = rand() % 365;
        int cont = rand() % 26;
        int pre_val = ans[day];
        ll pre_score = score;

        ans[day] = cont;
        sc.calc_score(S, ans);

        //CalcScore test(T);
        //ll TEST[5400];
        //test.calc_score(TEST, ans);
        //cerr << TEST[D-1] << " : " << S[D-1] << endl;

        if(S[D-1] <= pre_score){
            ans[day] = pre_val;
            sc.restore();
        }
        else{
            //printf("%lld -> %lld\n", pre_score, S[D-1]);
            score = S[D-1];
        }

        if((clock()*1000/CLOCKS_PER_SEC) > 1900)
        //if((clock()*1000/CLOCKS_PER_SEC) > 190)
            break;
    }

    output(ans);
    return 0;
}


Measured memory_bytes: 3928