#include <bits/stdc++.h>
using namespace std;
int n, nw, p, a[1010], ans[1010][1010], x = 2, y = 3;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (i != a[i]) nw = i;
  }
  if (nw) {
    for (int i = n; i >= 1; i--, x ^= 1, y ^= 1) {
      p = 0;
      if (x & 1) {
        for (int j = nw + 1; j <= n; j++)
          if (a[j] != j) p = j;
      } else
        for (int j = nw - 1; j >= 1; j--)
          if (a[j] != j) p = j;
      if (!p) break;
      ans[i][p] = ans[i][nw] = ans[i][a[p]] = x;
      a[nw] = a[a[p]], a[a[p]] = a[p], nw = p;
    }
  }
  printf("%d\n", n - (!!nw));
  for (int i = 1; i <= n; i++, puts(""))
    for (int j = 1; j <= n; j++)
      putchar(ans[i][j] ? (ans[i][j] & 1 ? '\\' : '/') : '.');
}
