#![allow(non_snake_case)]

use std::collections::VecDeque;
use std::io::Read;

const ALPHA_SIZE: usize = 26;

struct State<'a> {
    D: usize,
    C: &'a Vec<i32>,
    S: &'a Vec<Vec<i32>>,
    actions: Vec<usize>
}

impl<'a> State<'a> {
    fn create(D: usize, C: &'a Vec<i32>, S: &'a Vec<Vec<i32>>, actions: Vec<usize>) -> State<'a> {
        assert_eq!(D, actions.len());
        assert_eq!(S[0].len(), ALPHA_SIZE);
        return State { D, C, S, actions };
    }

    fn scores(self: &Self) -> Vec<i32> {
        let mut score = 0;
        let mut scores = vec![];
        let mut last: Vec<i32> = vec![-1; ALPHA_SIZE];
        for d in 0..self.D {
            score += self.S[d][self.actions[d]];
            last[self.actions[d]] = d as i32;
            for c in 0..ALPHA_SIZE {
                score -= (d as i32 - last[c]) * self.C[c];
            }
            scores.push(score);
        }
        return scores;
    }

    fn naive_greedy(self: &Self) -> Vec<usize> {
        let mut score = 0;
        let mut last: Vec<i32> = vec![-1; ALPHA_SIZE];
        let mut next_actions = vec![];
        for d in 0..self.D {

            let mut best_next_score = -1_000_000;
            let mut best_next_action = 0;
            for next_action in 0..ALPHA_SIZE {
                let mut next_score = score;
                next_score += self.S[d][next_action];
                for c in 0..ALPHA_SIZE {
                    if c != next_action {
                        next_score -= (d as i32 - last[c]) * self.C[c];
                    }
                }
                if next_score > best_next_score {
                    best_next_score = next_score;
                    best_next_action = next_action;
                }
            }

            score = best_next_score;
            // dbg!(score, best_next_action, &last, &self.C);
            last[best_next_action] = d as i32;
            next_actions.push(best_next_action);
        }
        next_actions
    }

    fn last_score(self: &Self) -> i32 {
        let mut score = 0;
        let mut last: Vec<i32> = vec![-1; ALPHA_SIZE];
        for d in 0..self.D {
            let diff = d as i32 - last[self.actions[d]];
            score += self.S[d][self.actions[d]];
            score -= diff * (diff - 1) / 2 * self.C[self.actions[d]];
            last[self.actions[d]] = d as i32;
        }
        for c in 0..ALPHA_SIZE {
            let diff = self.D as i32 - last[c];
            score -= diff * (diff - 1)/ 2 * self.C[c]
        }
        score
    }

    fn change(self: &mut Self, d: usize, action: usize) {
        self.actions[d] = action;
    }


}

fn main() {
    let mut buffer = String::new();
    std::io::stdin().read_to_string(&mut buffer).unwrap();
    let mut iter = buffer.split_whitespace();
    let D = iter.next().unwrap().parse::<usize>().unwrap();

    let C: Vec<i32> = (0..ALPHA_SIZE)
        .map(|_| iter.next().unwrap().parse::<i32>().unwrap())
        .collect();
    let S: Vec<Vec<i32>> = (0..D)
        .map(|_| {
            (0..ALPHA_SIZE)
                .map(|_| iter.next().unwrap().parse::<i32>().unwrap())
                .collect()
        })
        .collect();

    // let T = (0..D).map(|_| iter.next().unwrap().parse::<usize>().unwrap() - 1).collect();
    let mut state = State::create(D, &C, &S, vec![0; D]);
    for action in state.naive_greedy() {
        println!("{}", action + 1);
    }

    // let M = iter.next().unwrap().parse::<usize>().unwrap();
    // for _ in 0..M {
    //     let d = iter.next().unwrap().parse::<usize>().unwrap() - 1;
    //     let a = iter.next().unwrap().parse::<usize>().unwrap() - 1;
    //     state.change(d, a);
    //     println!("{}", state.last_score());
    // }

}


Measured memory_bytes: 2248