#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
char ans[N][N];
int n, a[N];
int main() {
  scanf("%d", &n);
  for (int i = (int)(1); i <= (int)(n); i++)
    for (int j = (int)(1); j <= (int)(n); j++) ans[i][j] = '.';
  bool fl = 1;
  for (int i = (int)(1); i <= (int)(n); i++) {
    int x;
    scanf("%d", &x);
    if (x != i) fl = 0;
    a[x] = i;
  }
  if (fl) {
    printf("%d\n", n);
    for (int i = (int)(1); i <= (int)(n); i++) {
      for (int j = (int)(1); j <= (int)(n); j++) putchar('.');
      puts("");
    }
    return 0;
  }
  a[1] = -1;
  printf("%d\n", n - 1);
  for (int h = (int)(1); h <= (int)(n); h++) {
    int dl = -1, dr = -1;
    for (int i = (int)(1); i <= (int)(n); i++)
      if (a[i] != i) {
        dl = i;
        break;
      }
    for (int i = (int)(n); i >= (int)(1); i--)
      if (a[i] != i) {
        dr = i;
        break;
      }
    if (dl == dr) {
    } else if (a[dl] == -1) {
      int t = a[dr];
      ans[h][dl] = ans[h][dr] = ans[h][t] = '/';
      a[dl] = a[t];
      a[t] = a[dr];
      a[dr] = -1;
    } else {
      int t = a[dl];
      ans[h][dr] = ans[h][dl] = ans[h][t] = '\\';
      a[dr] = a[t];
      a[t] = a[dl];
      a[dl] = -1;
    }
    printf("%s\n", ans[h] + 1);
  }
}
