#[allow(unused_imports)]
use std::cmp::{Ordering};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

#[allow(unused_imports)]
use std::io::{stdin, stdout, BufWriter, Write};

#[allow(unused_imports)]
use std::iter::FromIterator;

#[allow(unused_macros)]
macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::min($x, min!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($z: expr),+) => {{
        std::cmp::max($x, max!($($z),*))
    }}
}

#[allow(unused_macros)]
macro_rules! get { 
    ([$t: ty]) => { 
        { 
            let mut line = String::new(); 
            stdin().read_line(&mut line).unwrap(); 
            line.split_whitespace().map(|t|t.parse::<$t>().unwrap()).collect::<Vec<_>>()
        }
    };
    ([$t: ty];$n: expr) => {
        (0..$n).map(|_|get!([$t])).collect::<Vec<_>>()
    };
    ($t: ty) => {
        {
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t: ty),*) => {
        { 
            let mut line = String::new();
            stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*)
        }
    };
    ($t: ty; $n: expr) => {
        (0..$n).map(|_|get!($t)).collect::<Vec<_>>()
    };
    ($($t: ty),*; $n: expr) => {
        (0..$n).map(|_|get!($($t),*)).collect::<Vec<_>>()
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*).unwrap();
    }
}

const BIG_STACK_SIZE: bool = true;

#[allow(dead_code)]
fn main() {
    use std::thread;
    if BIG_STACK_SIZE {
        thread::Builder::new()
            .stack_size(32 * 1024 * 1024)
            .name("solve".into())
            .spawn(solve)
            .unwrap()
            .join()
            .unwrap();
    } else {
        solve();
    }
}

fn dfs(node: usize, color: usize, colors: &mut Vec<Vec<Option<usize>>>, visited: &mut Vec<bool>, depths: &mut Vec<Option<usize>>, depth: usize, n: usize) {
    for i in 0..n {
        if node==i {
            continue;
        }
        if colors[i][node].is_some() {
            continue;
        }
        if visited[i] {
            if let Some(d) = depths[i] {
                if d%2 == depth%2 {
                    continue;
                }
            } else {
                depths[i] = Some(depth+1);
            }
            colors[i][node] = Some(color);
            colors[node][i] = Some(color);
        } else {
            colors[i][node] = Some(color);
            colors[node][i] = Some(color);
            depths[i] = Some(depth+1);
            visited[i] = true;
            dfs(i, color, colors, visited, depths, depth+1, n);
        }
    }
}

fn solve() {
    let n = get!(usize);
    let mut res = vec![vec![None;n];n];
    for color in 0..n {
        let mut visited = vec![false;n];
        for node in 0..n {
            if visited[node] {
                continue;
            }
            visited[node] = true;
            let mut depths = vec![None;n];
            depths[node] = Some(0);
            dfs(node,color,&mut res,&mut visited, &mut depths,0,n);
        }
    }

    for i in 0..n-1 {
        for j in i+1..n {
            print!("{} ", res[i][j].unwrap()+1);
        }
        println!("");
    }
}


Measured memory_bytes: 12796