#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

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

fn set_residual(offset: usize, grid: &mut Vec<Vec<char>>) {
    let n = grid.len();
    for xx in 0..(n - offset) / 4 {
        for yy in 0..(n - offset) / 4 {
            if xx != yy {
                continue;
            }
            for y in 0..2 {
                for x in 0..2 {
                    let x0 = 4 * xx + x * 2 + offset;
                    let y0 = 4 * yy + y * 2 + offset;
                    if x % 2 == y % 2 {
                        grid[y0][x0] = 'a';
                        grid[y0 + 1][x0] = 'a';
                        grid[y0][x0 + 1] = 'b';
                        grid[y0 + 1][x0 + 1] = 'b';
                    } else {
                        grid[y0][x0] = 'c';
                        grid[y0][x0 + 1] = 'c';
                        grid[y0 + 1][x0] = 'd';
                        grid[y0 + 1][x0 + 1] = 'd';
                    }
                }
            }
        }
    }
}

fn main() {
    let n = read::<usize>();
    if n == 2 {
        println!("-1");
        return;
    }
    let mut grid = vec![vec!['.'; n]; n];
    if n % 4 == 0 {
        set_residual(0, &mut grid);
    } else if n % 4 == 2 {
        let mut rows = vec![];
        rows.push("aab..e");
        rows.push("d.b..e");
        rows.push("dccff.");
        rows.push("..eaab");
        rows.push("..ed.b");
        rows.push("ff.dcc");
        for (y, ref row) in rows.into_iter().enumerate() {
            for (x, ch) in row.chars().enumerate() {
                grid[y][x] = ch;
            }
        }
        set_residual(6, &mut grid);
    } else if n == 3 {
        grid[0] = vec!['.', '.', 'a'];
        grid[1] = vec!['.', '.', 'a'];
        grid[2] = vec!['a', 'a', '.'];
    } else if n % 4 == 1 {
        let mut rows = vec![];
        rows.push("aabbc");
        rows.push("h..ic");
        rows.push("h..id");
        rows.push("gjj.d");
        rows.push("gffee");
        for (y, ref row) in rows.into_iter().enumerate() {
            for (x, ch) in row.chars().enumerate() {
                grid[y][x] = ch;
            }
        }
        set_residual(5, &mut grid);
    } else {
        let mut rows = vec![];
        rows.push("ee..ggh");
        rows.push("p.ff..h");
        rows.push("p...bl.");
        rows.push(".o..bl.");
        rows.push(".oaa..j");
        rows.push("n..ll.j");
        rows.push("nmm..kk");
        for (y, ref row) in rows.into_iter().enumerate() {
            for (x, ch) in row.chars().enumerate() {
                grid[y][x] = ch;
            }
        }
        set_residual(7, &mut grid);
    }

    for row in grid {
        for mass in row {
            print!("{}", mass);
        }
        println!("");
    }
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 9084