#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <memory>
#include <regex>
using namespace std;

#ifdef _WIN32
#define NOMINMAX
#define byte win_byte_override
#include <Windows.h>
#endif
class TicToc
{
private:
    double getCurrTime(){
    #ifdef _WIN32
        return GetTickCount() * 1e-3;
    #else
        uint32_t low, high;
        __asm__ volatile ("rdtsc" : "=a" (low), "=d" (high));
        uint64_t t = ((uint64_t)low) | ((uint64_t)high << 32);
        return t / (1250000000LL * 2.23);
    #endif
    }
    double startTime;
public:
    void tic(){
        startTime = getCurrTime();
    }
    double toc(){
        return getCurrTime() - startTime;
    }
};

class Xorshift
{
private:
    uint32_t x, y, z, w;
public:
    Xorshift(uint32_t seed=88675123, int32_t loop=50){
        x = 123456789;
        y = 362436069;
        z = 521288629;
        w = seed;
        while(--loop >= 0){
            (*this)();
        }
    }
    uint32_t operator()(){
        uint32_t t=(x^(x<<11));
        x=y; y=z; z=w;
        return w=(w^(w>>19))^(t^(t>>8));
    }
    uint32_t operator()(uint32_t size){
        return (*this)() % size;
    }
    uint64_t get64(){
        uint64_t a = (*this)();
        uint64_t b = (*this)();
        return (a << 32) | b;
    }
    uint64_t get64(uint64_t size){
        return get64() % size;
    }
    template <class T>
    void shuffle(vector<T>& v){
        uint32_t n = v.size();
        for(uint32_t i=0; i<n-1; ++i){
            uint32_t j = (*this)(n-i) + i;
            swap(v[i], v[j]);
        }
    }
};
Xorshift xorshift;

/***********************************************************/

int main()
{
    int n = 26;
    int days;
    cin >> days;
    vector<int> c(n);
    for(int i=0; i<n; ++i)
        cin >> c[i];
    vector<vector<int> > s(days, vector<int>(n));
    for(int d=0; d<days; ++d){
        for(int i=0; i<n; ++i){
            cin >> s[d][i];
        }
    }

    priority_queue<tuple<int, int, int> > pq;
    vector<vector<int> > diff(days, vector<int>(n));
    for(int d=0; d<days; ++d){
        for(int i=0; i<n; ++i){
            int x = (n - i) * c[d] + s[d][i];
            diff[d][i] = x;
            pq.push(make_tuple(x, d, i));
        }
    }

    vector<int> select(days, -1);
    while(!pq.empty()){
        auto [x, d, i] = pq.top();
        pq.pop();
        if(select[d] != -1 || diff[d][i] != x)
            continue;
        select[d] = i;

        int sum = 0;
        int cnt = 0;
        for(int d=days-1; d>=0; --d){
            if(select[d] == i){
                sum = 0;
                cnt = 0;
            }
            else{
                ++ cnt;
                sum += cnt * c[i];
                int tmp = sum + s[d][i];
                if(diff[d][i] != tmp){
                    diff[d][i] = tmp;
                    pq.push(make_tuple(tmp, d, i));
                }
            }
        }
    }

    for(int d=0; d<days; ++d)
        cout << (select[d] + 1) << endl;

    return 0;
}


Measured memory_bytes: 3856