#include <cstdio>
#include <cmath>
#include <set>

using namespace std;

const int C = 26;
const int D = 365;
int c[C];
int s[D][C];
int down[C];
int ans[D];
set<int> last[C];

class Timer {
    public:
    void start() {
        origin = rdtsc();
    }
    
    double get_time() {
        return (rdtsc() - origin) / 3.0e9;
    }
    
    private:
    unsigned long long origin;
    
    inline static unsigned long long rdtsc() {
        unsigned long long lo, hi;
        __asm__ volatile ("rdtsc" : "=a" (lo), "=d" (hi));
        return (hi << 32) | lo;
    }
};

class Random {
    public:
    // [0, x)
    static unsigned get(unsigned x) {
        return xorshift() % x;
    }
    
    // [x, y]
    static unsigned get(unsigned x, unsigned y) {
        return get(y - x + 1) + x;
    }
    
    static unsigned get_fast(unsigned x) {
        return xorshift() & x;
    }
    
    static bool toss() {
        return xorshift() & 1;
    }
    
    private:
    inline static unsigned xorshift() {
        static unsigned x = 123456789, y = 362436039, z = 521288629, w = 88675123;
        unsigned t = x ^ (x << 11);
        x = y, y = z, z = w;
        return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
    }
};

bool accept(double current_time, double current_score, double next_score) {
    if (next_score > current_score) return true;
    
    const int x = 65535;
    const double start_temp = 10000;
    const double end_temp = 1e-9;
    double temp = start_temp + (end_temp - start_temp) * current_time * 0.5;
    double prob = exp((next_score - current_score) / temp);
    return prob * x > Random::get_fast(x);
}

int main() {
    int score = 0, cnt = 0, i, j;
    set<int>::iterator it1, it2;
    Timer timer;
    
    timer.start();
    
    scanf("%*d");
    
    for (i = 0; i < C; i++) scanf("%d", &c[i]);
    
    for (i = 0; i < D; i++) {
        for (j = 0; j < C; j++) {
            scanf("%d", &s[i][j]);
        }
    }
    
    for (i = 0; i < C; i++) {
        last[i].insert(-1);
        last[i].insert(D);
    }
    
    for (i = 0; i < D; i++) {
        int best = -1e9, index = -1;
        
        for (j = 0; j < C; j++) down[j] += c[j];
        
        for (j = 0; j < C; j++) {
            int sum = s[i][j] + down[j];
            
            if (sum > best) {
                best = sum;
                index = j;
            }
        }
        
        down[index] = 0;
        last[index].insert(i);
        ans[i] = index;
        
        score += s[i][index];
        for (j = 0; j < C; j++) score -= down[j];
    }
    
    for (; ; cnt++) {
        double t = timer.get_time();
        int day = Random::get(D);
        int type = Random::get(C);
        int index = ans[day];
        int next_score = score;
        
        if (t >= 1.9) break;
        
        if (index == type) continue;
        
        next_score -= s[day][index];
        next_score += s[day][type];
        
        it1 = it2 = last[index].find(day);
        it1--;
        it2++;
        
        next_score -= c[index] * (day - *it1) * (*it2 - day);
        
        it1 = it2 = last[type].lower_bound(day);
        it1--;
        
        next_score += c[type] * (day - *it1) * (*it2 - day);
        
        if (accept(t, score, next_score)) {
            last[index].erase(day);
            last[type].insert(day);
            ans[day] = type;
            score = next_score;
        }
    }
    
    for (i = 0; i < D; i++) printf("%d\n", ans[i] + 1);
    
    fprintf(stderr, "count: %d\n", cnt);
    fprintf(stderr, "score: %d\n", score + 1000000);
    
    return 0;
}


Measured memory_bytes: 3880