Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).

Iahub wants to know how many Coders can be placed on an n × n chessboard, so that no Coder attacks any other Coder.

Input

The first line contains an integer n (1 ≤ n ≤ 1000).

Output

On the first line print an integer, the maximum number of Coders that can be placed on the chessboard.

On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'.

If there are multiple correct answers, you can print any.

Examples

Input

2


Output

2
C.
.C
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.stream.Collectors;

public class Solution {
    public static void main(String[] args) throws IOException {
        IO io = new IO();
        int n = io.getInt(), cnt = 0 ;
        List<String> res = new ArrayList<>() ;

        for(int i = 0 ; i < n ; i++){
            StringBuilder sb = new StringBuilder() ;
            for(int j = 0 ; j < n ; j++){
                if((i % 2 == 0 && j % 2 == 0) || (i % 2 != 0 && j % 2 != 0)) {
                    sb.append('C');
                    cnt++ ;
                }
                else
                    sb.append('.') ;
            }
            res.add(sb.toString()) ;
        }
        System.out.println(cnt) ;
        System.out.println(Utils.join(res, "\n"));
    }

    public static int saturate(int n){
        while(n != 0 && n % 2 == 0)
            n /= 2 ;
        while(n != 0 && n % 3 == 0)
            n /= 3 ;
        return n ;
    }

    public static long subSum(long[] preSum, int i, int j) {
        if (i > j)
            return Integer.MIN_VALUE;
        if (i == 0)
            return preSum[j];
        return preSum[j] - preSum[i - 1];
    }
}

class Utils {
    public static <T> ArrayList<IndexedElement<T>> getIndexedArray(ArrayList<T> ip) {
        ArrayList<IndexedElement<T>> op = new ArrayList<>();
        for (int i = 0; i < ip.size(); i++) {
            op.add(new IndexedElement<>(i, ip.get(i)));
        }
        return op;
    }

    public static <T> String join(List<T> arr, CharSequence delim) {
        StringJoiner sj = new StringJoiner(delim);
        for (T a : arr)
            sj.add(a.toString());
        return sj.toString();
    }

    public static void reverse(List<Integer> a, int l, int h) {
        int n = a.size();
        if (l >= 0 && l < n && h >= 0 && h < n && l < h) {
            while (l < h) {
                int temp = a.get(l);
                a.set(l, a.get(h));
                a.set(h, temp);
                l++;
                h--;
            }
        }
    }

    public static int andBitString(String s) {
        if (s.length() == 0)
            return 1;
        int res = s.charAt(0) - '0';
        for (int i = 1; i < s.length(); i++)
            res = res & (s.charAt(i) - '0');
        return res;
    }

    static class IndexedElement<T> {
        int idx;
        T val;

        public IndexedElement(int idx, T val) {
            this.idx = idx;
            this.val = val;
        }

        @Override
        public String toString() {
            return "IndexedElement{" +
                    "idx=" + idx +
                    ", val=" + val +
                    '}';
        }
    }
}

class IO {
    private BufferedReader br = null;

    public IO() {
        this.br = new BufferedReader(new InputStreamReader(System.in));
    }

    public ArrayList<Integer> getIntegerArray(int n) throws IOException {
        ArrayList<String> strings = this.getStringArray(n);
        return new ArrayList<>(strings.stream().map(Integer::parseInt).collect(Collectors.toList()));
    }

    public int getInt() throws IOException {
        return getIntegerArray(1).get(0);
    }

    public ArrayList<Long> getLongArray(int n) throws IOException {
        ArrayList<String> strings = this.getStringArray(n);
        return new ArrayList<>(strings.stream().map(Long::parseLong).collect(Collectors.toList()));
    }

    public ArrayList<Double> getDoubleArray(int n) throws IOException {
        ArrayList<String> strings = this.getStringArray(n);
        return new ArrayList<>(strings.stream().map(Double::parseDouble).collect(Collectors.toList()));
    }

    public ArrayList<String> getStringArray(int n) throws IOException {
        ArrayList<String> arr = new ArrayList<>();
        StringTokenizer st = new StringTokenizer(br.readLine());

        while (st.hasMoreTokens()) {
            arr.add(st.nextToken());
        }

        return arr;
    }

    public ArrayList<Pair<Integer>> getIntegerPairArray(int n) throws IOException {
        ArrayList<Pair<Integer>> pairs = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            StringTokenizer st = new StringTokenizer(br.readLine());
            pairs.add(new Pair<>(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken())));
        }
        return pairs;
    }

    static class Pair<T> {
        T a, b;

        public Pair(T a, T b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "a=" + a +
                    ", b=" + b +
                    '}';
        }
    }
}