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

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;

#[fastout]
fn run() {
    input! {
        d: usize,
        c: [i64; F],
        mut s: [[i64; F]; d],
    }
    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 _ in 0..5000000 {
        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;
        }
        let save = t[d];
        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;
        } else {
            score = max;
            t[d] = save;
            assert!(set[x].remove(&d));
            assert!(set[save].insert(d));
        }
    }
    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: 2688