import java.io.*;
import java.util.*;

public class puzzle_md implements Runnable {
	private BufferedReader in;
	private PrintWriter out;

	public void run() {
		try {
			solve();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	private void solve() throws IOException {
		Locale.setDefault(Locale.US);
		in = new BufferedReader(new FileReader("puzzle.in"));
		out = new PrintWriter("puzzle.out");
		int n = Integer.parseInt(in.readLine());
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = in.readLine();
			jloop:
			for (int j = 0; j < i; j++) {
				for (int k = 0; k < i; k++) {
					if (s[k].charAt(i) != s[k].charAt(j))
						continue jloop;
				}
				// columns j and i coincide
				for (int k = 0; k < n; k++) {
					if (s[i].charAt(k) != s[i].charAt((k + i - j) % n)) {
						int shift = (k + n - j) % n;
						s[i] = s[i].substring(shift) + s[i].substring(0, shift);
						break jloop;
					}
				}
				throw new RuntimeException();
			}
		}
		out.println("Yes");
		for (int i = 0; i < n; i++) {
			out.println(s[i]);
		}
		in.close();
		out.close();
	}

	public static void main(String[] args) {
		new Thread(new puzzle_md()).start();
	}
}
