#include <bits/stdc++.h>
using namespace std;
int arr[1009];
bool vis[1009];
char mat[1009][1009];
int lst;
int dfs(int u) {
  vis[u] = true;
  int v = arr[u];
  if (vis[v]) return u;
  if (v < u) {
    mat[lst - 1][u - 1] = '/';
    mat[lst - 1][v - 1] = '/';
    lst--;
  } else if (v > u) {
    mat[lst - 1][u - 1] = '\\';
    mat[lst - 1][v - 1] = '\\';
    lst--;
  }
  return dfs(v);
}
int main() {
  int n, val, prv;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &val);
    prv = val;
    arr[val] = i;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) mat[i][j] = '.';
  bool eq = true;
  for (int i = 1; i <= n; i++) {
    if (arr[i] != i) eq = false;
  }
  if (eq) {
    printf("%d\n", n);
    for (int i = 0; i < n; i++) printf("%s\n", mat[i]);
    return 0;
  }
  lst = n;
  vis[n] = true;
  if (arr[n] != n) {
    int k = dfs(arr[n]);
    mat[lst - 1][k - 1] = '\\';
    mat[lst - 1][n - 1] = '\\';
    lst--;
  }
  for (int i = n; i > 0; i--) {
    if (vis[i]) continue;
    if (arr[i] == i) continue;
    int ini = lst;
    int k = dfs(i);
    mat[lst - 1][k - 1] = '\\';
    mat[lst - 1][n - 1] = '\\';
    mat[ini - 1][n - 1] = '/';
    lst--;
  }
  printf("%d\n", n - 1);
  for (int i = 0; i < n; i++) printf("%s\n", mat[i]);
  return 0;
}
