// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	for (ll i = 0; i < sz(cs) - 1; i++) {
		++j;
		ll x = cs[i];
		setout(x, j);
	}
	ll x = cs.back();
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 1; i < sz(cs); i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		ll j = i;
		while (j != i) {
			j = a[j];
			used[j] = 1;
			if (j == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(j);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
	++j;
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '/';
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
	}
	ll x = cs.back();
	ans[j][n - 1] = '\\';
	ans[j][a[x]] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	sort(all(cs));
	ans[j][n - 1] = '/';
	++j;
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
	}
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[i] != j) {
			i = a[i];
			used[i] = 1;
			if (i == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(i);
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	for (ll i = 0; i < sz(comps); i++) {
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 1;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	reverse(all(ans));
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	for (ll i = 0; i < sz(cs) - 1; i++) {
		++j;
		ll x = cs[i];
		setout(x, j);
	}
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[j] != i) {
			j = a[j];
			used[j] = 1;
			if (j == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(j);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	for (ll i = 0; i < sz(cs) - 1; i++) {
		++j;
		ll x = cs[i];
		setout(x, j);
	}
	ll x = cs.back();
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[i] != j) {
			i = a[i];
			used[i] = 1;
			if (i == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(i);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ll x = cs[sz(cs) - 2];
	if (x < a[x]) {
		ans[j][n - 1] = '/';
		ans[j][a[cs.back()]] = '/';
	} else {
		ans[j][0] = '\\';
		ans[j][a[cs.back()]] = '\\';
	}
	for (ll i = 0; i < sz(cs) - 1; i++) {
		++j;
		ll x = cs[i];
		setout(x, j);
	}
	if (x < a[x]) {
		ans[j][n - 1] = '\\';
	} else {
		ans[j][0] = '/';
	}
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[j] != i) {
			j = a[j];
			used[j] = 1;
			if (j == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(j);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	++j;
	for (ll i = sz(cs) - 1; i >= 0; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	--j;
	ll x = cs.back();
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[i] != j) {
			i = a[i];
			used[i] = 1;
			if (i == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(i);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	++j;
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ll x = cs.back();
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[i] != j) {
			i = a[i];
			used[i] = 1;
			if (i == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(i);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ll x = cs[sz(cs) - 2];
	if (x < a[x]) {
		ans[j][n - 1] = '\\';
		ans[j][a[cs.back()]] = '\\';
	} else {
		ans[j][0] = '/';
		ans[j][a[cs.back()]] = '/';
	}
	for (ll i = 0; i < sz(cs) - 1; i++) {
		++j;
		ll x = cs[i];
		setout(x, j);
	}
	if (x < a[x]) {
		ans[j][n - 1] = '/';
	} else {
		ans[j][0] = '\\';
	}
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[j] != i) {
			j = a[j];
			used[j] = 1;
			if (j == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(j);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
	++j;
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '/';
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
	}
	ll x = cs.back();
	ans[j][n - 1] = '\\';
	ans[j][a[x]] = '\\';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	sort(all(cs));
	ans[j][n - 1] = '/';
	++j;
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
	}
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[i] != j) {
			i = a[i];
			used[i] = 1;
			if (i == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(i);
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	for (ll i = 0; i < sz(comps); i++) {
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	reverse(all(ans));
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ll x = cs[sz(cs) - 2];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	for (ll i = 0; i < sz(cs) - 1; i++) {
		++j;
		ll x = cs[i];
		setout(x, j);
	}
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[j] != i) {
			j = a[j];
			used[j] = 1;
			if (j == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(j);
		}
		ll pos = -1;
		ll val = -inf;
		for (ll j = 0; j < sz(comps.back()); j++) {
			if (comps.back()[j] > val) {
				pos = j;
				val = comps.back()[j];
			}
		}
		vll temp;
		for (ll j = pos + 1; j < sz(comps.back()); j++) {
			temp.pb(comps.back()[j]);
		}
		for (ll j = 0; j <= pos; j++) {
			temp.pb(comps.back()[j]);
		}
		comps.back() = temp;
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	++j;
	for (ll i = sz(cs) - 2; i >= 0; i--) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	--j;
	ll x = cs.back();
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = sz(cs) - 2; i >= 0; i--) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[i] != j) {
			i = a[i];
			used[i] = 1;
			if (i == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(i);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	++j;
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	--j;
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[i] != j) {
			i = a[i];
			used[i] = 1;
			if (i == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(i);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	++j;
	for (ll i = sz(cs) - 2; i >= 0; i--) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	--j;
	ll x = cs.back();
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[j] != i) {
			j = a[j];
			used[j] = 1;
			if (j == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(j);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ll x = cs[sz(cs) - 2];
	if (x <= a[x]) {
		ans[j][n - 1] = '\\';
		ans[j][a[cs.back()]] = '\\';
	} else {
		ans[j][n - 1] = '/';
		ans[j][a[cs.back()]] = '/';
	}
	for (ll i = 0; i < sz(cs) - 1; i++) {
		++j;
		ll x = cs[i];
		setout(x, j);
	}
	x = cs[sz(cs) - 2];
	if (x <= a[x]) {
		ans[j][n - 1] = '/';
	} else {
		ans[j][n - 1] = '\\';
	}
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[j] != i) {
			j = a[j];
			used[j] = 1;
			if (j == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(j);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	++j;
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	--j;
	ll x = cs.back();
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[i] != j) {
			i = a[i];
			used[i] = 1;
			if (i == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(i);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	++j;
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	--j;
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[i] != j) {
			i = a[i];
			used[i] = 1;
			if (i == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(i);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


// I love meowmur
// We miss you, Arthur
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(a) (a).begin(), (a).end()
#define sz(a) (ll)((a).size())
#define heap priority_queue
#define hash_map unordered_map
#define hash_set unordered_set
#define ft first
#define sd second
#define fast ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define endl "\n"
#define mineq(a, b) (a) = ((a)>(b))?(b):(a)
#define maxeq(a, b) (a) = ((a)<(b))?(b):(a)
#define die(cond) if (cond) for (;;){}
#define y1 y_1
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef vector<ll> vll;
typedef set<ll> sll;
typedef map<ll, ll> mll;
const ll inf = numeric_limits<ll>::max() / 2;
const ld eps = 1e-9;
const ld pi = acos(-1);

inline void solve(), read();

int main() {
	fast;
	read();
	solve();
	return 0;
}

ll n;
vll a;
vector<string> ans;
vector<vll> comps;
ll cn = -1;

void setout(ll x, ll& j) {
	if (x < a[x]) {
		ans[j][x] = '/';
		ans[j][a[x]] = '/';
	} else if (x > a[x]) {
		ans[j][x] = '\\';
		ans[j][a[x]] = '\\';
	}
}

void iter(ll ind, ll& j) {
	vll& cs = comps[ind];
	ans[j][n - 1] = '\\';
	ans[j][a[cs.back()]] = '\\';
	for (ll i = 0; i < sz(cs) - 1; i++) {
		++j;
		ll x = cs[i];
		setout(x, j);
	}
	ans[j][n - 1] = '/';
	++j;
}
void iter1(ll ind, ll& j) {
	ll x = comps[ind][0];
	setout(x, j);
	++j;
}
void itern(ll ind, ll& j) {
	vll& cs = comps[ind];
	for (ll i = 0; i < sz(cs) - 1; i++) {
		ll x = cs[i];
		setout(x, j);
		++j;
	}
	ans[j][n - 1] = '/';
	++j;
}

inline void solve() {
	vll used(n, 0);
	for (ll i = 0; i < n; i++) {
		if (used[i]) {
			continue;
		}
		used[i] = 1;
		comps.pb({});
		if (i == n - 1) {
			cn = sz(comps) - 1;
		}
		comps.back().pb(i);
		ll j = i;
		while (a[j] != i) {
			j = a[j];
			used[j] = 1;
			if (j == n - 1) {
				cn = sz(comps) - 1;
			}
			comps.back().pb(j);
		}
		if (sz(comps) - 1 == cn) {
			ll pos = -1;
			for (ll j = 0; j < sz(comps[cn]); j++) {
				if (comps[cn][j] == n - 1) {
					pos = j;
					break;
				}
			}
			vll temp;
			for (ll j = pos + 1; j < sz(comps[cn]); j++) {
				temp.pb(comps[cn][j]);
			}
			for (ll j = 0; j <= pos; j++) {
				temp.pb(comps[cn][j]);
			}
			comps[cn] = temp;
		}
	}
	ans.resize(n, string(n, '.'));
	ll j = 0;
	ll ok = 1;
	for (ll i = 0; i < sz(comps); i++) {
		if (i == cn) {
			continue;
		}
		if (sz(comps[i]) == 1) {
			iter1(i, j);
		} else if (cn == i) {
			ok = 0;
			itern(i, j);
		} else {
			ok = 0;
			iter(i, j);
		}
	}
	if (sz(comps[cn]) == 1) {
		iter1(cn, j);
	} else {
		ok = 0;
		itern(cn, j);
	}
	if (ok) {
		cout << n << endl;
	} else {
		cout << n - 1 << endl;
	}
	for (string& s : ans) {
		cout << s << endl;
	}
}

inline void read() {
	cin >> n;
	a.resize(n);
	for (ll i = 0; i < n; i++) {
		cin >> a[i];
		--a[i];
	}
}


#include<iostream>
#include<vector>
#include<queue>
using namespace std;
int n, a[1000 + 1];
bool visited[1000 + 1];
char c[1000 + 1][1000 + 1];
char temp;
int t = 0;
vector<int>v1, v2;
int main() {
	cin >> n;
	for (int i = 1; i <= n; i += 1) {
		cin >> a[i];
		if (i ^ a[i]) t = 1;
	}
	for (int i = 1; i <= n; i += 1) {
		for (int j = 1; j <= n; j += 1) {
			c[i][j] = '.';
		}
	}
	if (t) {
		cout << (n - 1) << "\n";
		for (int i = 1; i <= n; i += 1) {
			t = i;
			if (visited[t]) {
				continue;
			}
			v1.push_back(t);
			c[n][t] = '/';
			while (!visited[t]) {
				visited[t] = true;
				t = a[t];
			}
		}
		t = a[v1[(int)v1.size() - 1]];
		for (int i = ((int)v1.size() - 1); i >= 0; i -= 1) {
			if (!(i ^ 0)) {
				a[v1[i]] = 0;
				continue;
			}
			a[v1[i]] = a[v1[i - 1]];
		}
		while (t) {
			v2.push_back(t);
			t = a[t];
		}
		reverse(v2.begin(), v2.end());
		for (int i = 1; i < v2.size(); i += 1) {
			temp = '/';
			if (v2[i] > v2[i - 1]) temp = '\\';
			c[n - i][v2[i]] = temp;
			c[n - i][v2[i - 1]] = temp;
		}
	}
	else {
		cout << n << "\n";
	}
	for (int i = 1; i <= n; i += 1) {
		for (int j = 1; j <= n; j += 1) {
			cout << c[i][j];
		}
		cout << "\n";
	}
}


#include<iostream>
#include<vector>
#include<queue>
using namespace std;
int n, a[1000 + 1];
bool visited[1000 + 1];
char c[1000 + 1][1000 + 1];
char temp;
int t = 0;
vector<int>v1, v2;
int main() {
	cin >> n;
	for (int i = 1; i <= n; i += 1) {
		cin >> a[i];
		if (i ^ a[i]) t = 1;
	}
	for (int i = 1; i <= n; i += 1) {
		for (int j = 1; j <= n; j += 1) {
			c[i][j] = '.';
		}
	}
	if (t) {
		cout << (n - 1) << "\n";
		for (int i = 1; i <= n; i += 1) {
			t = i;
			if (visited[t]) {
				continue;
			}
			v1.push_back(t);
			c[n][t] = '/';
			while (!visited[t]) {
				visited[t] = true;
				t = a[t];
			}
		}
		t = a[v1[(int)v1.size() - 1]];
		for (int i = ((int)v1.size() - 1); i >= 0; i -= 1) {
			if (!(i ^ 0)) {
				a[v1[i]] = 0;
				continue;
			}
			a[v1[i]] = a[v1[i - 1]];
		}
		while (t) {
			v2.push_back(t);
			t = a[t];
		}
		reverse(v2.begin(), v2.end());
		for (int i = 1; i < v2.size(); i += 1) {
			temp = '/';
			if (v2[i] > v2[i - 1]) temp = '\\';
			c[n - i][v2[i]] = temp;
			c[n - i][v2[i] - 1] = temp;
		}
	}
	else {
		cout << n << "\n";
	}
	for (int i = 1; i <= n; i += 1) {
		for (int j = 1; j <= n; j += 1) {
			cout << c[i][j];
		}
		cout << "\n";
	}
}


using System;
using System.Collections.Generic;
using System.Text;

namespace round516
{
  class MainClass
  {
    public static void Main(string[] args)
    {
#if DEBUG
      var n = 4;
      var a = new int[] { 1, 4, 3, 2 };
#else
      var n = int.Parse(Console.ReadLine());
      var a = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
#endif

      var to = new int[n];
      bool ident = true;
      for (int i = 0; i < n; ++i)
      {
        int target = a[i] - 1;
        if (target != i) ident = false;
        to[target] = i;
      }

      var blank = new string('.', n);

      if (ident)
      {
        Console.WriteLine(n);
        for (int i = 0; i < n; ++i)
          Console.WriteLine(blank);
        return;
      }

      Console.WriteLine(n - 1);
      to[0] = -1;
      for (int i = 0; i < n; ++i)
      {
        int l = 0;
        int r = 0;
        for (int j = 0; j < n; ++j)
        {
          if (to[j] != j)
          {
            l = j;
            break;
          }
        }
        for (int j = n; --j >= 0; )
        {
          if (to[j] != j)
          {
            r = j;
            break;
          }
        }

        var current = new StringBuilder(blank);
        if (l == r)
        {
        }
        else if (to[l] < 0)
        {
          int target = to[r];
          current[l] = '/';
          current[r] = '/';
          current[target] = '/';
          to[l] = to[target];
          to[r] = -1;
          to[target] = target;
        }
        else
        {
          int target = to[l];
          current[l] = '\\';
          current[r] = '\\';
          current[target] = '\\';
          to[l] = -1;
          to[r] = to[target];
          to[target] = target;
        }

        Console.WriteLine(current);
      }
    }
  }
}


using System;
using System.Collections.Generic;
using System.Text;

namespace round516
{
  class MainClass
  {
    public static void Main(string[] args)
    {
      //var n = int.Parse(Console.ReadLine());
      //var a = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);

      var n = 4;
      var a = new int[] { 1, 4, 3, 2};

      var to = new int[n];
      bool ident = true;
      for (int i = 0; i < n; ++i)
      {
        int target = a[i] - 1;
        if (target != i) ident = false;
        to[target] = i;
      }

      var blank = new string('.', n);

      if (ident)
      {
        Console.WriteLine(n);
        for (int i = 0; i < n; ++i)
          Console.WriteLine(blank);
        return;
      }

      Console.WriteLine(n - 1);
      to[0] = -1;
      for (int i = 0; i < n; ++i)
      {
        int l = 0;
        int r = 0;
        for (int j = 0; j < n; ++j)
        {
          if (to[j] != j)
          {
            l = j;
            break;
          }
        }
        for (int j = n; --j >= 0; )
        {
          if (to[j] != j)
          {
            r = j;
            break;
          }
        }

        var current = new StringBuilder(blank);
        if (l == r)
        {
        }
        else if (to[l] < 0)
        {
          int target = to[r];
          current[l] = '/';
          current[r] = '/';
          current[target] = '/';
          to[l] = to[target];
          to[r] = -1;
          to[target] = target;
        }
        else
        {
          int target = to[l];
          current[l] = '\\';
          current[r] = '\\';
          current[target] = '\\';
          to[l] = -1;
          to[r] = to[target];
          to[target] = target;
        }

        Console.WriteLine(current);
      }
    }
  }
}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
//		print();
		for(int i = N-1; i >= 0; i--) {
			if(!vis[i]) go(mapTo[i],0);
//			print();
		}
		//System.out.println("Good: "+good(c,mapTo));

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {

		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		//System.out.println("C:"+column+"  "+dep+"  "+mapTo[column]+"  e="+end+"  curRow="+curRow);
		//print();
		if(end) {
			if(match != column) {
				//System.out.println("  here");
				c[curRow][N-1]='/';
				c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			}
			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

	static boolean good(char b[][], int perm[]) {

		for(int i = 0; i < N-1; i++){
			int curR = N-1;
			int curC = i;
			int dR = -1;
			int dC = 0;
			System.out.println("i="+i+" map="+perm[i]);
			while(true) {
				System.out.println(curR+" "+curC+"  "+b[curR][curC]);
				if(b[curR][curC] == '/') {
					if(dR==-1) {
						dR=0;
						dC=1;
					}
					else if(dR==1) {
						dR=0;
						dC=-1;
					}
					else if(dC==-1) {
						dC=0;
						dR=1;
					}
					else if(dC==1) {
						dC=0;
						dR=-1;
					}
				}
				else if(b[curR][curC] == '\\') {
					if(dR==-1) {
						dR=0;
						dC=-1;
					}
					else if(dR==1) {
						dR=0;
						dC=1;
					}
					else if(dC==-1) {
						dC=0;
						dR=-1;
					}
					else if(dC==1) {
						dC=0;
						dR=1;
					}
				}
				curR += dR;
				curC += dC;
				if(curR < 0) {
					if(curC != perm[i])return false;
					break;
				}
				if(curR >= N || curC < 0 || curC >= N) return false;
			}
		}

		return true;
	}

	static void print() {
		for(int i = 0; i < N; i++) System.out.println(String.valueOf(c[i]));
		System.out.println();
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			//whatMapsHere[i] = in.nextInt()-1;
			//mapTo[whatMapsHere[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
//		print();
		for(int i = 0; i < N; i++) {
			if(!vis[i]) go(i,0);
//			print();
		}

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			if(match!=column)c[curRow-dep+1][N-1]='/';
			if(match!=column)c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

	static void print() {
		for(int i = 0; i < N; i++) System.out.println(String.valueOf(c[i]));
		System.out.println();
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
//		print();
		for(int i = 0; i < N; i++) {
			if(!vis[i]) go(i,0);
//			print();
		}

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			c[curRow-dep+1][N-1]='/';
			c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

	static void print() {
		for(int i = 0; i < N; i++) System.out.println(String.valueOf(c[i]));
		System.out.println();
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
//		print();
		for(int i = 0; i < N; i++) {
			if(!vis[i]) go(i,0);
//			print();
		}

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			if(match != column) {
				c[curRow-dep+1][N-1]='/';
				c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			}
			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

	static void print() {
		for(int i = 0; i < N; i++) System.out.println(String.valueOf(c[i]));
		System.out.println();
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			//whatMapsHere[i] = in.nextInt()-1;
			//mapTo[whatMapsHere[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
		for(int i = 0; i < N; i++) if(!vis[i]) go(i,0);

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			if(column != match) {
				c[curRow+1][column]=c[curRow+1][N-1]='/';
				c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			}
			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			//whatMapsHere[i] = in.nextInt()-1;
			//mapTo[whatMapsHere[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
//		print();
		for(int i = 0; i < N; i++) {
			if(!vis[i]) go(i,0);
//			print();
		}

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			//c[curRow+1][column]=c[curRow+1][N-1]='/';
			if(match!=column)c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

	static void print() {
		for(int i = 0; i < N; i++) System.out.println(String.valueOf(c[i]));
		System.out.println();
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
//		print();
		for(int i = 0; i < N; i++) {
			if(!vis[i]) go(i,0);
//			print();
		}

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			if(match == column)c[curRow-dep+1][column]='/';
			c[curRow-dep+1][N-1]='/';
			c[curRow-dep][match]=c[curRow-dep][N-1]='\\';

			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

	static void print() {
		for(int i = 0; i < N; i++) System.out.println(String.valueOf(c[i]));
		System.out.println();
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			//whatMapsHere[i] = in.nextInt()-1;
			//mapTo[whatMapsHere[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
//		print();
		for(int i = 0; i < N; i++) {
			if(!vis[i]) go(i,0);
//			print();
		}

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			//c[curRow+1][column]=c[curRow+1][N-1]='/';
			c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

	static void print() {
		for(int i = 0; i < N; i++) System.out.println(String.valueOf(c[i]));
		System.out.println();
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
//		print();
		for(int i = N-1; i >= 0; i--) {
			if(!vis[i]) go(mapTo[i],0);
//			print();
		}

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			if(match != column) {
				c[curRow-dep+1][N-1]='/';
				c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			}
			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

	static void print() {
		for(int i = 0; i < N; i++) System.out.println(String.valueOf(c[i]));
		System.out.println();
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			mapTo[i]=in.nextInt()-1;
			whatMapsHere[mapTo[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
//		print();
		for(int i = 0; i < N; i++) {
			if(!vis[i]) go(i,0);
//			print();
		}

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			if(match != column) {
				c[curRow-dep+1][N-1]='/';
				c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			}
//			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

	static void print() {
		for(int i = 0; i < N; i++) System.out.println(String.valueOf(c[i]));
		System.out.println();
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
/*
10
4 1 5 7 2 9 3 6 10 8
7
6 1 5 7 2 4 3
 */
public class lasers {

	static int N;
	static int[] mapTo,whatMapsHere;
	static boolean vis[];
	static char c[][];
	static int curRow;
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = in.nextInt();
		mapTo = new int[N];
		whatMapsHere = new int[N];
		boolean baseCase=true;
		for(int i = 0; i < N; i++) {
			whatMapsHere[i] = in.nextInt()-1;
			mapTo[whatMapsHere[i]]=i;
			if(whatMapsHere[i]!=i)baseCase=false;
		}
		c = new char[N][N];
		for(char a[] : c)Arrays.fill(a, '.');
		if(baseCase) {
			out.println(N);
			for(int i = 0; i < N; i++)out.println(String.valueOf(c[i]));
			out.close();
			return;
		}

		vis = new boolean[N];
		curRow = 0;
		init(mapTo[N-1]);
		for(int i = 0; i < N; i++) if(!vis[i]) go(i,0);

		out.println(N-1);
		for(int i = 0; i < N; i++) out.println(String.valueOf(c[i]));
		out.close();

	}
	static void go(int column, int dep) {
		vis[column]=true;
		int match = mapTo[column];
		boolean end = vis[match];
		if(end) {
			c[curRow+1][column]=c[curRow+1][N-1]='/';
			c[curRow-dep][match]=c[curRow-dep][N-1]='\\';
			curRow++;
		}
		else {
			if(match < column) c[curRow+1][column]=c[curRow+1][match]='\\';
			else if(match > column) c[curRow+1][column]=c[curRow+1][match]='/';
			curRow++;
			go(match, dep+1);
		}
	}
	static void init(int column) {
		vis[column]=true;
		if(column == N-1)return;
		int match = mapTo[column];
		if(match < column) c[curRow][column]=c[curRow][match]='\\';
		else if(match > column) c[curRow][column]=c[curRow][match]='/';
		curRow++;
		init(match);
	}

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Div1_516E {

	static int N;
	static char[][] grid;
	static int[] tar;

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		N = Integer.parseInt(reader.readLine());
		tar = new int[N];

		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		for (int i = 0; i < N; i++) {
			tar[i] = Integer.parseInt(inputData.nextToken()) - 1;
		}
		boolean perf = true;
		for (int i = 0; i < N; i++) {
			if (tar[i] != i) {
				perf = false;
				break;
			}
		}

		if(perf) {
			printer.println(N);
			for(int i = 0; i < N; i++) {
				for(int j = 0; j < N; j++) {
					printer.print('.');
				}
				printer.println();
			}
			printer.close();
			return;
		}

		grid = new char[N][N];
		for (int i = 0; i < N; i++) {
			Arrays.fill(grid[i], '.');
		}

		recurseR(N - 1, 0);

		printer.println(N - 1);
		for (int i = N - 1; i >= 0; i--) {
			for (int j = 0; j < N; j++) {
				printer.print(grid[i][j]);
			}
			printer.println();
		}
		printer.close();
	}

	static void recurseR(int h, int l) {
		if (h == 0) {
			return;
		}
		int r = l + h;
		int rTar = tar[r];
		if (rTar == r) {
			recurseL(h - 1, l);
			return;
		}

		for (int i = 0; i < N; i++) {
			if (tar[i] < rTar) {
				tar[i]++;
			}
		}

		recurseL(h - 1, l);
		grid[h][r] = '\\';

		for (int i = l; i <= rTar; i++) {
			grid[h][i] = '\\';
		}
	}

	static void recurseL(int h, int l) {
		if (h == 0) {
			return;
		}
		int r = l + h;
		int lTar = tar[l];

		if (lTar == l) {
			recurseR(h - 1, l + 1);
			return;
		}

		for (int i = 0; i < N; i++) {
			if (tar[i] > lTar) {
				tar[i]--;
			}
		}

		recurseR(h - 1, l + 1);
		grid[h][l] = '/';

		for (int i = lTar; i <= r; i++) {
			grid[h][i] = '/';
		}
	}

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Div1_516E {

	static int N;
	static char[][] grid;
	static int[] tar;

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		N = Integer.parseInt(reader.readLine());
		tar = new int[N];

		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		for (int i = 0; i < N; i++) {
			tar[i] = Integer.parseInt(inputData.nextToken()) - 1;
		}
		grid = new char[N][N];
		for (int i = 0; i < N; i++) {
			Arrays.fill(grid[i], '.');
		}

		recurseR(N - 1, 0);

		for (int i = N - 1; i >= 0; i--) {
			for (int j = 0; j < N; j++) {
				printer.print(grid[i][j]);
			}
			printer.println();
		}
		printer.close();
	}

	static void recurseR(int h, int l) {
		if (h == 0) {
			return;
		}
		int r = l + h;
		int rTar = tar[r];
		if (rTar == r) {
			recurseL(h - 1, l);
			return;
		}

		for (int i = 0; i < N; i++) {
			if (tar[i] < rTar) {
				tar[i]++;
			}
		}

		recurseL(h - 1, l);
		grid[h][r] = '\\';

		for (int i = l; i <= rTar; i++) {
			grid[h][i] = '\\';
		}
	}

	static void recurseL(int h, int l) {
		if (h == 0) {
			return;
		}
		int r = l + h;
		int lTar = tar[l];

		if (lTar == l) {
			recurseR(h - 1, l + 1);
			return;
		}

		for (int i = 0; i < N; i++) {
			if (tar[i] > lTar) {
				tar[i]--;
			}
		}

		recurseR(h - 1, l + 1);
		grid[h][l] = '/';

		for (int i = lTar; i <= r; i++) {
			grid[h][i] = '/';
		}
	}

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Div1_516E {

	static int N;
	static char[][] grid;
	static int[] tar;
	static int[] st;

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		N = Integer.parseInt(reader.readLine());
		tar = new int[N];
		st = new int[N];

		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		for (int i = 0; i < N; i++) {
			tar[i] = Integer.parseInt(inputData.nextToken()) - 1;
			st[tar[i]] = i;
		}
		boolean perf = true;
		for (int i = 0; i < N; i++) {
			if (tar[i] != i) {
				perf = false;
				break;
			}
		}

		if (perf) {
			printer.println(N);
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < N; j++) {
					printer.print('.');
				}
				printer.println();
			}
			printer.close();
			return;
		}

		grid = new char[N][N];
		for (int i = 0; i < N; i++) {
			Arrays.fill(grid[i], '.');
		}

		visited = new boolean[N];

		int cH = 0;
		for (int i = 0; i < N; i++) {
			if (!visited[i]) {
				cycle = new ArrayList<>();
				fCycle(i);
				if (cycle.size() == 1) {
					continue;
				}

				if (tar[cycle.get(0)] < cycle.get(0)) {
					throw new RuntimeException();
				}

				if (cycle.get(0) != N - 1) {
					grid[cH][N - 1] = '/';
				}
				for (int j = 0; j < cycle.size() - 1; j++) {
					int cSt = cycle.get(j);
					int cTar = tar[cSt];
					if (cSt == N - 1 || cTar == N - 1) {
						continue;
					}
					if (cTar < cSt) {
						grid[cH][cTar] = '\\';
						grid[cH][cSt] = '\\';
					} else {
						grid[cH][cSt] = '/';
						grid[cH][cTar] = '/';
					}
					cH++;
				}
				if (cycle.get(cycle.size() - 1) != N - 1 && cycle.get(cycle.size() - 2) != N - 1) {
					grid[cH][N - 1] = '\\';
					grid[cH][cycle.get(cycle.size() - 2)] = '\\';
					cH++;
				}
			}
		}

		/*
		for (int i = 0; i < N; i++) {
			int sum = 0;
			for (int j = 0; j < N; j++) {
				sum += grid[j][i] == '.' ? 0 : 1;
			}
			if (sum == 1) {
				printer.println("!!!!" + i + "!!!!");
			}
			printer.print(sum);
			printer.println();
		}*/

		printer.println(N - 1);
		for (int i = N - 1; i >= 0; i--) {
			for (int j = 0; j < N; j++) {
				printer.print(grid[i][j]);
			}
			printer.println();
		}
		printer.close();
	}

	static boolean[] visited;

	static ArrayList<Integer> cycle;

	static void fCycle(int i) {
		visited[i] = true;
		cycle.add(i);

		int nxt = st[i];
		if (!visited[nxt]) {
			fCycle(nxt);
		}
	}
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Div1_516E {

	static int N;
	static char[][] grid;
	static int[] tar;
	static int[] st;

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		N = Integer.parseInt(reader.readLine());
		tar = new int[N];
		st = new int[N];

		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		for (int i = 0; i < N; i++) {
			tar[i] = Integer.parseInt(inputData.nextToken()) - 1;
			st[tar[i]] = i;
		}
		boolean perf = true;
		for (int i = 0; i < N; i++) {
			if (tar[i] != i) {
				perf = false;
				break;
			}
		}

		if (perf) {
			printer.println(N);
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < N; j++) {
					printer.print('.');
				}
				printer.println();
			}
			printer.close();
			return;
		}

		grid = new char[N][N];
		for (int i = 0; i < N; i++) {
			Arrays.fill(grid[i], '.');
		}

		visited = new boolean[N];

		ArrayList<Integer> pLast = null;

		int cH = 0;
		for (int i = 0; i < N; i++) {
			if (!visited[i]) {
				cycle = new ArrayList<>();
				fCycle(i);
				if (cycle.size() == 1) {
					continue;
				}

				if (visited[N - 1] && pLast == null) {
					pLast = cycle;
					continue;
				}

				if (cycle.get(0) != N - 1) {
					grid[cH][N - 1] = '/';
				}
				for (int j = 0; j < cycle.size() - 1; j++) {
					int cSt = cycle.get(j);
					if (cSt == N - 1) {
						continue;
					}
					int cTar = tar[cSt];
					if (cTar < cSt) {
						grid[cH][cTar] = '\\';
						grid[cH][cSt] = '\\';
					} else {
						grid[cH][cSt] = '/';
						grid[cH][cTar] = '/';
					}
					cH++;
				}
				if (cycle.get(cycle.size() - 1) != N - 1 && cycle.get(cycle.size() - 2) != N - 1) {
					grid[cH][N - 1] = '\\';
					grid[cH][cycle.get(cycle.size() - 2)] = '\\';
					cH++;
				}
			}
		}
		if(pLast != null) {
			cycle = pLast;
			if (cycle.get(0) != N - 1) {
				grid[cH][N - 1] = '/';
			}
			for (int j = 0; j < cycle.size() - 1; j++) {
				int cSt = cycle.get(j);
				if (cSt == N - 1) {
					continue;
				}
				int cTar = tar[cSt];
				if (cTar < cSt) {
					grid[cH][cTar] = '\\';
					grid[cH][cSt] = '\\';
				} else {
					grid[cH][cSt] = '/';
					grid[cH][cTar] = '/';
				}
				cH++;
			}
			if (cycle.get(cycle.size() - 1) != N - 1 && cycle.get(cycle.size() - 2) != N - 1) {
				grid[cH][N - 1] = '\\';
				grid[cH][cycle.get(cycle.size() - 2)] = '\\';
				cH++;
			}
		}

		printer.println(N - 1);
		for (int i = N - 1; i >= 0; i--) {
			for (int j = 0; j < N; j++) {
				printer.print(grid[i][j]);
			}
			printer.println();
		}
		printer.close();
	}

	static boolean[] visited;

	static ArrayList<Integer> cycle;

	static void fCycle(int i) {
		visited[i] = true;
		cycle.add(i);

		int nxt = st[i];
		if (!visited[nxt]) {
			fCycle(nxt);
		}
	}

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Div1_516E {

	static int N;
	static char[][] grid;
	static int[] tar;
	static int[] st;

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		N = Integer.parseInt(reader.readLine());
		tar = new int[N];
		st = new int[N];

		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		for (int i = 0; i < N; i++) {
			tar[i] = Integer.parseInt(inputData.nextToken()) - 1;
			st[tar[i]] = i;
		}
		boolean perf = true;
		for (int i = 0; i < N; i++) {
			if (tar[i] != i) {
				perf = false;
				break;
			}
		}

		if (perf) {
			printer.println(N);
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < N; j++) {
					printer.print('.');
				}
				printer.println();
			}
			printer.close();
			return;
		}

		grid = new char[N][N];
		for (int i = 0; i < N; i++) {
			Arrays.fill(grid[i], '.');
		}

		visited = new boolean[N];

		int cH = 0;
		for (int i = 0; i < N; i++) {
			if (!visited[i]) {
				cycle = new ArrayList<>();
				fCycle(i);
				if (cycle.size() == 1) {
					continue;
				}

				grid[cH][N - 1] = '/';
				for (int j = 0; j < cycle.size() - 1; j++) {
					int cSt = cycle.get(j);
					int cTar = tar[cSt];
					if (cTar < cSt) {
						grid[cH][cTar] = '\\';
						grid[cH][cSt] = '\\';
					} else {
						grid[cH][cSt] = '/';
						grid[cH][cTar] = '/';
					}
					cH++;
				}
				if (cycle.get(cycle.size() - 1) != N - 1) {
					grid[cH][N - 1] = '\\';
					grid[cH][cycle.get(cycle.size() - 2)] = '\\';
					cH++;
				}
			}
		}

		printer.println(N - 1);
		for (int i = N - 1; i >= 0; i--) {
			for (int j = 0; j < N; j++) {
				printer.print(grid[i][j]);
			}
			printer.println();
		}
		printer.close();
	}

	static boolean[] visited;

	static ArrayList<Integer> cycle;

	static void fCycle(int i) {
		visited[i] = true;
		cycle.add(i);

		int nxt = st[i];
		if (!visited[nxt]) {
			fCycle(nxt);
		}
	}

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Div1_516E {

	static int N;
	static char[][] grid;
	static int[] tar;
	static int[] st;

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		N = Integer.parseInt(reader.readLine());
		tar = new int[N];
		st = new int[N];

		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		for (int i = 0; i < N; i++) {
			tar[i] = Integer.parseInt(inputData.nextToken()) - 1;
			st[tar[i]] = i;
		}
		boolean perf = true;
		for (int i = 0; i < N; i++) {
			if (tar[i] != i) {
				perf = false;
				break;
			}
		}

		if (perf) {
			printer.println(N);
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < N; j++) {
					printer.print('.');
				}
				printer.println();
			}
			printer.close();
			return;
		}

		grid = new char[N][N];
		for (int i = 0; i < N; i++) {
			Arrays.fill(grid[i], '.');
		}

		visited = new boolean[N];

		int cH = 0;
		for (int i = 0; i < N; i++) {
			if (!visited[i]) {
				cycle = new ArrayList<>();
				fCycle(i);
				if (cycle.size() == 1) {
					continue;
				}

				grid[cH][N - 1] = '/';
				for (int j = 0; j < cycle.size() - 1; j++) {
					int cSt = cycle.get(j);
					if (cSt == N - 1) {
						continue;
					}
					int cTar = tar[cSt];
					if (cTar < cSt) {
						grid[cH][cTar] = '\\';
						grid[cH][cSt] = '\\';
					} else {
						grid[cH][cSt] = '/';
						grid[cH][cTar] = '/';
					}
					cH++;
				}
				if (cycle.get(cycle.size() - 1) != N - 1 && cycle.get(cycle.size() - 2) != N - 1) {
					grid[cH][N - 1] = '\\';
					grid[cH][cycle.get(cycle.size() - 2)] = '\\';
					cH++;
				}
			}
		}

		printer.println(N - 1);
		for (int i = N - 1; i >= 0; i--) {
			for (int j = 0; j < N; j++) {
				printer.print(grid[i][j]);
			}
			printer.println();
		}
		printer.close();
	}

	static boolean[] visited;

	static ArrayList<Integer> cycle;

	static void fCycle(int i) {
		visited[i] = true;
		cycle.add(i);

		int nxt = st[i];
		if (!visited[nxt]) {
			fCycle(nxt);
		}
	}

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Div1_516E {

	static int N;
	static char[][] grid;
	static int[] tar;
	static int[] st;

	public static void main(String[] args) throws IOException {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		N = Integer.parseInt(reader.readLine());
		tar = new int[N];
		st = new int[N];

		StringTokenizer inputData = new StringTokenizer(reader.readLine());
		for (int i = 0; i < N; i++) {
			tar[i] = Integer.parseInt(inputData.nextToken()) - 1;
			st[tar[i]] = i;
		}
		boolean perf = true;
		for (int i = 0; i < N; i++) {
			if (tar[i] != i) {
				perf = false;
				break;
			}
		}

		if (perf) {
			printer.println(N);
			for (int i = 0; i < N; i++) {
				for (int j = 0; j < N; j++) {
					printer.print('.');
				}
				printer.println();
			}
			printer.close();
			return;
		}

		grid = new char[N][N];
		for (int i = 0; i < N; i++) {
			Arrays.fill(grid[i], '.');
		}

		visited = new boolean[N];

		int cH = 0;
		for (int i = 0; i < N; i++) {
			if (!visited[i]) {
				cycle = new ArrayList<>();
				fCycle(i);
				if (cycle.size() == 1) {
					continue;
				}

				grid[cH][N - 1] = '/';
				for (int j = 0; j < cycle.size(); j++) {
					int cSt = cycle.get(j);
					if (cSt == N - 1) {
						continue;
					}
					int cTar = tar[cSt];
					if (cTar < cSt) {
						grid[cH][cTar] = '\\';
						grid[cH][cSt] = '\\';
					} else {
						grid[cH][cSt] = '/';
						grid[cH][cTar] = '/';
					}
					cH++;
				}
				if (cycle.get(cycle.size() - 1) != N - 1 && cycle.get(cycle.size() - 2) != N - 1) {
					grid[cH][N - 1] = '\\';
					grid[cH][cycle.get(cycle.size() - 2)] = '\\';
					cH++;
				}
			}
		}

		printer.println(N - 1);
		for (int i = N - 1; i >= 0; i--) {
			for (int j = 0; j < N; j++) {
				printer.print(grid[i][j]);
			}
			printer.println();
		}
		printer.close();
	}

	static boolean[] visited;

	static ArrayList<Integer> cycle;

	static void fCycle(int i) {
		visited[i] = true;
		cycle.add(i);

		int nxt = st[i];
		if (!visited[nxt]) {
			fCycle(nxt);
		}
	}
}