#include <bits/stdc++.h>
using namespace std;
const int maxn = 1050;
int n, last, a[maxn];
char ans[maxn][maxn];
int read() {
  int x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + (c ^ 48), c = getchar();
  return x;
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) ans[i][j] = '.';
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    if (a[i] != i) last = i;
  }
  if (last) {
    int p;
    char c = '/', c1 = '\\';
    for (int i = 1; i <= n; i++) {
      p = 0;
      if (c == '/') {
        for (int j = 1; j < last; j++) {
          if (a[j] != j) {
            p = j;
            break;
          }
        }
      } else {
        for (int j = n; j > last; j--) {
          if (a[j] != j) {
            p = j;
            break;
          }
        }
      }
      if (!p) break;
      ans[i][p] = ans[i][last] = ans[i][a[p]] = c;
      a[last] = a[a[p]], a[a[p]] = a[p], last = p;
      swap(c, c1);
    }
  }
  printf("%d\n", n - (last > 0));
  for (int i = n; i >= 1; i--) {
    for (int j = 1; j <= n; j++) printf("%c", ans[i][j]);
    printf("\n");
  }
  return 0;
}
