// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <vector>

#include <cmath>

#include <map>

#include <queue>

using namespace std;

#define ll long long



int main() {

    ll d;

    cin >> d;

    ////////

    vector<vector<ll>> s(365, vector<ll>(26, 0));

    vector<int> c(26);

    vector<ll> t(d, 1);

    for(int i = 0; i < 26; i++) cin >> c[i];

    for(int i = 0; i < d; i++) {

        ll tmp = 0;

        for(int j = 0; j < 26; j++) {

            cin >> s[i][j];

            /*if(tmp < s[i][j]) {

                tmp = s[i][j];

                t[i] = j+1;

            }

            */

        }

    }



    /////////////////

    /*

    for(int i = 0; i < d; i++) {

        t[i] = i+1;

    }

    */

    //for(int i = 0; i < d; i++) cin >> t[i];

    ll mx_v = 0;

    vector<ll> swap_set;

    vector<pair<int, int>> p(d);

    for(int i = 0; i < d; i++) {

        mx_v = -1;

        int ni = i, nj = 0;

        for(int j = 0; j < 26; j++) {

            if(s[i][j] > mx_v) {

                mx_v = s[i][j];

                ni = i;

                nj = j;

            }

        }

        swap_set.push_back(mx_v);

        p[i] = make_pair(ni, nj);

        //p.push_back(make_pair(ni, nj));

    }



    ///////////////

    ll m;

    m = d;

    //cin >> m;

    vector<pair<int, int>> dq(m);

    for(int i = 0; i < m; i++) {

        //cin >> dq[i].first >> dq[i].second;

        dq[i].first = p[i].first+1;

        dq[i].second = p[i].second+1;

        //cout << dq[i].first << " " << dq[i].second << endl;

    }

    vector<ll> ans(d, 0);

    ll v = 0;

    //ll tmp = 0;

    map<ll, ll> mp;

    priority_queue<ll> que;

    vector<vector<ll>> list(m, vector<ll>(d, 1));

    //int num = 0;

    for(int k = 0; k < m; k++) {

        //

        //tmp = t[dq[k].first-1];

        //cout << dq[k].first-1 << " " << t[dq[k].first-1] << endl;

        t[dq[k].first-1] = dq[k].second; 



        /////////////////////

        vector<ll> last(26, 0);

        for(int i = 0; i < d; i++) {

            //if(t[i]-1 >= 26) cout << "t: " << t[i]-1 << endl;

            v += s[i][t[i]-1];//-1

            //v += s[t[i]-1][];

            //v += 

            last[t[i]-1] = i+1;//-1

            for(int j = 0; j < 26; j++) {

                v -= c[j]*((i+1)-last[j]);

            }    

        }

        //cout << v << endl;

        que.push(v);

        mp[v] = k;

        for(int i = 0; i < d; i++) {

            //list[k].push_back(t[i]);

            list[k][i] = t[i];

            //cout << t[i] << endl;

        }

        v = 0;

    }



    //cout << mp[que.top()] << endl;

    //cout << list[0].size() << endl;

    //cout << m << endl;

    ll tmp = que.top();

    for(int i = 0; i < m; i++) {

        //cout << list[mp[que.top()]][i] << endl;

        cout << list[mp[tmp]][i] << endl;

        //cout << que.top() << endl;

        //que.pop();

        /*

        cout << "i: " << i << endl;

        for(int j = 0; j < list[i].size(); j++) {

            cout << list[i][j]+1 << endl;

        }

        */

        

    }



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.09687185185917x):
#include <iostream>

#include <algorithm>

#include <vector>

#include <cmath>

using namespace std;

#define ll long long



int d = 365;

vector<vector<int>> s(d+1, vector<int>(26+1, 0));

vector<int> c(26+1);

vector<int> t(d);



ll calc(ll v, int d, int j, vector<ll> last) {

    ll tmp = v;

    ll p = 0;

    last[j] = d;

    //

    for(int i = 0; i < d; i++) {

        tmp -= c[i]*(d-last[i]);

        p -= c[i]*(d-last[i]);

    }

    //return tmp-v;

    p += s[d-1][j];

    return p;

    //return tmp;

}



void init() {

    cin >> d;

    for(int i = 0; i < 26; i++) cin >> c[i];

    for(int i = 0; i < d; i++) {

        for(int j = 0; j < 26; j++) {

            cin >> s[i][j];

        }

    }

    return;

}



int main() {

    init();

    /////////////////

    vector<int> t(d, 1);

    //vector<ll> ans(d, 0);

    vector<ll> last1(26+1, 0), last2(26+1, 0);

    vector<ll> last(26+1, 0);

    ll v = 0;

    ll tmp1 = 0, tmp2 = -1;

    ll ans = 0;

    for(int i = 0; i < d; i++) {

        //v += s[i][t[i]-1];

        //last[t[i]-1] = i+1;

        for(int j = 0; j < 26; j++) {

            //ans[i] -= c[j]*((i+1)-last[j]);

            //t[i] = j+1;

            last1[j] = i+1; // d

            tmp1 = calc(v+s[i][j], (i+1), (j), last);

            if(tmp2 < tmp1) {

                tmp2 = tmp1;

                last1 = last2;

                last2[j] = i+1;

                t[i] = j+1;

                last[j] = i+1;

            }

            // v -= c[j]*((i+1)-last[j]);

        }

        last1 = last2;

        v += (tmp2-v);

        ans += tmp2;

        tmp1 = 0, tmp2 = 0;

        //cout << "v: " << v << endl;

    }

    

    for(int i = 0; i < d; i++) {

        //cout << "i: " << i << " " << t[i] << endl;

        cout << t[i] << endl;

    }

    //cout << ans << endl;

    return 0;

}