use proconio::*;
use std::cmp::*;
use std::collections::*;
use std::ops::Bound::*;

fn rand_memory() -> usize {
    Box::into_raw(Box::new("I hope this is a random number")) as usize
}

fn rand() -> usize {
    static mut X: usize = 0;
    unsafe {
        if X == 0 {
            X = rand_memory();
        }
        X ^= X << 13;
        X ^= X >> 17;
        X ^= X << 5;
        X
    }
}

const F: usize = 26;

fn run() {
    input! {
        d: usize,
//        c: [i64; F],
//        mut s: [[i64; F]; d],
    }
    let mut c = vec![0; F];
    let mut s = vec![vec![0; F]; d];
    for c in c.iter_mut() {
        *c = (rand() % 101) as i64;
    }
    for s in s.iter_mut().flatten() {
        *s = (rand() % 20001) as i64;
    }
    let mut t = vec![0; d];
    let mut last = [0; 26];
    for (i, s) in s.iter().enumerate() {
        let i = i as i64 + 1;
        let mut score = (std::i64::MIN, 0);
        for t in 0..F {
            let mut v = 0;
            v += s[t];
            let save = last[t];
            last[t] = i;
            for (c, last) in c.iter().zip(last.iter()) {
                v -= *c * (i - *last);
            }
            score = max(score, (v, t));
            last[t] = save;
        }
        t[i as usize - 1] = score.1;
        last[score.1] = i;
    }
    let mut score = 0;
    let mut set = vec![BTreeSet::new(); F];
    for set in set.iter_mut() {
        set.insert(0);
    }
    for (i, (s, &t)) in s.iter().zip(t.iter()).enumerate() {
        let k = i as i64 + 1;
        score += s[t];
        set[t].insert(i + 1);
        for (c, set) in c.iter().zip(set.iter()) {
            let last = *set.iter().rev().next().unwrap() as i64;
            score -= *c * (k - last);
        }
    }
    for set in set.iter_mut() {
        set.insert(d + 1);
    }
    s.insert(0, vec![]);
    t.insert(0, 0);
    let func = |contest: usize, day: usize| -> i64 {
        let day = day as i64;
        c[contest] * day * (day - 1) / 2
    };
    let mut pos = vec![];
    let mut sum = 0;
    for (i, s) in s.iter().enumerate() {
        for (j, (&s, &c)) in s.iter().zip(c.iter()).enumerate() {
            let val = s + 105 * c;
            if val > 0 {
                pos.push((sum, i, j));
                sum += val;
            }
        }
    }
    let mut max = score;
    for it in 0..400000 {
        let mut history = vec![];
        let mut update = false;
        for _ in 0..10 {
            let (d, q) = match pos.binary_search(&(
                (rand() % sum as usize) as i64,
                std::usize::MAX,
                std::usize::MAX,
            )) {
                Ok(k) => (pos[k].1, pos[k].2),
                Err(k) => (pos[k - 1].1, pos[k - 1].2),
            };
            if t[d] == q {
                continue;
            }
            history.push((d, t[d], q));
            let x = t[d];
            assert!(set[x].remove(&d));
            let a = *set[x]
                .range((Unbounded, Included(&d)))
                .rev()
                .next()
                .unwrap();
            let b = *set[x].range((Included(&d), Unbounded)).next().unwrap();
            score -= s[d][x];
            score += func(x, d - a) + func(x, b - d);
            score -= func(x, b - a);
            let x = q;
            t[d] = x;
            let a = *set[x]
                .range((Unbounded, Included(&d)))
                .rev()
                .next()
                .unwrap();
            let b = *set[x].range((Included(&d), Unbounded)).next().unwrap();
            assert!(set[x].insert(d));
            score += s[d][x];
            score += func(x, b - a);
            score -= func(x, d - a) + func(x, b - d);
            if score > max {
                max = score;
//                println!("{} {}", it, score);
                update = true;
                break;
            }
        }
        if !update {
            score = max;
            for &(d, x, q) in history.iter().rev() {
                assert!(set[q].remove(&d));
                assert!(set[x].insert(d));
                t[d] = x;
            }
        }
    }
    let mut ans = vec![];
    for (i, set) in set.into_iter().enumerate() {
        for v in set {
            if v != 0 && v != d + 1 {
                ans.push((v, i));
            }
        }
    }
    ans.sort();
    for a in ans {
        println!("{}", a.1 + 1);
    }
}

fn main() {
    run();
}


Measured memory_bytes: 2708