macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize
    }
    if n == 2 {
        println!("-1");
        return;
    }
    let mut ans = vec![vec!['.'; n]; n];
    let b3 = vec![vec!['a', 'a', '.'],
                  vec!['.', '.', 'a'],
                  vec!['.', '.', 'a']];
    let b4 = vec![vec!['a', 'a', 'b', 'c'],
                  vec!['d', 'd', 'b', 'c'],
                  vec!['e', 'f', 'g', 'g'],
                  vec!['e', 'f', 'h', 'h']];
    let b5 = vec![vec!['a', 'b', 'b', 'c', 'c'],
                  vec!['a', 'd', 'd', '.', 'e'],
                  vec!['f', '.', '.', 'g', 'e'],
                  vec!['f', '.', '.', 'g', 'h'],
                  vec!['i', 'i', 'j', 'j', 'h']];
    let b7 = vec![vec!['.', 'a', 'a', 'b', 'c', 'c', '.'],
                  vec!['d', '.', '.', 'b', '.', '.', 'g'],
                  vec!['d', '.', 'm', 'm', '.', '.', 'g'],
                  vec!['e', 'e', '.', '.', 'n', 'h', 'h'],
                  vec!['f', '.', '.', '.', 'n', '.', 'i'],
                  vec!['f', '.', '.', 'k', '.', '.', 'i'],
                  vec!['.', 'j', 'j', 'k', 'l', 'l', '.']];
    if n == 7 {
        copy(0, &b7, &mut ans);
    } else if n == 11 {
        copy(0, &b4, &mut ans);
        copy(4, &b7, &mut ans);
    } else if n % 3 == 0 {
        for i in 0..n / 3 {
            copy(3 * i, &b3, &mut ans);
        }
    } else {
        let (mut a, mut b) = ex_euc(4, 5, n as i64).unwrap();
        if a < 0 {
            let d = (a.abs() + 4) / 5;
            a += d * 5;
            b -= d * 4;
        }
        if b < 0 {
            let d = (b.abs() + 3) / 4;
            a -= d * 5;
            b += d * 4;
        }
        let a = a as usize;
        let b = b as usize;
        for i in 0..a {
            copy(4 * i, &b4, &mut ans);
        }
        for i in 0..b {
            copy(4 * a + 5 * i, &b5, &mut ans);
        }
    }
    for s in &ans {
        println!("{}", s.iter().cloned().collect::<String>());
    }
}

fn copy(x: usize, a: &Vec<Vec<char>>, b: &mut Vec<Vec<char>>) {
    let l = a.len();
    for i in 0..l {
        for j in 0..l {
            b[x + i][x + j] = a[i][j];
        }
    }
}

fn gcd(n: usize, m: usize) -> usize {
    let mut l = min(n, m);
    let mut r = max(n, m);
    while l > 0 {
        let t = l;
        l = r % l;
        r = t;
    }
    r
}

fn ex_euc(a: i64, b: i64, c: i64) -> Option<(i64, i64)> {
    if a == 0 && b == 0 {
        return if c == 0 { Some((0,0)) } else { None };
    }
    let d = gcd(a.abs() as usize, b.abs() as usize) as i64;
    if c % d != 0 {
        return None;
    }
    Some(ex_euc_rec(a, b, c))
}

fn ex_euc_rec(a: i64, b: i64, c: i64) -> (i64, i64) {
    if b == 0 {
        return (c / a, 0);
    }
    let (x, y) = ex_euc_rec(b, a % b, c);
    (y, x - a / b * y)
}


Measured memory_bytes: 9340