#include <bits/stdc++.h>
using namespace std;
int n, m;
int A[1036], vis[1036];
char as[1036][1036];
void solve() {
  cin >> n;
  int fuck = 0;
  for (int i = (1), iend = (n); i <= iend; ++i)
    scanf("%d", A + i), fuck |= (A[i] != i);
  if (!fuck) {
    cout << n << endl;
    for (int i = (1), iend = (n); i <= iend; ++i) {
      for (int j = (1), jend = (n); j <= jend; ++j) putchar('.');
      puts("");
    }
    return;
  }
  int cn = 0;
  for (int i = (1), iend = (n); i <= iend; ++i)
    if (i != A[i] && !vis[i]) {
      int t = i;
      if (i != 1) as[cn + 1][1] = '/';
      vis[t] = 1;
      while (A[t] != i) {
        if (t != 1) {
          int p = A[t];
          ++cn;
          if (t < p)
            as[cn][t] = '/', as[cn][p] = '/';
          else
            as[cn][t] = as[cn][p] = '\\';
        }
        t = A[t];
        vis[t] = 1;
      }
      ++cn;
      as[cn][t] = '\\', as[cn][1] = '\\';
    }
  cout << n - 1 << endl;
  for (int i = (1), iend = (n); i <= iend; ++i) {
    for (int j = (1), jend = (n); j <= jend; ++j)
      putchar(as[i][j] ? as[i][j] : '.');
    puts("");
  }
}
signed main() { solve(); }
