#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <cmath> // fabs, pow, sqrt, sin, fmod
#include <chrono> // system_clock 
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <random>

using namespace std;
using namespace chrono;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
    system_clock::time_point  start, end; //時間計測用

    start = chrono::system_clock::now(); //計測開始

    int D;
    cin >> D;

    vector<int> c(26);
    rep(i, 26) {
        cin >> c.at(i);
    }

    vector<vector<int>> s(D, vector<int>(26));
    rep(d, D) {
        rep(i, 26) {
            cin >> s.at(d).at(i);
        }
    }

    vector<int> t(D); //その日に選んだコンテスト

    //スコア計算
    int score = 0;

    vector<int> last(26);
    rep(i,26) last[i]= -1;

    rep(d, D) { //d:day
        int max_t = 1;
        int max_score = 0;

        rep(i, 26) { //i:contest
            int tmp_score = score;
            vector<int> tmp_last = last;
            t[d] = i;
            tmp_last[t.at(d)] = d;
            tmp_score += s[d][t[d]];
            rep(j, 26) { 
                tmp_score -= c[j] * (d - tmp_last[j]);
            }
            if(max_score < tmp_score) {
                max_t = i;
                max_score = tmp_score;
            }
        }
        t[d] = max_t;
        last[max_t] = d;
        score = max_score;
    }

    end = chrono::system_clock::now();
    double elapsed = chrono::duration_cast<std::chrono::milliseconds>(end-start).count();

    while(elapsed < 1900) {
        int change_d = rand()%D;
        int change_t = rand()%26;
        int before_t = t[change_d];
        int tmp_score = score;

        tmp_score -= s[change_d][before_t];
        tmp_score += s[change_d][change_t];

        int tmp_last_before = -1;
        int tmp_last_after = -1;

        rep(d, D) {            
            if(before_t == t[d]) {
                if(change_d != d) {
                    tmp_last_after = d;
                }
                tmp_last_before = d;               
            } 
            tmp_score += c[before_t] * (d - tmp_last_before);
            tmp_score -= c[before_t] * (d - tmp_last_after);
        }

        tmp_last_before = -1;
        tmp_last_after = -1;

        rep(d, D) { 
            if(change_d == d) {
                tmp_last_after = d;
            }           
            if(change_t == t[d]) {
                tmp_last_before = d;     
                tmp_last_after = d;          
            } 
            tmp_score += c[change_t] * (d - tmp_last_before);
            tmp_score -= c[change_t] * (d - tmp_last_after);
        }

        if(tmp_score > score) {
            score = tmp_score;
            t[change_d] = change_t;
        }

        end = chrono::system_clock::now();
        elapsed = chrono::duration_cast<std::chrono::milliseconds>(end-start).count();
    }

    rep(d, D) {
        cout << t[d]+1 << endl;
    }
    
}

Measured memory_bytes: 3600