#include <bits/stdc++.h>
using namespace std;
int p[1010], vst[1010];
char s[1010][1010];
int main() {
  int n;
  scanf("%d", &n);
  int x = n, ed = 0, pos = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", p + i);
    if (p[i] != i) ed = i;
    for (int j = 1; j <= n; j++) s[i][j] = '.';
  }
  for (int i = 1; i <= n; i++)
    if (p[i] == ed) pos = i;
  p[pos] = p[ed], p[ed] = ed;
  for (int i = 1; i <= ed; i++)
    if (!vst[i] && p[i] != i) {
      int u = i;
      char dir = '/';
      while (!vst[u]) {
        vst[u] = 1;
        if (dir == '/') {
          s[x][u] = '/';
          if (p[u] > u)
            s[x][p[u]] = '/';
          else {
            s[x--][ed] = '/';
            s[x][ed] = s[x][p[u]] = dir = '\\';
          }
        } else {
          s[x][u] = '\\';
          if (p[u] < u)
            s[x][p[u]] = '\\';
          else {
            s[x--][i] = '\\';
            s[x][i] = s[x][p[u]] = dir = '/';
          }
        }
        u = p[u];
      }
      x--;
    }
  if (ed) s[x][p[pos]] = s[x][ed] = '/';
  printf("%d\n", n - !!ed);
  for (int i = 1; i <= n; i++) printf("%s\n", s[i] + 1);
}
