#include <bits/stdc++.h>
using namespace std;
int n, a[1006], last;
char ans[1006][1006];
signed main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    if (a[i] != i) last = i;
  }
  if (last) {
    char x = '/', y = '\\';
    for (int i = n; i; --i) {
      int p = 0;
      if (x == '/') {
        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]] = x;
      a[last] = a[a[p]], a[a[p]] = a[p], last = p;
      swap(x, y);
      cerr << last << endl;
    }
  }
  printf("%d\n", n - (!!last));
  for (int i = 1; i <= n; ++i, puts(""))
    for (int j = 1; j <= n; ++j) putchar(ans[i][j] ? ans[i][j] : '.');
}
