#include <bits/stdc++.h>
using namespace std;
const int maxn = 1003;
int n;
int tar[maxn];
char g[maxn][maxn];
int done[maxn], cut[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &tar[i]);
  printf("%d\n", n - !(is_sorted(tar + 1, tar + 1 + n)));
  for (int i = 1, tot = n + 1; i <= n; i++)
    if (!done[i]) {
      int u = i;
      while (!done[u]) {
        done[u] = 1;
        if (u == 1 || u == tar[u]) goto G;
        tot--;
        if (!cut[tar[u]]) {
          cut[u] = cut[tar[u]] = 1;
          if (tar[u] > u)
            g[tot][u] = g[tot][tar[u]] = '/';
          else
            g[tot][u] = g[tot][tar[u]] = '\\';
        } else {
          cut[u] = cut[1] = 1;
          g[tot][u] = '\\', g[tot][1] = '\\';
          int p = n;
          while (!g[p][tar[u]]) p--;
          g[p][1] = '/';
        }
      G:
        u = tar[u];
      }
    }
  for (int i = n; i >= 1; i--) {
    for (int j = 1; j <= n; j++) {
      if (!g[i][j])
        putchar('.');
      else
        putchar(g[i][j]);
    }
    puts("");
  }
  return 0;
}
