#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
char s[N][N];
int a[N], n, l, r, cnt;
int main() {
  cin >> n;
  cnt = n + 1;
  int ans = n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] != i) {
      if (!l) l = i;
      r = i;
    }
  }
  if (l) {
    ans--;
    for (int i = 1;; i ^= 1) {
      l = 0, r = 0;
      for (int i = 1; i <= n; i++) {
        if (a[i] != i) {
          if (!l) l = i;
          r = i;
        }
      }
      if (!l || l == r) break;
      --cnt;
      if (i == 1) {
        s[cnt][l] = s[cnt][r] = s[cnt][a[l]] = '/';
        a[r] = a[a[l]], a[a[l]] = a[l];
      } else {
        s[cnt][l] = s[cnt][r] = s[cnt][a[r]] = '\\';
        a[l] = a[a[r]], a[a[r]] = a[r];
      }
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (!s[i][j])
        putchar('.');
      else
        putchar(s[i][j]);
    }
    puts("");
  }
}
