#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <complex>

using namespace std;

//#pragma GCC optimize("Ofast")
//#pragma GCC optimization("unroll-loops, no-stack-protector")
//#pragma GCC target("avx,avx2,fma")

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n, i, j, k, x, s, maxx, minn, offset, d;
	cin >> n;
	vector<int> a(n);
	s = 0; maxx = 0, minn = 0;
	x = 0;
	for (i = 0; i < n; i++) {
		cin >> a[i];
		s += a[i];
		if (i % 2 == 0) x += a[i];
		else x -= a[i];
		maxx = max(maxx, a[i]);
		minn = min(minn, a[i]);
	}
	d = maxx - minn;

	vector<vector<char>> ans(d + 30, vector<char>(s, ' '));
	vector<bool> touched(d + 30, false);
	s = 0;
	x = maxx + 3;
	for (i = 0; i < n; i++) {
		for (j = 0; j < a[i]; j++) {
			if (i % 2 == 0) {
				ans[x][s] = '/';
				touched[x] = true;
				x--;
			}
			else {
				x++;
				touched[x] = true;
				ans[x][s] = '\\';
			}
			s++;
		}
		maxx = max(maxx, a[i]);
		minn = min(minn, a[i]);
	}

	for (i = 0; i < d + 30; i++) {
		if (!touched[i]) continue;
		for (j = 0; j < s; j++) cout << ans[i][j];
		cout << "\n";
	}

	return 0;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

int main() {
	int n, h = 0, w = 0, left = 0, aux = 0;
	cin >> n;

	vector<vector<int>> a(n, vector<int>(2, 1));
	for (int i = 0; i < n; i++) {
		cin >> a[i][0];
		if (a[i][0] > h) h = a[i][0];
		w += a[i][0];
		a[i][1] -= 2 * (i % 2 == 1);
	}

	for (int i = 0; a[i][0] < h; i++) {
		aux += a[i][0] * a[i][1];
	}
	aux--;

	vector<vector<char>> draw(h, vector<char>(w, ' '));

	for (int i = 0; i < n; i++) {
		for (int j = left; j < left + a[i][0]; j++) {
			if (a[i][1] == 1) draw[aux][j] = '/';
			else draw[aux][j] = char(92);
			aux -= a[i][1];
		}
		aux += a[i][1];
		left += a[i][0];
	}

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) cout << draw[i][j];
		cout << endl;
	}

	return 0;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

int main() {
	int n, h = 0, w = 0, left = 0, aux = 0;
	cin >> n;

	vector<vector<int>> a(n, vector<int>(2, 1));
	for (int i = 0; i < n; i++) {
		cin >> a[i][0];
		if (a[i][0] > h) h = a[i][0];
		w += a[i][0];
		a[i][1] -= 2 * (i % 2 == 1);
	}

	for (int i = 0; a[i][0] < h; i++) {
		aux += a[i][0] * a[i][1];
	}
	aux -= aux != 0;

	vector<vector<char>> draw(h, vector<char>(w, ' '));

	for (int i = 0; i < n; i++) {
		for (int j = left; j < left + a[i][0]; j++) {
			if (a[i][1] == 1) draw[aux][j] = '/';
			else draw[aux][j] = char(92);
			aux -= a[i][1];
		}
		aux += a[i][1];
		left += a[i][0];
	}

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) cout << draw[i][j];
		cout << endl;
	}

	return 0;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

int main() {
	int n, h = 0, w = 0, left = 0, aux = 0;
	cin >> n;

	vector<vector<int>> a(n, vector<int>(2, 1));
	for (int i = 0; i < n; i++) {
		cin >> a[i][0];
		if (a[i][0] > h) h = a[i][0];
		w += a[i][0];
		a[i][1] -= 2 * (i % 2 == 1);
	}

	if (a[0][0] != h) {
		for (int i = 0; a[i][0] < h; i++) {
			aux += a[i][0] * a[i][1];
		}
		aux--;
	}
	else aux = h - 1;
	aux += 1000;

	vector<vector<char>> draw(h + 2000, vector<char>(w, ' '));
	vector<char> halp1(w, ' ');

	for (int i = 0; i < n; i++) {
		for (int j = left; j < left + a[i][0]; j++) {
			if (a[i][1] == 1) draw[aux][j] = '/';
			else draw[aux][j] = char(92);
			aux -= a[i][1];
		}
		aux += a[i][1];
		left += a[i][0];
	}

	while (find(draw.begin(), draw.end(), halp1) != draw.end())
		draw.erase(find(draw.begin(), draw.end(), halp1));

	for (unsigned int i = 0; i < draw.size(); i++) {
		for (int j = 0; j < w; j++) cout << draw[i][j];
		cout << endl;
	}

	return 0;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

int main() {
	int n, h = 0, w = 0, left = 0, aux = 0;
	cin >> n;

	vector<vector<int>> a(n, vector<int>(2, 1));
	for (int i = 0; i < n; i++) {
		cin >> a[i][0];
		if (a[i][0] > h) h = a[i][0];
		w += a[i][0];
		a[i][1] -= 2 * (i % 2 == 1);
	}

	if (a[0][0] != h) {
		for (int i = 0; a[i][0] < h; i++) {
			aux += a[i][0] * a[i][1];
		}
		aux--;
	}
	else aux = h - 1;

	vector<vector<char>> draw(h, vector<char>(w, ' '));

	for (int i = 0; i < n; i++) {
		for (int j = left; j < left + a[i][0]; j++) {
			if (a[i][1] == 1) draw[aux][j] = '/';
			else draw[aux][j] = char(92);
			aux -= a[i][1];
		}
		aux += a[i][1];
		left += a[i][0];
	}

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) cout << draw[i][j];
		cout << endl;
	}

	return 0;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

int main() {
	int n, h = 0, w = 0, left = 0, aux = 0;
	cin >> n;

	vector<vector<int>> a(n, vector<int>(2, 1));
	for (int i = 0; i < n; i++) {
		cin >> a[i][0];
		if (a[i][0] > h) h = a[i][0];
		w += a[i][0];
		a[i][1] -= 2 * (i % 2 == 1);
	}

	if (a[0][0] != h) {
		for (int i = 0; a[i][0] < h; i++) {
			aux += a[i][0] * a[i][1];
		}
		aux--;
	}
	else aux = h - 1;
	aux += 1000;

	vector<vector<char>> draw(h + 2000, vector<char>(w, ' '));
	vector<char> halp(w, ' ');

	for (int i = 0; i < n; i++) {
		for (int j = left; j < left + a[i][0]; j++) {
			if (a[i][1] == 1) draw[aux][j] = '/';
			else draw[aux][j] = char(92);
			aux -= a[i][1];
		}
		aux += a[i][1];
		left += a[i][0];
	}

	while (find(draw.begin(), draw.end(), halp) != draw.end()) {
		draw.erase(find(draw.begin(), draw.end(), halp));
	}

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) cout << draw[i][j];
		cout << endl;
	}

	return 0;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

int main() {
	int n, h = 0, w = 0, left = 0, aux = 0;
	cin >> n;

	vector<vector<int>> a(n, vector<int>(2, 1));
	for (int i = 0; i < n; i++) {
		cin >> a[i][0];
		if (a[i][0] > h) h = a[i][0];
		w += a[i][0];
		a[i][1] -= 2 * (i % 2 == 1);
	}

	for (int i = 0; a[i][0] < h; i++) {
		aux += a[i][0] * a[i][1];
	}
	aux--;

	vector<vector<char>> draw(h, vector<char>(w, ' '));

	for (int i = 0; i < n; i++) {
		for (int j = left; j < left + a[i][0]; j++) {
			if (a[i][1] == 1) draw[aux][j] = '/';
			else draw[aux][j] = char(92);
			aux -= a[i][1];
		}
		aux += a[i][1];
		left += a[i][0];
	}

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) cout << draw[i][j] << " ";
		cout << endl;
	}

	return 0;
}


#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

int main() {
	int n, h = 0, w = 0, left = 0, aux = 0;
	cin >> n;

	vector<vector<int>> a(n, vector<int>(2, 1));
	for (int i = 0; i < n; i++) {
		cin >> a[i][0];
		if (a[i][0] > h) h = a[i][0];
		w += a[i][0];
		a[i][1] -= 2 * (i % 2 == 1);
	}

	if (a[0][0] != h) {
		for (int i = 0; a[i][0] < h; i++) {
			aux += a[i][0] * a[i][1];
		}
		aux--;
	}
	else aux = h - 1;
	aux += 1000;

	vector<vector<char>> draw(h + 2000, vector<char>(w, ' '));

	for (int i = 0; i < n; i++) {
		for (int j = left; j < left + a[i][0]; j++) {
			if (a[i][1] == 1) draw[aux][j] = '/';
			else draw[aux][j] = char(92);
			aux -= a[i][1];
		}
		aux += a[i][1];
		left += a[i][0];
	}

	for (int i = 0; i < h; i++) {
		if (find(draw[i].begin(), draw[i].end(), '/') == draw[i].end() || find(draw[i].begin(), draw[i].end(), char(92)) == draw[i].end()) {
			draw.erase(draw.begin());
			i--;
		}
	}

	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) cout << draw[i][j];
		cout << endl;
	}

	return 0;
}


#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <sstream>
#include <algorithm>
using namespace std;
#define rep(_m,s,e) for(ll _m=s;_m<e;_m++)
typedef long long ll;
typedef __int64 li;
int  toInt(string s)   {int r=0; istringstream sin(s); sin>>r; return r;}
ll   toInt64(string s) {ll r=0; istringstream sin(s); sin>>r; return r;}
double  toDouble(string s){double r=0; istringstream sin(s); sin>>r; return r;}
string toString(ll n) {string s,s1; while (n / 10 > 0){ s += (char)((n%10) + 48); n/=10;} s += (char)((n%10) + 48); n/=10; s1 = s; rep(i,0,s.length()) s1[(s.length()-1)-i] = s[i]; return s1;}
bool isUpperCase(char c){return c >= 'A' && c <= 'Z';}
bool isLowerCase(char c){return c >= 'a' && c <= 'z';}
bool isLetter(char c)   {return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z';}
bool isDigit(char c)    {return c >= '0' && c <= '9';}
char toLowerCase(char c){return (isUpperCase(c))?(c + 32) : c;}
char toUpperCase(char c){return (isLowerCase(c))?(c - 32) : c;}
ll gcd(ll a, ll b) {if(!a) return b; return gcd(b%a, a);}
char ans[1001][1001];
struct point{
	int x,y;
}points[1001];

void drawLine(point a, point b)
{
	char c;
	if (b.y > a.y)
		c = '\\';
	else c = '/';
	//shoroo y - 1
	// payan x - 1
	for (int i = a.x; i <= b.x-1; i++)
	{
		ll j;
		if (c == '/')
			j = (a.y-1)-(i - (a.x));
		else j = (a.y)+(i - (a.x));
		ans[j][i] = c;
	}
}

int main()
{
	ios::sync_with_stdio(0);
	ll n;
	cin >> n;
	rep(i,0,1001)
		rep(j,0,1001)
			ans[i][j] = ' ';
	ll maxY, minY;
	ll width = 0;
	rep(i,0,n)
	{
		ll a,b;
		cin >> a;
		b = a;
		if (i == 0)
		{
			points[i].x = a;
			points[i].y = b;
			minY = maxY = b;
		}
		else{
			points[i].x = points[i-1].x + a;
			if (i % 2 == 0)
				points[i].y = points[i-1].y + b;
			else points[i].y = points[i-1].y - b;
			if (minY > points[i].y)
				minY = points[i].y;
			if (maxY < points[i].y)
				maxY = points[i].y;
		}
		width += a;
	}
	ll height = maxY - minY;
	point sefr;
	sefr.x = 0;
	sefr.y = maxY;
	rep(i,0,n)
	{
		points[i].y = maxY - points[i].y;
	}
	drawLine(sefr, points[0]);
	rep(i,1,n)
	{
		drawLine(points[i-1], points[i]);
	}
	rep(i,0,height)
	{
		rep(j,0,width)
			cout << ans[i][j];
		cout << endl;
	}
}


#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <sstream>
#include <algorithm>
using namespace std;
#define rep(_m,s,e) for(ll _m=s;_m<e;_m++)
typedef long long ll;
typedef __int64 li;
int  toInt(string s)   {int r=0; istringstream sin(s); sin>>r; return r;}
ll   toInt64(string s) {ll r=0; istringstream sin(s); sin>>r; return r;}
double  toDouble(string s){double r=0; istringstream sin(s); sin>>r; return r;}
string toString(ll n) {string s,s1; while (n / 10 > 0){ s += (char)((n%10) + 48); n/=10;} s += (char)((n%10) + 48); n/=10; s1 = s; rep(i,0,s.length()) s1[(s.length()-1)-i] = s[i]; return s1;}
bool isUpperCase(char c){return c >= 'A' && c <= 'Z';}
bool isLowerCase(char c){return c >= 'a' && c <= 'z';}
bool isLetter(char c)   {return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z';}
bool isDigit(char c)    {return c >= '0' && c <= '9';}
char toLowerCase(char c){return (isUpperCase(c))?(c + 32) : c;}
char toUpperCase(char c){return (isLowerCase(c))?(c - 32) : c;}
ll gcd(ll a, ll b) {if(!a) return b; return gcd(b%a, a);}
char ans[1001][1001];
struct point{
	int x,y;
}points[1001];

void drawLine(point a, point b)
{
	char c;
	if (b.y > a.y)
		c = '\\';
	else c = '/';
	//shoroo y - 1
	// payan x - 1
	for (int i = a.x; i <= b.x-1; i++)
	{
		ll j;
		if (c == '/')
			j = (a.y-1)-(i - (a.x));
		else j = (a.y)+(i - (a.x));
		ans[j][i] = c;
	}
}

int main()
{
	ios::sync_with_stdio(0);
	ll n;
	cin >> n;
	rep(i,0,1001)
		rep(j,0,1001)
			ans[i][j] = ' ';
	ll maxY, minY;
	ll width = 0;
	rep(i,0,n)
	{
		ll a,b;
		cin >> a;
		b = a;
		if (i == 0)
		{
			points[i].x = a;
			points[i].y = b;
			minY = maxY = b;
		}
		else{
			points[i].x = points[i-1].x + a;
			if (i % 2 == 0)
				points[i].y = points[i-1].y + b;
			else points[i].y = points[i-1].y - b;
			if (minY > points[i].y)
				minY = points[i].y;
			if (maxY < points[i].y)
				maxY = points[i].y;
		}
		width += a;
	}
	point sefr;
	sefr.x = 0;
	sefr.y = maxY;
	ll height = maxY - minY;
	rep(i,0,n)
	{
		points[i].y = maxY - points[i].y;
	}
	drawLine(sefr, points[0]);
	rep(i,1,n)
	{
		drawLine(points[i-1], points[i]);
	}
	rep(i,0,n)
		maxY = max(maxY, (ll)points[i].y);
	rep(i,0,maxY)
	{
		rep(j,0,width)
			cout << ans[i][j];
		cout << endl;
	}
}


#include <stdio.h>
#include <algorithm>

using namespace std;

int a[1010];
int x[1010];
int y[1010];

char f[4010][4010];

int main() {
        for (int i = 0; i < 4000; i++) {
                for (int j = 0; j < 4000; j++) {
                        f[i][j] = ' ';
                }
        }
        int n;
        scanf("%d", &n);
        int _switch = 1;
        int min_y = 4000;
        int max_y = -4000;
        for (int i = 1; i <= n; i++) {
                scanf("%d", &a[i]);
                x[i] = x[i-1] + a[i];
                y[i] = y[i-1] + _switch * a[i];
                _switch *= -1;
        }
        for (int i = 0; i <= n; i++) {
                min_y = min(min_y, y[i]);
                max_y = max(max_y, y[i]);
        }
        int shifty = 2000;
        for (int i = 1; i <= n; i++) {
                char sign;
                if (y[i] > y[i-1]) {
                        sign = '/';
                        for (int coord_x = x[i]-1, coord_y = y[i]-1 + shifty; coord_x >= x[i-1]; coord_x--) {
                                f[coord_y][coord_x] = sign;
                                coord_y--;
                        }
                }
                else {
                        sign = 92;
                        for (int coord_x = x[i]-1, coord_y = y[i] + shifty; coord_x >= x[i-1]; coord_x--) {
                                f[coord_y][coord_x] = sign;
                                coord_y++;
                        }
                }

        }
        min_y += shifty;
        max_y += shifty;
        for (int coord_y = min_y; coord_y < (min_y + max_y)/2; coord_y++) {
                for (int coord_x = 0; coord_x < x[n]; coord_x++) {
                        swap(f[coord_y][coord_x], f[max_y-(coord_y-min_y)-1][coord_x]);
                }
        }
        for (int coord_y = min_y; coord_y < max_y; coord_y++) {
                for (int coord_x = 0; coord_x < x[n]; coord_x++) {
                        printf("%c", f[coord_y][coord_x]);
                }
                printf("\n");
        }
        return 0;
}


#include <stdio.h>
#include <algorithm>

using namespace std;

int a[1010];
int x[1010];
int y[1010];

char f[4010][4010];

int main() {
        int n;
        scanf("%d", &n);
        int _switch = 1;
        int min_y = 4000;
        int max_y = -4000;
        for (int i = 1; i <= n; i++) {
                scanf("%d", &a[i]);
                x[i] = x[i-1] + a[i];
                y[i] = y[i-1] + _switch * a[i];
                _switch *= -1;
        }
        for (int i = 0; i <= n; i++) {
                min_y = min(min_y, y[i]);
                max_y = max(max_y, y[i]);
        }
        int shifty = 2000;
        for (int i = 1; i <= n; i++) {
                char sign;
                if (y[i] > y[i-1]) {
                        sign = '/';
                        for (int coord_x = x[i]-1, coord_y = y[i]-1 + shifty; coord_x >= x[i-1]; coord_x--) {
                                f[coord_y][coord_x] = sign;
                                coord_y--;
                        }
                }
                else {
                        sign = 92;
                        for (int coord_x = x[i]-1, coord_y = y[i] + shifty; coord_x >= x[i-1]; coord_x--) {
                                f[coord_y][coord_x] = sign;
                                coord_y++;
                        }
                }

        }
        min_y += shifty;
        max_y += shifty;
        for (int coord_y = min_y; coord_y < (min_y + max_y)/2; coord_y++) {
                for (int coord_x = 0; coord_x < x[n]; coord_x++) {
                        swap(f[coord_y][coord_x], f[max_y-(coord_y-min_y)-1][coord_x]);
                }
        }
        for (int coord_y = min_y; coord_y < max_y; coord_y++) {
                for (int coord_x = 0; coord_x < x[n]; coord_x++) {
                        printf("%c", f[coord_y][coord_x]);
                }
                printf("\n");
        }
        return 0;
}


/*
В этой задаче требуется нарисовать кардиограмму c помощью ASCII-графики.

Кардиограмма представляет из себя ломаную проходящую через точки:

То есть кардиограмма полностью определяется последовательностью целых положительных чисел a1, a2, ..., an.

Ваша задача по заданной последовательности ai нарисовать кардиограмму.
*/

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <ios>
#include <algorithm>

using namespace std;

template <typename T> T sqr(T x) { return x * x; }
template <typename T> T abs(T x) { return x < 0? -x : x; }
template <typename T> T gcd(T a, T b) { return b? gcd(b, a % b) : a; }
#define foreach(a, b) for(typeof((b).begin()) a = (b).begin(); a != (b).end(); ++a)

#define REP(i,n) for(int i=0;i<(n);i++)

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

int main(int argc, void * argv[])
{
ios_base::sync_with_stdio(false);
int T;
cin >> T;
vector< pair<int, char> > arr;
int m = 0;
int sum = 0;
int i = 0;
int level = 0;
int m1 = 0;
while (T-- > 0)
{
	int n;
	cin >> n;
	if (i % 2)
	{
		REP(j, n) arr.push_back(make_pair(--level, '\\'));
	}
	else
	{
		REP(j, n) arr.push_back(make_pair(level++, '/'));
	}
	m  = max(m, n);
	m1 = max(m1, level);
	sum +=n;
	i++;
}
level = m1-1;
for (int i = 0; i < m; i++)
{
	for (int j = 0; j < sum; j++)
	{
		if (arr[j].first == level)
			putchar(arr[j].second);
		else
			putchar(' ');
	}
	putchar('\n');
	level--;
}
	return 0;
}


/*
В этой задаче требуется нарисовать кардиограмму c помощью ASCII-графики.

Кардиограмма представляет из себя ломаную проходящую через точки:

То есть кардиограмма полностью определяется последовательностью целых положительных чисел a1, a2, ..., an.

Ваша задача по заданной последовательности ai нарисовать кардиограмму.
*/

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <ios>
#include <algorithm>

using namespace std;

template <typename T> T sqr(T x) { return x * x; }
template <typename T> T abs(T x) { return x < 0? -x : x; }
template <typename T> T gcd(T a, T b) { return b? gcd(b, a % b) : a; }
#define foreach(a, b) for(typeof((b).begin()) a = (b).begin(); a != (b).end(); ++a)

#define REP(i,n) for(int i=0;i<(n);i++)

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

int main(int argc, void * argv[])
{
ios_base::sync_with_stdio(false);
int T;
cin >> T;
vector< pair<ll, char> > arr;
int m = 0;
ll sum = 0;
ll i = 0;
int level = 0;
int m1 = 0;
while (T-- > 0)
{
	int n;
	cin >> n;
	if (i % 2)
	{
		REP(j, n) arr.push_back(make_pair(--level, '\\'));
	}
	else
	{
		REP(j, n) arr.push_back(make_pair(level++, '/'));
	}
	m  = min(m, level);
	m1 = max(m1, level);
	sum +=n;
	i++;
}
level = m1-1;
for (int i = 0; i < (m1-m); i++)
{
	for (ll j = 0; j < sum; j++)
	{
		if (arr[j].first == level)
			putchar(arr[j].second);
		else
			putchar(' ');
	}
	putchar('\n');
	level--;
}
	return 0;
}


/*
В этой задаче требуется нарисовать кардиограмму c помощью ASCII-графики.

Кардиограмма представляет из себя ломаную проходящую через точки:

То есть кардиограмма полностью определяется последовательностью целых положительных чисел a1, a2, ..., an.

Ваша задача по заданной последовательности ai нарисовать кардиограмму.
*/

#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <ios>
#include <algorithm>

using namespace std;

template <typename T> T sqr(T x) { return x * x; }
template <typename T> T abs(T x) { return x < 0? -x : x; }
template <typename T> T gcd(T a, T b) { return b? gcd(b, a % b) : a; }
#define foreach(a, b) for(typeof((b).begin()) a = (b).begin(); a != (b).end(); ++a)

#define REP(i,n) for(int i=0;i<(n);i++)

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

int main(int argc, void * argv[])
{
ios_base::sync_with_stdio(false);
int T;
cin >> T;
vector< pair<ll, char> > arr;
int m = 0;
ll sum = 0;
ll i = 0;
int level = 0;
int m1 = 0;
while (T-- > 0)
{
	int n;
	cin >> n;
	if (i % 2)
	{
		REP(j, n) arr.push_back(make_pair(--level, '\\'));
	}
	else
	{
		REP(j, n) arr.push_back(make_pair(level++, '/'));
	}
	m  = max(m, n);
	m1 = max(m1, level);
	sum +=n;
	i++;
}
level = m1-1;
for (int i = 0; i < m; i++)
{
	for (ll j = 0; j < sum; j++)
	{
		if (arr[j].first == level)
			putchar(arr[j].second);
		else
			putchar(' ');
	}
	putchar('\n');
	level--;
}
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>

using namespace std;
const int INF = 1002003000;
int n, st = 0, mx = -INF, mn = INF, all = 0;

int main(){
   // freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    cin >> n;
    vector<int > b(n);
    for (int i = 0; i < n; ++i) {
        cin >> b[i];
        if (i % 2 == 1) st -= b[i];
        else st += b[i];
        if (st>mx) mx = st;
        if (st<mn) mn = st;
        all += b[i];
    }
    //cout << mx << "  " << mn << endl;
    string t;
    char u = '/', d = u + 45;
    for (int i = 0; i < all; ++i) t += ' ';
    int uk = max(-mn,0), p = max(mx-mn, mx); all = 0;
    vector<string > a(p, t);
    for (int i = 0; i < n; ++i){
        for (int j = 0; j < b[i]; ++j)
            if (i % 2 == 1) a[--uk][all++] = d;
            else a[uk++][all++] = u;
    }
    for (int i = p-1; i >= 0; --i) cout << a[i] << endl;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>

using namespace std;
const int INF = 1002003000;
int n, st = 0, mx = -INF, mn = INF, all = 0;

int main(){
   // freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    cin >> n;
    vector<int > b(n);
    for (int i = 0; i < n; ++i) {
        cin >> b[i];
        if (i % 2 == 1) st -= b[i];
        else st += b[i];
        if (st>mx) mx = st;
        if (st<mn) mn = st;
        all += b[i];
    }

    string t;
    char u = '/', d = u + 45;
    for (int i = 0; i < all; ++i) t += ' ';
    vector<string > a(mx-mn, t);
    int uk = -mn; all = 0;
    for (int i = 0; i < n; ++i){
        for (int j = 0; j < b[i]; ++j)
            if (i % 2 == 1) a[--uk][all++] = d;
            else a[uk++][all++] = u;
    }
    for (int i = mx-mn-1; i >= 0; --i) cout << a[i] << endl;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>

using namespace std;
const int INF = 1002003000;
int n, st = 0, mx = -INF, mn = INF, all = 0;

int main(){
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    cin >> n;
    vector<int > b(n);
    for (int i = 0; i < n; ++i) {
        if (st<mn) mn = st;
        cin >> b[i];
        if (i % 2 == 1) st -= b[i];
        else st += b[i];
        if (st>mx) mx = st;

        all += b[i];
    }

    string t;
    char u = '/', d = u + 45;
    for (int i = 0; i < all; ++i) t += ' ';
    vector<string > a(mx-mn, t);
    int uk = -mn; all = 0;
    for (int i = 0; i < n; ++i){
        for (int j = 0; j < b[i]; ++j)
            if (i % 2 == 1) a[--uk][all++] = d;
            else a[uk++][all++] = u;
    }
    for (int i = mx-mn-1; i >= 0; --i) cout << a[i] << endl;
    return 0;
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n,l,s(0),tx(0),ty(1006),max(0),min(2009);
    char c[2010][1010];
    for(int i=0; i<2010; i++)
    {
        for(int j=0; j<1010; j++)
        {
            c[i][j]=' ';
        }
    }
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>l;
        s+=l;
        for(int j=0; j<l; j++)
        {
            if(i%2==0)
            {
                ty--;
                c[ty][tx]='/';
            }
            else
            {
                c[ty][tx]='\\';
                ty++;
            }
            tx++;
        }
        if(ty>max)max=ty;
        if(ty<min)min=ty;
    }
    for(int i=min; i<max; i++)
    {
        for(int j=0; j<s; j++)
        {
            cout<<c[i][j];
        }
        cout<<endl;
    }
}


#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n,l,s(0),tx(0),ty(1006),max(1006),min(1006);
    char c[2010][1010];
    for(int i=0; i<2010; i++)
    {
        for(int j=0; j<1010; j++)
        {
            c[i][j]=' ';
        }
    }
    cin>>n;
    for(int i=0; i<n; i++)
    {
        cin>>l;
        s+=l;
        for(int j=0; j<l; j++)
        {
            if(i%2==0)
            {
                ty--;
                c[ty][tx]='/';
            }
            else
            {
                c[ty][tx]='\\';
                ty++;
            }
            tx++;
        }
        if(ty>max)max=ty;
        if(ty<min)min=ty;
    }
    for(int i=min; i<max; i++)
    {
        for(int j=0; j<s; j++)
        {
            cout<<c[i][j];
        }
        cout<<endl;
    }
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int a;
	int height = 0, width = 0;
	char  c[1001][1001];
	for (int i = 0; i < 1000; i++)
		for (int j = 0; j < 1000; j++)
			c[i][j] = ' ';
	int maxheight = 0;
	int minheight = 1000;
	int input[1000];
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		input[i] = a;
		if (i % 2 == 0)
			height += a;
		else
			height -= a;
		if (maxheight < height)
			maxheight = height;
		if (minheight > height)
			minheight = height;
		width += a;
	}

	int h = maxheight - 1, v = -1;

	for (int i = 0; i < n; i++)
	{
		if (i % 2 == 0)
		{
			for (int j = 0; j < input[i]; j++)
			{
				v++;
				c[h - j][v] = '/';
			}
			h -= (input[i] - 1);
		}
		else
		{
			for (int j = 0; j < input[i]; j++)
			{
				v++;
				c[h + j][v] = '\\';
			}
			h += (input[i] - 1);
		}
	}

	for (int i = 0; i < abs(minheight) + maxheight && i<1000; i++)
	{
		for (int j = 0; j < width; j++)
		{
			cout << c[i][j];
		}
		cout << endl;
	}
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int a;
	int height = 0, width = 0;
	char  c[1000][1000];
	for (int i = 0; i < 1000; i++)
		for (int j = 0; j < 1000; j++)
			c[i][j] = ' ';
	int maxheight = 0;
	int minheight = 1000;
	int input[1000];
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		input[i] = a;
		if (i % 2 == 0)
			height += a;
		else
			height -= a;
		if (maxheight < height)
			maxheight = height;
		if (minheight > height)
			minheight = height;
		width += a;
	}

	int h = maxheight - 1, v = -1;

	for (int i = 0; i < n; i++)
	{
		if (i % 2 == 0)
		{
			for (int j = 0; j < input[i]; j++)
			{
				v++;
				c[h - j][v] = '/';
			}
			h -= (input[i] - 1);
		}
		else
		{
			for (int j = 0; j < input[i]; j++)
			{
				v++;
				c[h + j][v] = '\\';
			}
			h += (input[i] - 1);
		}
	}

	for (int i = 0; i < abs(minheight) + maxheight; i++)
	{
		for (int j = 0; j < width; j++)
		{
			cout << c[i][j];
		}
		cout << endl;
	}
}


#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int a;
	int height = 0, width = 0;
	char  c[1001][1001];
	for (int i = 0; i < 1000; i++)
		for (int j = 0; j < 1000; j++)
			c[i][j] = ' ';
	int maxheight = 0;
	int minheight = 1000;
	int input[1000];
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		input[i] = a;
		if (i % 2 == 0)
			height += a;
		else
			height -= a;
		if (maxheight < height)
			maxheight = height;
		if (minheight > height)
			minheight = height;
		width += a;
	}

	int h = maxheight - 1, v = -1;

	for (int i = 0; i < n; i++)
	{
		if (i % 2 == 0)
		{
			for (int j = 0; j < input[i]; j++)
			{
				v++;
				c[h - j][v] = '/';
			}
			h -= (input[i] - 1);
		}
		else
		{
			for (int j = 0; j < input[i]; j++)
			{
				v++;
				c[h + j][v] = '\\';
			}
			h += (input[i] - 1);
		}
	}

	for (int i = 0; i < abs(minheight) + maxheight && i<1001; i++)
	{
		for (int j = 0; j < width; j++)
		{
			cout << c[i][j];
		}
		cout << endl;
	}
}


#include <iostream>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <cstring>
#include <map>
using namespace std;
#define LL long long
#define ULL unsigned long long
//#define REP(i,n) for(int i=0;i<n;++i)
#define REP(i,a,b) for(int i=a;i<=b;++i)
#define maxn 1111
#define INF (1LL)<<62
#define mset(a) memset(a,0,sizeof a)
#define FR(a) freopen(a,"r",stdin)
#define FW(a) freopen(a,"w",stdout)
const int MOD=10000007 ;
char s[maxn][maxn];
int a[maxn];
int sum[maxn];
int main()
{
    int n;
    while (~scanf("%d",&n))
    {
        mset(sum);
        int maxi=-1;
        int maxa=-1;
        REP(i,0,n-1){
            scanf("%d",a+i);
            if(a[i]>maxa){
                maxa=a[i];
                maxi=i;
            }
        }
        sum[0]=a[0];
        REP(i,1,n-1)
            sum[i]=sum[i-1]+a[i];
        REP(i,0,sum[n-1])
            REP(j,0,sum[n-1]) s[i][j]=' ';
        int k=sum[maxi-1];
        int r=k;
        int y=0;
        int ud=1-maxi%2;
        int maxy=-1;
        REP(i,maxi,n-1){
            if(!ud){
                REP(j,1,a[i])
                    s[y++][r++]='\\';
                y--;
                maxy=max(maxy,y);
                ud=1-ud;
            }
            else {
                REP(j,1,a[i])
                    s[y--][r++]='/';
                y++;
                ud=1-ud;
            }
        }
        y=0;
        r=k-1;
        ud=0;
        for(int i=maxi-1;i>=0;--i){
            if(!ud){
                REP(j,1,a[i])
                    s[y++][r--]='/';
                y--;
                maxy=max(maxy,y);
                ud=1-ud;
            }
            else {
                REP(j,1,a[i])
                    s[y--][r--]='\\';
                y++;
                ud=1-ud;
            }
        }
        REP(i,0,maxy)
        {
            REP(j,0,sum[n-1]-1)
                printf("%c",s[i][j]);
            puts("");
        }
    }
}


#include <iostream>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <cstring>
#include <map>
using namespace std;
#define LL long long
#define ULL unsigned long long
//#define REP(i,n) for(int i=0;i<n;++i)
#define REP(i,a,b) for(int i=a;i<=b;++i)
#define maxn 1111
#define INF (1LL)<<62
#define mset(a) memset(a,0,sizeof a)
#define FR(a) freopen(a,"r",stdin)
#define FW(a) freopen(a,"w",stdout)
const int MOD=10000007 ;
char s[maxn][maxn];
int a[maxn];
int main()
{
    int n;
    while (~scanf("%d",&n))
    {
        REP(i,0,maxn-1)
            REP(j,0,maxn-1)
                s[i][j]=' ';
        int msum=-1;
        int sum=0;
        REP(i,0,n-1){
            scanf("%d",a+i);
            if(i%2) sum-=a[i];
            else sum+=a[i];
            msum=max(msum,sum);
        }
        int y=msum-1;
        int r=0;
        int ud=1;
        int maxy=y;
        REP(i,0,n-1){
            if(ud){
                REP(j,1,a[i])
                    s[y--][r++]='/';
                y++;
                maxy=max(maxy,y);
            }
            else {
                REP(j,1,a[i]) s[y++][r++]='\\';
                y--;
                maxy=max(maxy,y);
            }
            ud=1-ud;
        }
        REP(i,0,maxy){
            REP(j,0,r-1)
                printf("%c",s[i][j]);
            puts("");
        }
    }
}


#include <iostream>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <cstring>
#include <map>
using namespace std;
#define LL long long
#define ULL unsigned long long
//#define REP(i,n) for(int i=0;i<n;++i)
#define REP(i,a,b) for(int i=a;i<=b;++i)
#define maxn 1111
#define INF (1LL)<<62
#define mset(a) memset(a,0,sizeof a)
#define FR(a) freopen(a,"r",stdin)
#define FW(a) freopen(a,"w",stdout)
const int MOD=10000007 ;
char s[maxn][maxn];
int a[maxn];
int main()
{
    int n;
    while (~scanf("%d",&n))
    {
        mset(s);
        int msum=-1;
        int sum=0;
        REP(i,0,n-1){
            scanf("%d",a+i);
            if(i%2) sum-=a[i];
            else sum+=a[i];
            msum=max(msum,sum);
        }
        int y=msum-1;
        int r=0;
        int ud=1;
        int maxy=y;
        REP(i,0,n-1){
            if(ud){
                REP(j,1,a[i])
                    s[y--][r++]='/';
                y++;
                maxy=max(maxy,y);
            }
            else {
                REP(j,1,a[i]) s[y++][r++]='\\';
                y--;
                maxy=max(maxy,y);
            }
            ud=1-ud;
        }
        REP(i,0,maxy){
            REP(j,0,r-1)
                printf("%c",s[i][j]);
            puts("");
        }
    }
}


#include <iostream>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <cstring>
#include <map>
using namespace std;
#define LL long long
#define ULL unsigned long long
//#define REP(i,n) for(int i=0;i<n;++i)
#define REP(i,a,b) for(int i=a;i<=b;++i)
#define maxn 1111
#define INF (1LL)<<62
#define mset(a) memset(a,0,sizeof a)
#define FR(a) freopen(a,"r",stdin)
#define FW(a) freopen(a,"w",stdout)
const int MOD=10000007 ;
char s[maxn][maxn];
int a[maxn];
int sum[maxn];
int main()
{
    int n;
    while (~scanf("%d",&n))
    {
        mset(sum);
        int maxi=-1;
        int maxa=-1;
        REP(i,0,n-1){
            scanf("%d",a+i);
            if(a[i]>maxa){
                maxa=a[i];
                maxi=i;
            }
        }
        sum[0]=a[0];
        REP(i,1,n-1)
            sum[i]=sum[i-1]+a[i];
        REP(i,0,sum[n-1])
            REP(j,0,sum[n-1]) s[i][j]=' ';
        int k=sum[maxi-1];
        int r=k;
        int y=0;
        int ud=0;
        int maxy=-1;
        REP(i,maxi,n-1){
            if(!ud){
                REP(j,1,a[i])
                    s[y++][r++]='\\';
                y--;
                maxy=max(maxy,y);
                ud=1-ud;
            }
            else {
                REP(j,1,a[i])
                    s[y--][r++]='/';
                y++;
                ud=1-ud;
            }
        }
        y=0;
        r=k-1;
        ud=0;
        for(int i=maxi-1;i>=0;--i){
            if(!ud){
                REP(j,1,a[i])
                    s[y++][r--]='/';
                y--;
                maxy=max(maxy,y);
                ud=1-ud;
            }
            else {
                REP(j,1,a[i])
                    s[y--][r--]='\\';
                y++;
                ud=1-ud;
            }
        }
        REP(i,0,maxy-1)
        {
            REP(j,0,sum[n-1])
                printf("%c",s[i][j]);
            puts("");
        }
    }
}


#include <iostream>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <cstring>
#include <map>
using namespace std;
#define LL long long
#define ULL unsigned long long
//#define REP(i,n) for(int i=0;i<n;++i)
#define REP(i,a,b) for(int i=a;i<=b;++i)
#define maxn 1111
#define INF (1LL)<<62
#define mset(a) memset(a,0,sizeof a)
#define FR(a) freopen(a,"r",stdin)
#define FW(a) freopen(a,"w",stdout)
const int MOD=10000007 ;
char s[maxn][maxn];
int a[maxn];
int sum[maxn];
int main()
{
    int n;
    while (~scanf("%d",&n))
    {
        mset(sum);
        int maxi=-1;
        int maxa=-1;
        REP(i,0,n-1){
            scanf("%d",a+i);
            if(a[i]>maxa){
                maxa=a[i];
                maxi=i;
            }
        }
        sum[0]=a[0];
        REP(i,1,n-1)
            sum[i]=sum[i-1]+a[i];
        REP(i,0,sum[n-1])
            REP(j,0,sum[n-1]) s[i][j]=' ';
        int k=sum[maxi-1];
        int r=k;
        int y=0;
        int ud=0;
        int maxy=-1;
        REP(i,maxi,n-1){
            if(!ud){
                REP(j,1,a[i])
                    s[y++][r++]='\\';
                y--;
                maxy=max(maxy,y);
                ud=1-ud;
            }
            else {
                REP(j,1,a[i])
                    s[y--][r++]='/';
                y++;
                ud=1-ud;
            }
        }
        y=0;
        r=k-1;
        ud=0;
        for(int i=maxi-1;i>=0;--i){
            if(!ud){
                REP(j,1,a[i])
                    s[y++][r--]='/';
                y--;
                maxy=max(maxy,y);
                ud=1-ud;
            }
            else {
                REP(j,1,a[i])
                    s[y--][r--]='\\';
                y++;
                ud=1-ud;
            }
        }
        REP(i,0,maxy)
        {
            REP(j,0,sum[n-1])
                printf("%c",s[i][j]);
            puts("");
        }
    }
}


#include <iostream>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <ctime>
#include <vector>
#include <cstring>
#include <map>
using namespace std;
#define LL long long
#define ULL unsigned long long
//#define REP(i,n) for(int i=0;i<n;++i)
#define REP(i,a,b) for(int i=a;i<=b;++i)
#define maxn 1111
#define INF (1LL)<<62
#define mset(a) memset(a,0,sizeof a)
#define FR(a) freopen(a,"r",stdin)
#define FW(a) freopen(a,"w",stdout)
const int MOD=10000007 ;
char s[maxn][maxn];
int a[maxn];
int sum[maxn];
int main()
{
    int n;
    while (~scanf("%d",&n))
    {
        mset(sum);
        int maxi=-1;
        int maxa=-1;
        REP(i,0,n-1){
            scanf("%d",a+i);
            if(a[i]>maxa){
                maxa=a[i];
                maxi=i;
            }
        }
        sum[0]=a[0];
        REP(i,1,n-1)
            sum[i]=sum[i-1]+a[i];
        REP(i,0,sum[n-1])
            REP(j,0,sum[n-1]) s[i][j]=' ';
        int k=sum[maxi-1];
        int r=k;
        int y=0;
        int ud=0;
        int maxy=-1;
        REP(i,maxi,n-1){
            if(!ud){
                REP(j,1,a[i])
                    s[y++][r++]='\\';
                y--;
                maxy=max(maxy,y);
                ud=1-ud;
            }
            else {
                REP(j,1,a[i])
                    s[y--][r++]='/';
                y++;
                ud=1-ud;
            }
        }
        y=0;
        r=k-1;
        ud=0;
        for(int i=maxi-1;i>=0;--i){
            if(!ud){
                REP(j,1,a[i])
                    s[y++][r--]='/';
                y--;
                maxy=max(maxy,y);
                ud=1-ud;
            }
            else {
                REP(j,1,a[i])
                    s[y--][r--]='\\';
                y++;
                ud=1-ud;
            }
        }
        REP(i,0,maxy)
        {
            REP(j,0,sum[n-1]-1)
                printf("%c",s[i][j]);
            puts("");
        }
    }
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<string>
#include<set>
#include<map>
#include<iomanip>
#include<sstream>
#include<functional>
#include<climits>
#define eps 1e-9
const int mod = 1e9 + 7;
using namespace std;

int a[1001];
char res[10001][10001];
void simulate(int x, int n) {
    int i = x;
    bool f = 1;
    int p = 0;
    for (int j = 0; j < n; ++j){
        f = !f;
        for (int k = 0; k < a[j]; ++k) {
            if (!f) res[i--][p++] = '/';
            else res[i++][p++] = '\\';
        }
        if (!f) i++;
        else i--;
    }
}
int main() {
    int n;
    scanf("%d", &n);
    int mx = 0, mn = 0;
    scanf("%d", &a[0]);
    mx = a[0], mn = a[0];

    int curu = a[0], curd = a[0], sum = a[0];
    for (int i = 1; i < n; ++i) {
        scanf("%d", &a[i]);
        sum += a[i];
        curu = curu + (i % 2 ? -a[i] : a[i]);
        mx = max(curu, mx);
        mn = min(curu, mn);
    }
    simulate(mx - 1, n);
    for (int i = 0; i < abs(mx - mn); ++i) {
        for (int j = 0; j < sum; ++j){
            printf("%c", res[i][j]);
        }
        printf("\n");
    }
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<string>
#include<set>
#include<map>
#include<iomanip>
#include<sstream>
#include<functional>
#include<climits>
#define eps 1e-9
const int mod = 1e9 + 7;
using namespace std;

int a[1001];
char res[10001][10001];
void simulate(int x, int n) {
    int i = x;
    bool f = 1;
    int p = 0;
    for (int j = 0; j < n; ++j){
        f = !f;
        for (int k = 0; k < a[j]; ++k) {
            if (!f) res[i--][p++] = '/';
            else res[i++][p++] = '\\';
        }
        if (!f) i++;
        else i--;
    }
}
int main() {
    int n;
    scanf("%d", &n);
    int mx = 0, mn = 0;
    scanf("%d", &a[0]);
    mx = a[0], mn = a[0];

    int curu = a[0], curd = a[0], sum = a[0];
    for (int i = 1; i < n; ++i) {
        scanf("%d", &a[i]);
        sum += a[i];
        curu = curu + (i % 2 ? -a[i] : a[i]);
        mx = max(curu, mx);
        mn = min(curu, mn);
    }
    for (int i = 0; i < abs(mx - mn); ++i) {
        for (int j = 0; j < sum; ++j){
            res[i][j] = ' ';
        }
    }
    simulate(mx - 1, n);
    for (int i = 0; i < abs(mx - mn); ++i) {
        for (int j = 0; j < sum; ++j){
            printf("%c", res[i][j]);
        }
        printf("\n");
    }
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<string>
#include<set>
#include<map>
#include<iomanip>
#include<sstream>
#include<functional>
#include<climits>
#define eps 1e-9
const int mod = 1e9 + 7;
using namespace std;

int a[1001];
char res[10001][10001];
void simulate(int x, int n) {
    int i = x;
    bool f = 1;
    int p = 0;
    for (int j = 0; j < n; ++j){
        f = !f;
        for (int k = 0; k < a[j]; ++k) {
            if (!f) res[i--][p++] = '/';
            else res[i++][p++] = '\\';
        }
        if (!f) i++;
        else i--;
    }
}
int main() {
    int n;
    scanf("%d", &n);
    int mx = 0, mn = 0;
    scanf("%d", &a[0]);
    mx = a[0], mn = 0;

    int curu = a[0], curd = a[0], sum = a[0];
    for (int i = 1; i < n; ++i) {
        scanf("%d", &a[i]);
        sum += a[i];
        curu = curu + (i % 2 ? -a[i] : a[i]);
        mx = max(curu, mx);
        mn = min(curu, mn);
    }
    for (int i = 0; i < abs(mx - mn); ++i) {
        for (int j = 0; j < sum; ++j){
            res[i][j] = ' ';
        }
    }
    simulate(mx - 1, n);
    for (int i = 0; i < abs(mx - mn); ++i) {
        for (int j = 0; j < sum; ++j){
            printf("%c", res[i][j]);
        }
        printf("\n");
    }
    return 0;
}


#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<queue>
#include<functional>
#include<algorithm>
#define ms0(a) memset(a,0,sizeof(a))
#define ms1(a) memset(a,-1,sizeof(a))
#define pb(a) push_back(a)
using namespace std;
//typedef __int64 ll;
const int M = 1e3+5;
const int N = 1e3+10;
char a[2*N][N];
int s[N];
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>s[i];
    memset(a,' ',sizeof(a));
    int x=0,y=M;
    int p=1;
    for(int i=0;i<n;i++)
    {
        int tx=x+s[i];
        int ty=y+p*s[i];
        p*=-1;
        int z=ty-y;
        if(z>0)
        {
            for(int j=0;j<z;j++)
            {
                a[y+j][x+j]='\\';
            }
        }
        else{
             for(int j=0;j<-z;j++)
            {
                a[y-j-1][x+j]='/';
            }
        }
        x=tx;
        y=ty;
    }
    int up=2*N,dw=0,rt=0;
    for(int i=0;i<N;i++)
    {
        for(int j=0;j<N;j++)
        {
            if(a[i][j]!=' ')
            {
                if(i<up)
                    up=i;
                if(i>dw)
                    dw=i;
                if(j>rt)
                    rt=j;
            }
        }
    }
    for(int i=dw;i>=up;i--)
    {
        for(int j=0;j<=rt;j++)
        {
            if(a[i][j]=='\\')
            cout<<'/';
            else if(a[i][j]=='/')
                cout<<'\\';
            else
                cout<<' ';
        }
        cout<<endl;
    }
}


#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<queue>
#include<functional>
#include<algorithm>
#define ms0(a) memset(a,0,sizeof(a))
#define ms1(a) memset(a,-1,sizeof(a))
#define pb(a) push_back(a)
using namespace std;
//typedef __int64 ll;
const int M = 5e2+5;
const int N = 1e3+10;
char a[N][N];
int s[N];
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>s[i];
    memset(a,' ',sizeof(a));
    int x=0,y=M;
    int p=1;
    for(int i=0;i<n;i++)
    {
        int tx=x+s[i];
        int ty=y+p*s[i];
        p*=-1;
        int z=ty-y;
        if(z>0)
        {
            for(int j=0;j<z;j++)
            {
                a[y+j][x+j]='\\';
            }
        }
        else{
             for(int j=0;j<-z;j++)
            {
                a[y-j-1][x+j]='/';
            }
        }
        x=tx;
        y=ty;
    }
    int up=N,dw=0,rt=0;
    for(int i=0;i<N;i++)
    {
        for(int j=0;j<N;j++)
        {
            if(a[i][j]!=' ')
            {
                if(i<up)
                    up=i;
                if(i>dw)
                    dw=i;
                if(j>rt)
                    rt=j;
            }
        }
    }
    for(int i=dw;i>=up;i--)
    {
        for(int j=0;j<=rt;j++)
        {
            if(a[i][j]=='\\')
            cout<<'/';
            else if(a[i][j]=='/')
                cout<<'\\';
            else
                cout<<' ';
        }
        cout<<endl;
    }
}


#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<queue>
#include<functional>
#include<algorithm>
#define ms0(a) memset(a,0,sizeof(a))
#define ms1(a) memset(a,-1,sizeof(a))
#define pb(a) push_back(a)
using namespace std;
//typedef __int64 ll;
const int M = 1e3+5;
const int N = 1e3+10;
char a[2*N][N];
int s[N];
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>s[i];
    memset(a,' ',sizeof(a));
    int x=0,y=M;
    int p=1;
    for(int i=0;i<n;i++)
    {
        int tx=x+s[i];
        int ty=y+p*s[i];
        p*=-1;
        int z=ty-y;
        if(z>0)
        {
            for(int j=0;j<z;j++)
            {
                a[y+j][x+j]='\\';
            }
        }
        else{
             for(int j=0;j<-z;j++)
            {
                a[y-j-1][x+j]='/';
            }
        }
        x=tx;
        y=ty;
    }
    int up=N,dw=0,rt=0;
    for(int i=0;i<N;i++)
    {
        for(int j=0;j<N;j++)
        {
            if(a[i][j]!=' ')
            {
                if(i<up)
                    up=i;
                if(i>dw)
                    dw=i;
                if(j>rt)
                    rt=j;
            }
        }
    }
    for(int i=dw;i>=up;i--)
    {
        for(int j=0;j<=rt;j++)
        {
            if(a[i][j]=='\\')
            cout<<'/';
            else if(a[i][j]=='/')
                cout<<'\\';
            else
                cout<<' ';
        }
        cout<<endl;
    }
}


#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<vector>
#include<queue>
#include<functional>
#include<algorithm>
#define ms0(a) memset(a,0,sizeof(a))
#define ms1(a) memset(a,-1,sizeof(a))
#define pb(a) push_back(a)
using namespace std;
//typedef __int64 ll;
const int M = 1e3+5;
const int N = 1e3+10;
char a[2*N][N];
int s[N];
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>s[i];
    memset(a,' ',sizeof(a));
    int x=0,y=M;
    int p=1;
    for(int i=0;i<n;i++)
    {
        int tx=x+s[i];
        int ty=y+p*s[i];
        p*=-1;
        int z=ty-y;
        if(z>0)
        {
            for(int j=0;j<z;j++)
            {
                a[y+j][x+j]='\\';
            }
        }
        else{
             for(int j=0;j<-z;j++)
            {
                a[y-j-1][x+j]='/';
            }
        }
        x=tx;
        y=ty;
    }
    int up=2*N,dw=0,rt=0;
    for(int i=0;i<2*N;i++)
    {
        for(int j=0;j<N;j++)
        {
            if(a[i][j]!=' ')
            {
                if(i<up)
                    up=i;
                if(i>dw)
                    dw=i;
                if(j>rt)
                    rt=j;
            }
        }
    }
    for(int i=dw;i>=up;i--)
    {
        for(int j=0;j<=rt;j++)
        {
            if(a[i][j]=='\\')
            cout<<'/';
            else if(a[i][j]=='/')
                cout<<'\\';
            else
                cout<<' ';
        }
        cout<<endl;
    }
}


//			be name khoda

#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

const int maxN = 1331;

int c[2 * maxN][2 * maxN], n, a[maxN];

void go(int &x, int &y, int d, int z)
{
	c[x][y] = z;
	if(!d)
		return;
	x++;
	y += z;
	go(x, y, d - 1, z);
}

int main()
{
	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> a[i];
	int x = 0, y = maxN, mn = maxN * 2, mx = - maxN, sm = 0;
	for(int i = 0; i < n; i++)
	{
		sm += a[i];
		int z = -1;
		if(i % 2)
			z = 1;
		go(x, y, a[i] - 1, z);
		x++;
		mn = min(mn, y);
		mx = max(mx, y);
	}
	for(int i = mn; i <= mx; i++, printf("\n"))
		for(int j = 0; j < x; j++)
			if(c[j][i] == 0)
				printf(" ");
			else if(c[j][i] == -1)
				printf("/");
			else printf("\\");
	cin >> n;
}


//			be name khoda

#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

const int maxN = 1331;

int c[2 * maxN][2 * maxN], n, a[maxN];

void go(int &x, int &y, int d, int z)
{
	c[x][y] = z;
	if(!d)
		return;
	x++;
	y += z;
	go(x, y, d - 1, z);
}

int main()
{
	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> a[i];
	int x = 0, y = maxN, mn = maxN, mx = maxN;
	for(int i = 0; i < n; i++)
	{
		int z = -1;
		if(i % 2)
			z = 1;
		go(x, y, a[i] - 1, z);
		x++;
		mn = min(mn, y);
		mx = max(mx, y);
	}
	for(int i = mn; i <= mx; i++, printf("\n"))
		for(int j = 0; j < x; j++)
			if(c[j][i] == 0)
				printf(" ");
			else if(c[j][i] == -1)
				printf("/");
			else printf("\\");
	cin >> n;
}


//          be name khoda

#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

const int maxN = 1331;

int c[2 * maxN][2 * maxN], n, a[maxN];

void go(int &x, int &y, int d, int z)
{
    c[x][y] = z;
    if(!d)
        return;
    x++;
    y += z;
    go(x, y, d - 1, z);
}

int main()
{
    cin >> n;
    for(int i = 0; i < n; i++)
        cin >> a[i];
    int x = 0, y = maxN, mn = maxN * 2, mx = - maxN;
    for(int i = 0; i < n; i++)
    {
        int z = -1;
        if(i % 2)
            z = 1;
        go(x, y, a[i] - (i == n - 1), z);
        x++;
        mn = min(mn, y);
        mx = max(mx, y);
    }
    for(int i = mn; i <= mx; i++, printf("\n"))
        for(int j = 0; j <= x; j++)
            if(c[j][i] == 0)
                printf(" ");
            else if(c[j][i] == -1)
                printf("/");
            else printf("\\");
    cin >> n;
}


#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <utility>
#include <functional>
#include <bitset>
#include <deque>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <cctype>
#include <cstdint>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef pair<int, int> pii;

#define FOR(i, x, y) for(ll i=x; i<=y; i++)
#define FORD(i, x, y) for (ll i = x; i >= y; --i)
#define REP(i, n) for(ll i=0; i<n; i++)
#define REPD(i, n) for(ll i = n - 1; i >= 0; --i)

#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define UNIQ(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define SZ(c) (int)(c).size()
#define CONTAINS(s,obj) (s.find(obj)!=s.end())

#define CLEAR(x) memset(x,0,sizeof x)
#define COPY(from,to) memcpy(to, from, sizeof to)

#define sq(x) ((x)*(x))
#define pb push_back
#define mp make_pair
#define X first
#define Y second

const double eps = 1.0e-11;
const double pi = acos(-1.0);
const int N = 1010;
char res[2 * N][N];

int main() {
  ios_base::sync_with_stdio(0);
  freopen("test.txt", "wt", stdout);
  int n;
  cin >> n;
  int x = N, y = 0;
  int xmax = 0, xmin = 2 * N;
  REP(i, n) {
    int a;
    cin >> a;
    if (i % 2 == 0) {
      REP(t, a) {
        res[x][y] = '/';
        --x, ++y;
      }
      ++x;
    } else {
      REP(t, a) {
        res[x][y] = '\\';
        ++x, ++y;
      }
      --x;
    }
    xmax = max(xmax, x);
    xmin = min(xmin, x);
  }
  FOR(i, xmin, xmax) {
    REP(j, y) printf("%c", res[i][j]);
    printf("\n");
  }
  return 0;
}


#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <utility>
#include <functional>
#include <bitset>
#include <deque>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <cctype>
#include <cstdint>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef pair<int, int> pii;

#define FOR(i, x, y) for(ll i=x; i<=y; i++)
#define FORD(i, x, y) for (ll i = x; i >= y; --i)
#define REP(i, n) for(ll i=0; i<n; i++)
#define REPD(i, n) for(ll i = n - 1; i >= 0; --i)

#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define UNIQ(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define SZ(c) (int)(c).size()
#define CONTAINS(s,obj) (s.find(obj)!=s.end())

#define CLEAR(x) memset(x,0,sizeof x)
#define COPY(from,to) memcpy(to, from, sizeof to)

#define sq(x) ((x)*(x))
#define pb push_back
#define mp make_pair
#define X first
#define Y second

const double eps = 1.0e-11;
const double pi = acos(-1.0);
const int N = 1010;
char res[2 * N][N];

int main() {
  ios_base::sync_with_stdio(0);
  //freopen("test.t.t", "wt", stdout);
  REP(i, 2 * N) REP(j, N) res[i][j] = ' ';
  int n;
  cin >> n;
  int x = N, y = 0;
  int xmax = 0, xmin = 2 * N;
  REP(i, n) {
    int a;
    cin >> a;
    if (i % 2 == 0) {
      REP(t, a) {
        res[x][y] = '/';
        --x, ++y;
      }
      ++x;
    } else {
      REP(t, a) {
        res[x][y] = '\\';
        ++x, ++y;
      }
      --x;
    }
    xmax = max(xmax, x);
    xmin = min(xmin, x);
  }
  FOR(i, xmin, xmax) {
    REP(j, y) printf("%c", res[i][j]);
    printf("\n");
  }
  return 0;
}


#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <utility>
#include <functional>
#include <bitset>
#include <deque>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <cctype>
#include <cstdint>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef pair<int, int> pii;

#define FOR(i, x, y) for(ll i=x; i<=y; i++)
#define FORD(i, x, y) for (ll i = x; i >= y; --i)
#define REP(i, n) for(ll i=0; i<n; i++)
#define REPD(i, n) for(ll i = n - 1; i >= 0; --i)

#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define UNIQ(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define SZ(c) (int)(c).size()
#define CONTAINS(s,obj) (s.find(obj)!=s.end())

#define CLEAR(x) memset(x,0,sizeof x)
#define COPY(from,to) memcpy(to, from, sizeof to)

#define sq(x) ((x)*(x))
#define pb push_back
#define mp make_pair
#define X first
#define Y second

const double eps = 1.0e-11;
const double pi = acos(-1.0);
const int N = 1010;
char res[2 * N][N];

int main() {
  ios_base::sync_with_stdio(0);
  //freopen("test.t.t", "wt", stdout);
  REP(i, 2 * N) REP(j, N) res[i][j] = ' ';
  int n;
  cin >> n;
  int x = N, y = 0;
  int xmax = N, xmin = N;
  REP(i, n) {
    int a;
    cin >> a;
    if (i % 2 == 0) {
      REP(t, a) {
        res[x][y] = '/';
        --x, ++y;
      }
      ++x;
    } else {
      REP(t, a) {
        res[x][y] = '\\';
        ++x, ++y;
      }
      --x;
    }
    xmax = max(xmax, x);
    xmin = min(xmin, x);
  }
  FOR(i, xmin, xmax) {
    REP(j, y) printf("%c", res[i][j]);
    printf("\n");
  }
  return 0;
}

/*
10
10 1 10 2 10 1 2 3 4 5
                                          /\
                                   /\    /  \
                                /\/  \  /    \
                               /      \/      \
                              /                \
                             /
                            /
                           /
                          /
                         /
                    /\  /
                   /  \/
                  /
                 /
                /
               /
              /
             /
            /
         /\/

*/


#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <utility>
#include <functional>
#include <bitset>
#include <deque>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <cctype>
#include <cstdint>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef pair<int, int> pii;

#define FOR(i, x, y) for(ll i=x; i<=y; i++)
#define FORD(i, x, y) for (ll i = x; i >= y; --i)
#define REP(i, n) for(ll i=0; i<n; i++)
#define REPD(i, n) for(ll i = n - 1; i >= 0; --i)

#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define UNIQ(c) SORT(c),(c).resize(unique(ALL(c))-(c).begin())
#define SZ(c) (int)(c).size()
#define CONTAINS(s,obj) (s.find(obj)!=s.end())

#define CLEAR(x) memset(x,0,sizeof x)
#define COPY(from,to) memcpy(to, from, sizeof to)

#define sq(x) ((x)*(x))
#define pb push_back
#define mp make_pair
#define X first
#define Y second

const double eps = 1.0e-11;
const double pi = acos(-1.0);
const int N = 1010;
char res[2 * N][N];

int main() {
  ios_base::sync_with_stdio(0);
  //freopen("test.t.t", "wt", stdout);
  // REP(i, 2 * N) REP(j, N) res[i][j] = ' ';
  int n;
  cin >> n;
  int x = N, y = 0;
  int xmax = 0, xmin = 2 * N;
  REP(i, n) {
    int a;
    cin >> a;
    if (i % 2 == 0) {
      REP(t, a) {
        res[x][y] = '/';
        --x, ++y;
      }
      ++x;
    } else {
      REP(t, a) {
        res[x][y] = '\\';
        ++x, ++y;
      }
      --x;
    }
    xmax = max(xmax, x);
    xmin = min(xmin, x);
  }
  FOR(i, xmin, xmax) {
    REP(j, y) printf("%c", res[i][j]);
    printf("\n");
  }
  return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <iomanip>
#include <vector>

using namespace std;
vector <int> d;
vector <pair<int, int>> ls;
int main(){
    int n, sum = 0, max = -1, min = 0xffff, total = 0;
    cin >> n;
    d.resize(n);
    for (int i = 0; i < n; ++i)
        scanf("%d", &d[i]);
    for (int i = 0; i < n; ++i){
        for (int k = 0; k < d[i]; ++k)
            ls.push_back(make_pair((i & 1) ? sum - k : sum + k + 1, !(i & 1)));
        (i & 1) ? sum -= d[i] : sum += d[i];
        if (sum > max) max = sum;
        if (sum < min) min = sum;
        total += d[i];
    }
    for (int level = max; level >= min; level--){
        int cur = 0;
        for (int i = 0; i < total; ++i){
            if (ls[i].first == level) {
                for (int j = 0; j < i - cur; ++j)
                    cout << " ";
                //cout << setw(i + 1 - cur);
                ls[i].second ?  cout << char(47) : cout << char(92);
                cur = i + 1;
            }
        }
        for (int j = cur; j < total; ++j)
            cout << " ";
        cout << endl;
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <iomanip>
#include <vector>

using namespace std;
vector <int> d;
vector <pair<int, int>> ls;
int main(){
    int n, sum = 0, max = -1, min = 0xffff, total = 0;
    cin >> n;
    d.resize(n);
    for (int i = 0; i < n; ++i)
        scanf("%d", &d[i]);
    for (int i = 0; i < n; ++i){
        for (int k = 0; k < d[i]; ++k)
            ls.push_back(make_pair((i & 1) ? sum - k : sum + k + 1, !(i & 1)));
        (i & 1) ? sum -= d[i] : sum += d[i];
        if (sum > max) max = sum;
        if (sum < min) min = sum;
        total += d[i];
    }
    for (int level = max; level >= min; level--){
        int cur = 0;
        for (int i = 0; i < total; ++i){
            if (ls[i].first == level) {
                for (int j = 0; j < i - cur; ++j)
                    cout << " ";
                //cout << setw(i + 1 - cur);
                ls[i].second ?  cout << char(47) : cout << char(92);
                cur = i + 1;
            }
        }
        cout << endl;
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <iomanip>
#include <vector>

using namespace std;
vector <int> d;
vector <pair<int, int>> ls;
int main(){
    int n, sum = 0, max = -1, min = 0xffff, total = 0;
    cin >> n;
    d.resize(n);
    for (int i = 0; i < n; ++i)
        scanf("%d", &d[i]);
    for (int i = 0; i < n; ++i){
        for (int k = 0; k < d[i]; ++k)
            ls.push_back(make_pair((i & 1) ? sum - k : sum + k + 1, !(i & 1)));
        (i & 1) ? sum -= d[i] : sum += d[i];
        if (sum > max) max = sum;
        if (sum < min) min = sum;
        total += d[i];
    }
    for (int level = max; level >= min; level--){
        int cur = 0;
        for (int i = 0; i < total; ++i){
            if (ls[i].first == level) {
                cout << setw(i + 1 - cur);
                ls[i].second ?  cout << char(47) : cout << char(92);
                cur = i + 1;
            }
        }
        cout << endl;
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <iomanip>
#include <vector>

using namespace std;
vector <int> d;
vector <pair<int, int>> ls;
int main(){
    int n, sum = 0, max =  0, min = 0, total = 0;
    cin >> n;
    d.resize(n);
    for (int i = 0; i < n; ++i)
        scanf("%d", &d[i]);
    for (int i = 0; i < n; ++i){
        for (int k = 0; k < d[i]; ++k)
            ls.push_back(make_pair((i & 1) ? sum - k : sum + k + 1, !(i & 1)));
        (i & 1) ? sum -= d[i] : sum += d[i];
        if (sum > max) max = sum;
        if (sum < min) min = sum;
        total += d[i];
    }
    for (int level = max; level >= min; level--){
        int cur = 0;
        for (int i = 0; i < total; ++i){
            if (ls[i].first == level) {
                for (int j = 0; j < i - cur; ++j)
                    cout << " ";
                //cout << setw(i + 1 - cur);
                ls[i].second ? cout << char(47) : cout << char(92);
                cur = i + 1;
            }
        }
        for (int j = cur; j < total; ++j)
            cout << " ";
        cout << endl;
    }
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <queue>

using namespace std;
int main() {
   int n;
   scanf("%d", &n);
   vector<pair<int, int> > v(n+1);
   v[0].first = 0;
   v[0].second = 0;
   for(int i = 1; i < v.size(); i++)
   {
      int a;
      scanf("%d", &a);
      v[i] = v[i-1];
      v[i].first += a;
      if(i % 2 != 0) v[i].second += a;
      else v[i].second -= a;
   }
   int min = 0;
   int max = 0;
   for(int i = 1; i < v.size(); i++)
   {
      if(v[i].second > v[max].second) max = i;
      if(v[i].second < v[min].second) min = i;
   }
   int m = abs(v[max].second - v[min].second);
   string st(v[n].first, ' ');
   vector<string> res(m, st);
   pair<int, int> s(0, v[max].second - 1);
   for(int i = 1; i < v.size(); i++)
   {
      if(v[i].second > v[i-1].second)
      {
         for(int j = 0; j < v[i].first - v[i-1].first; j++)
         {
            res[s.second][s.first] = '/';
            if(j != v[i].first - v[i-1].first - 1)s.second -= 1;
            s.first += 1;
         }
      }
      else
      {
         for(int j = 0; j < v[i].first - v[i-1].first; j++)
         {
            res[s.second][s.first] = '\\';
            if(j != v[i].first - v[i-1].first - 1)s.second += 1;
            s.first += 1;
         }
      }
   }
   for(int i =0; i < res.size(); i++) printf("%s\n", res[i].c_str());
   return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <stdio.h>
#include <iomanip>
#include <cmath>
#include <vector>
#include<cctype>
#include<algorithm>
#include<set>
#include<stack>
#include<map>
#include<stdlib.h>
#include<ctime>
#include<iterator>
#include <deque>
#include <sstream>
#include<queue>
#include<cstdlib>
#include<bitset>

#define fn(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define f1n(i,n) for(int (i) = 1;(i) <= (n);(i)++)
#define mk(f,s) make_pair((f),(s))

#define ri(n) scanf("%d",&n)
#define rl(n) scanf("%lld",&n)
#define rs(s) scanf("%s",&s)

#define PI 3.1415926535897932384626433832795

using namespace std;

typedef long long ll;
typedef pair<int ,int > pp;

typedef vector<int  > v1;
typedef vector<ll  > vl;
typedef vector<pp  > vpp;
typedef vector<bool  > vb;
typedef vector<char > vc;
typedef vector<v1 > v2;

typedef map<int ,int > mf;
typedef map<int ,vpp > mv;
typedef map<int ,v1 > ad;

int const siz = 1e9,bound = 1e5,mod = siz+7 ;
ll const cnt = 1e14;

vpp aa;
map<int ,vpp > draw;

int main() {
//	freopen("o.txt","w",stdout);
//	freopen("in.txt","r",stdin);
//	ios::sync_with_stdio(0);

	int n;
	ri(n);
	aa.push_back(mk(0,0));
	fn(i,n){
		int a;
		ri(a);
		if(i%2 == 1)
			aa.push_back(mk(aa[i].first+a,aa[i].second-a));
		else aa.push_back(mk(aa[i].first+a,aa[i].second+a));
	//	cout<<aa[i+1].first<<" "<<aa[i+1].second<<endl;
 	}

	int h = 0, w = 0,dir = 1;
	fn(i,aa.size() - 1){
		for(;w<aa[i+1].first;w++){
			draw[h].push_back(mk(w,dir));
			h += dir;
		}

		if(dir == -1){
			dir = 1;
			h++;
		}else{
			dir = -1;
			h--;
		}
	}

	vector<string > ans(draw.size());
	int i = 0;
	for(map<int ,vpp >::reverse_iterator it = draw.rbegin();it != draw.rend();it++){
		int k = 0;
		fn(j,it->second.size()){
		//	cout<<it->first<<" "<<it->second[j].first<<" "<<it->second[j].second<<endl;
			for(;k < it->second[j].first;k++)
				ans[i] += ' ';
			if(it->second[j].second == 1)
				ans[i] += '/';
			else ans[i] += '\\';
			k++;
		}
		i++;
	}

	fn(i,ans.size())
		printf("%s\n",ans[i].c_str());
	return 0;
}


#include <iostream>
#include <fstream>
#include <string>
#include <cstring>
#include <stdio.h>
#include <iomanip>
#include <cmath>
#include <vector>
#include<cctype>
#include<algorithm>
#include<set>
#include<stack>
#include<map>
#include<stdlib.h>
#include<ctime>
#include<iterator>
#include <deque>
#include <sstream>
#include<queue>
#include<cstdlib>
#include<bitset>

#define fn(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define f1n(i,n) for(int (i) = 1;(i) <= (n);(i)++)
#define mk(f,s) make_pair((f),(s))

#define ri(n) scanf("%d",&n)
#define rl(n) scanf("%lld",&n)
#define rs(s) scanf("%s",&s)

#define PI 3.1415926535897932384626433832795

using namespace std;

typedef long long ll;
typedef pair<int ,int > pp;

typedef vector<int  > v1;
typedef vector<ll  > vl;
typedef vector<pp  > vpp;
typedef vector<bool  > vb;
typedef vector<char > vc;
typedef vector<v1 > v2;

typedef map<int ,int > mf;
typedef map<int ,vpp > mv;
typedef map<int ,v1 > ad;

int const siz = 1e9,bound = 1e5,mod = siz+7 ;
ll const cnt = 1e14;

vpp aa;
map<int ,vpp > draw;

int main() {
//	freopen("o.txt","w",stdout);
//	freopen("in.txt","r",stdin);
//	ios::sync_with_stdio(0);

	int n;
	ri(n);
	aa.push_back(mk(0,0));
	fn(i,n){
		int a;
		ri(a);
		if(i%2 == 1)
			aa.push_back(mk(aa[i].first+a,aa[i].second-a));
		else aa.push_back(mk(aa[i].first+a,aa[i].second+a));
	//	cout<<aa[i+1].first<<" "<<aa[i+1].second<<endl;
 	}

	int h = 0, w = 0,dir = 1;
	fn(i,aa.size() - 1){
		for(;w<aa[i+1].first;w++){
			draw[h].push_back(mk(w,dir));
			h += dir;
		}

		if(dir == -1){
			dir = 1;
			h++;
		}else{
			dir = -1;
			h--;
		}
	}

	vector<string > ans(draw.size());
	int i = 0;
	for(map<int ,vpp >::reverse_iterator it = draw.rbegin();it != draw.rend();it++){
		int k = 0;
		fn(j,it->second.size()){
		//	cout<<it->first<<" "<<it->second[j].first<<" "<<it->second[j].second<<endl;
			for(;k < it->second[j].first;k++)
				ans[i] += ' ';
			if(it->second[j].second == 1)
				ans[i] += '/';
			else ans[i] += '\\';
			k++;
		}
		while(k < w)
			ans[i] += ' ',k++;
		i++;
	}

	fn(i,ans.size())
		printf("%s\n",ans[i].c_str());
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
#include<queue>
using namespace std;
typedef long long Int;
/*
*/
pair<int,int> dp[1002];
int a[1002];
int n;
int Map[2000][2000];
int ymax=-999999,ymin=999999;
void get(int id1,int id2)
{
	int x1=dp[id1].first,y1=dp[id1].second;
	int x2=dp[id2].first,y2=dp[id2].second;
	bool flag;
	if(y1<y2)flag=true;else flag=false;
	int pace=x2-x1;
	if(flag)
	{
	for(int i=x1+1,j=ymax-y1;i<=x2;i++,j--)
	   {
	     Map[j][i]='/';
	   }
    }
    else
    {
    	for(int i=x1+1,j=ymax-y1+1;i<=x2;i++,j++)
	   {
	     Map[j][i]='\\';
	   }
	}
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	 scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
       {
	     dp[i].first=dp[i-1].first+a[i];
	     dp[i].second=dp[i-1].second+((i&1)?a[i]:-a[i]);
	     ymax=max(ymax,dp[i].second);
	     ymin=min(ymin,dp[i].second);
       }
    sort(dp+1,dp+n+1);
    //for(int i=1;i<=n;i++)
     // printf("%d %d\n",dp[i].first,dp[i].second);
    for(int i=0;i<n;i++)
       get(i,i+1);
    for(int i=1;i<=ymax-ymin;i++)
       {for(int j=1;j<=dp[n].first;j++)
          printf("%c",Map[i][j]?Map[i][j]:' ');
          puts("");
      }
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
#include<queue>
using namespace std;
typedef long long Int;
/*
*/
pair<int,int> dp[1002];
int a[1002];
int n;
int Map[2000][2000];
int ymax=-999999,ymin=999999;
void get(int id1,int id2)
{
	int x1=dp[id1].first,y1=dp[id1].second;
	int x2=dp[id2].first,y2=dp[id2].second;
	bool flag;
	if(y1<y2)flag=true;else flag=false;
	int pace=x2-x1;
	if(flag)
	{
	for(int i=x1+1,j=ymax-y1;i<=x2;i++,j--)
	   {
	     Map[j][i]='/';
	   }
    }
    else
    {
    	for(int i=x1+1,j=ymax-y1+1;i<=x2;i++,j++)
	   {
	     Map[j][i]='\\';
	   }
	}
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	 scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
       {
	     dp[i].first=dp[i-1].first+a[i];
	     dp[i].second=dp[i-1].second+((i&1)?a[i]:-a[i]);
	     ymax=max(ymax,dp[i].second);
	     ymin=min(ymin,dp[i].second);
       }
    sort(dp+1,dp+n+1);
    for(int i=1;i<=n;i++)
      printf("%d %d\n",dp[i].first,dp[i].second);
    for(int i=0;i<n;i++)
       get(i,i+1);
    for(int i=1;i<=ymax-ymin;i++)
       {for(int j=1;j<=dp[n].first;j++)
          printf("%c",Map[i][j]?Map[i][j]:' ');
          puts("");
      }
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
#include<queue>
using namespace std;
typedef long long Int;
/*
*/
pair<int,int> dp[1002];
int a[1002];
int n;
int Map[2000][2000];
int ymax=0,ymin=0;
void get(int id1,int id2)
{
	int x1=dp[id1].first,y1=dp[id1].second;
	int x2=dp[id2].first,y2=dp[id2].second;
	bool flag;
	if(y1<y2)flag=true;else flag=false;
	int pace=x2-x1;
	if(flag)
	{
	for(int i=x1+1,j=ymax-y1;i<=x2;i++,j--)
	   {
	     Map[j][i]='/';
	   }
    }
    else
    {
    	for(int i=x1+1,j=ymax-y1+1;i<=x2;i++,j++)
	   {
	     Map[j][i]='\\';
	   }
	}
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	 scanf("%d",&a[i]);
    for(int i=1;i<=n;i++)
       {
	     dp[i].first=dp[i-1].first+a[i];
	     dp[i].second=dp[i-1].second+((i&1)?a[i]:-a[i]);
	     ymax=max(ymax,dp[i].second);
	     ymin=min(ymin,dp[i].second);
       }
    sort(dp+1,dp+n+1);
    //for(int i=1;i<=n;i++)
     // printf("%d %d\n",dp[i].first,dp[i].second);
    for(int i=0;i<n;i++)
       get(i,i+1);
       int ans=ymax-ymin;
       bool flag=false;
       for(int j=1;j<=dp[n].first;j++)
          if(Map[ans][j])
             {flag=true;
             }
       if(!flag)ans--;
    for(int i=1;i<=ans;i++)
       {for(int j=1;j<=dp[n].first;j++)
          printf("%c",Map[i][j]?Map[i][j]:' ');
          puts("");
      }
	return 0;
}


#include <iostream>
#include <vector>
#include <iomanip>
#include <string>
#include <algorithm>
#include <set>
#include <map>

using namespace std;

int main ()
{
	int n;
	cin >> n;
	vector <int> v (n);
	int sum = 0;
	int balance = 0;
	int mx = -1000000000, mn = 1000000000;
	for (int i = 0; i < n; ++i)
	{
		cin >> v [i];
		sum += v [i];
		if (i % 2 == 0)
			balance += v [i];
		else
			balance -= v [i];
		mx = max (mx, balance);
		mn = min (mn, balance);
	}
	vector < vector <char> > a (mx-mn+1, vector <char> (sum, ' '));
	int cur = -mn;
	int cursum = 0;
	for (int i = 0; i < n; ++i)
	{
		if (i % 2 == 0)
		{
			for (int j = 0; j < v [i]; ++j)
				a [cur+j][cursum+j] = '/';
			cursum += v [i];
			cur += v [i];
			--cur;
		}
		else
		{
			for (int j = 0; j < v [i]; ++j)
				a [cur-j][cursum+j] = '\\';
			cursum += v [i];
			cur -= v [i];
			++cur;
		}
	}
	reverse (a.begin (), a.end ());
	for (int i = 1; i < a.size (); ++i)
	{
		for (int j = 0; j < a [i].size (); ++j)
			cout << a [i][j];
		if (i != a.size () - 1)
			cout << endl;
	}
}


#include <iostream>
#include <vector>
#include <iomanip>
#include <string>
#include <algorithm>
#include <set>
#include <map>

using namespace std;

int main ()
{
	int n;
	cin >> n;
	vector <int> v (n);
	int sum = 0;
	int balance = 0;
	int mx = 0, mn = 0;
	for (int i = 0; i < n; ++i)
	{
		cin >> v [i];
		sum += v [i];
		if (i % 2 == 0)
			balance += v [i];
		else
			balance -= v [i];
		mx = max (mx, balance);
		mn = min (mn, balance);
	}
	vector < vector <char> > a (mx-mn+1, vector <char> (sum, ' '));
	int cur = -mn;
	int cursum = 0;
	for (int i = 0; i < n; ++i)
	{
		if (i % 2 == 0)
		{
			for (int j = 0; j < v [i]; ++j)
				a [cur+j][cursum+j] = '/';
			cursum += v [i];
			cur += v [i];
			--cur;
		}
		else
		{
			for (int j = 0; j < v [i]; ++j)
				a [cur-j][cursum+j] = '\\';
			cursum += v [i];
			cur -= v [i];
			++cur;
		}
	}
	reverse (a.begin (), a.end ());
	for (int i = 1; i < a.size (); ++i)
	{
		for (int j = 0; j < a [i].size (); ++j)
			cout << a [i][j];
		if (i != a.size () - 1)
			cout << endl;
	}
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MEM(a,b) memset((a),(b),sizeof(a))
const double eps = 1e-10;
map<int, vector<int> > mv;
char ch[3000][3000];
int main()
{
	//freopen("input.txt", "r", stdin);
	LL n;
	char c[3] = "/\\";
	int a[2] = { 1, -1 };
	MEM(ch, 0);
	int x = 1500;
	int y = 0;
	cin >> n;
	int minx = 5000;
	int maxx = -5000;
	for (int i = 0; i < n; i++)
	{
		int t;
		cin >> t;
		while (t--)
		{
			ch[x][y] = c[i & 1];
			y++;
			x -= a[i & 1];
		}
		x += a[i & 1];
		minx = min(minx, x);
		maxx = max(maxx, x);
	}
	for (int i = minx; i <= maxx; i++)
	{
		for (int j = 0; j < y; j++)
		{
			if (ch[i][j]) putchar(ch[i][j]);
			else putchar(' ');
		}
		puts("");
	}
	return 0;
}


#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MEM(a,b) memset((a),(b),sizeof(a))
const double eps = 1e-10;
map<int, vector<int> > mv;
char ch[3000][3000];
int main()
{
	//freopen("input.txt", "r", stdin);
	LL n;
	char c[3] = "/\\";
	int a[2] = { 1, -1 };
	MEM(ch, 0);
	int x = 1500;
	int y = 0;
	cin >> n;
	int minx = x;
	int maxx = x;
	for (int i = 0; i < n; i++)
	{
		int t;
		cin >> t;
		while (t--)
		{
			ch[x][y] = c[i & 1];
			y++;
			x -= a[i & 1];
		}
		x += a[i & 1];
		minx = min(minx, x);
		maxx = max(maxx, x);
	}
	for (int i = minx; i <= maxx; i++)
	{
		for (int j = 0; j < y; j++)
		{
			if (ch[i][j]) putchar(ch[i][j]);
			else putchar(' ');
		}
		puts("");
	}
	return 0;
}


#include<iostream>
#include<string.h>
using namespace std;
int main()
{
 char a[200005],temp;
 long long int m,b[100005],i,x=0,y=0,len=0,x1=0,y1=0,temp1=0,j;
 cin>>a;
 cin>>m;
 for(i=0;i<m;i++)
    cin>>b[i];
 len=strlen(a);
 for(i=0;i<m;i++)
 {
     x=b[i];
     y=len-x+1;
     x--;y--;
     x1=y-x+1;
     temp1=x1-1;
     y1=x1/2;
     for(j=x;j<x+y1;j++)
     {
         temp=a[j];
         a[j]=a[j+temp1];
         a[j+temp1]=temp;
         temp1-=2;
     }
 }
 cout<<a;
 return 0;
}


#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
    string s;
    char c;
    cin>>s;
    long long m,n,i,x=0,y=0,z=0,a[10005],b[20005]={0};
    cin>>m;
    n=s.length();
    for(i=0;i<m;i++){cin>>a[i];a[i]-=1;b[a[i]]++;}
    for(i=0;i<n;i++)
    {
        if(b[i]==0)continue;
        if((x+b[i])%2==0){x+=b[i];continue;}x+=b[i];
        for(y=i;;y++)
        {
            if(b[y]>0 && i!=y)break;
            c=s[y];s[y]=s[n-y-1];s[n-y-1]=c;z++;
            if(z>=(n-i-1)/2){z=0;break;}
        }
    }
    cout<<s;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
    string s;
    char c;
    cin>>s;
    long long m,n,i,x=0,y=0,z=0,a[100005],b[200005]={0};
    cin>>m;
    n=s.length();
    for(i=0;i<m;i++){cin>>a[i];a[i]-=1;b[a[i]]++;}
    for(i=0;i<n;i++)
    {
        if(b[i]==0)continue;
        if((x+b[i])%2==0){x+=b[i];continue;}x+=b[i];
        for(y=i;;y++)
        {
            if(b[y]>0 && i!=y)break;
            c=s[y];s[y]=s[n-y-1];s[n-y-1]=c;z++;
            if(z>=(n-i)/2){z=0;break;}
        }
        z=0;
    }
    cout<<s;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
    string s;
    char c;
    cin>>s;
    long long m,n,i,x=0,y=0,z=0,a[10005],b[20005]={0};
    cin>>m;
    n=s.length();
    for(i=0;i<m;i++){cin>>a[i];a[i]-=1;b[a[i]]++;}
    for(i=0;i<n;i++)
    {
        if(b[i]==0)continue;
        if((x+b[i])%2==0){x+=b[i];continue;}x+=b[i];
        for(y=i;y<=(n-i-1)/2;y++)
        {
            if(b[y]>0 && i!=y)break;
            c=s[y];s[y]=s[n-y-1];s[n-y-1]=c;
        }
    }
    cout<<s;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
    string s;
    char c;
    cin>>s;
    long long m,n,i,x=0,y=0,z=0,a[100005],b[200005]={0};
    cin>>m;
    n=s.length();
    for(i=0;i<m;i++){cin>>a[i];a[i]-=1;b[a[i]]++;}
    for(i=0;i<n;i++)
    {
        if(b[i]==0)continue;
        if((x+b[i])%2==0){x+=b[i];continue;}x+=b[i];
        for(y=i;;y++)
        {
            if(b[y]>0 && i!=y)break;
            c=s[y];s[y]=s[n-y-1];s[n-y-1]=c;z++;
            if(z>=(n-i-1)/2){z=0;break;}
        }
        z=0;
    }
    cout<<s;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <stdio.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <cstdio>
typedef long long ll;
typedef double d;
typedef unsigned long long ull;
typedef float f;
using namespace std;

int main()
{
    string  s;
    ll n,z;
    cin >> s>>n;
    for(int i =0;i<n;i++)
    {
        cin >> z;
        string re,e;
        re=s.substr(z-1,s.size()-z+1-z+1);
        //cout << re <<endl;
        e=s.substr(0,z-1);
        //cout << e<<endl;
        reverse(e.begin(),e.end());
        re+=e;
        reverse(re.begin(),re.end());
        e=s.substr(s.size()-z+1,s.size()-(s.size()-z+1));
        //cout << e<<endl;
        re+=e;
        s=re;
    }
    cout << s<< endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <stdio.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <cstdio>
typedef long long ll;
typedef double d;
typedef unsigned long long ull;
typedef float f;
using namespace std;

int main()
{
    string  s;
    ll n,z;
    cin >> s>>n;
    for(int i =0;i<n;i++)
    {
        cin >> z;
        string re;
        re=s.substr(z-1,s.size()-z+1-z+1);
        reverse(re.begin(),re.end());
        s.erase(z-1,s.size()-z+1-z+1);
        s.insert(z-1,re);
    }
    cout << s<< endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
typedef long long ll;
typedef double d;

using namespace std;
bool arr[1000005]={false};
int main()
{
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    ll n,x;
    string s;
    vector <ll> a;
    map <ll,ll> maap;
    cin >> s>>n;
    for(int i =0;i<n;i++)
    {
        cin >> x; maap[x]++;
    }
    map<ll,ll> ::iterator it;
    for(it=maap.begin();it!=maap.end();it++)
    {
        if(it->second%2)
            a.push_back(it->first);
    }
    sort(a.begin(),a.end());
    for(int i=0;i<a.size();i++)
    {
        if((a.size()-i)%2)
        for(int k=a[i]-1;k<s.size()/2;k++)
        {
            if(arr[k])
                arr[k]=0;
            else
                arr[k]=1;
        }
    }
    for(int i =0;i<s.size();i++)
    {
        if(i<s.size()/2)
        {
            if(arr[i])
            cout << s[s.size()-i-1];
            else
                cout <<s[i];
        }
        if(i>=s.size()/2)
        {
            if(arr[s.size()-i-1])
                cout << s[s.size()-i-1];
            else
                cout << s[i];
        }
    } cout << endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <stdio.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <cstdio>
typedef long long ll;
typedef double d;
typedef unsigned long long ull;
typedef float f;
using namespace std;

int main()
{
    string  s;
    ll n,z;
    vector <ll> day;
    cin >> s>>n;
    for(int i =0; i<n; i++)
    {
        cin >> z;
        day.push_back(z);
    }
    day.push_back(0);
    for(int i=0; i<n; i++)
    {
        if(day[i]!=day[i+1])
        {
            z= day[i];
            string re;
            re=s.substr(z-1,s.size()-z+1-z+1);
            reverse(re.begin(),re.end());
            s.erase(z-1,s.size()-z+1-z+1);
            s.insert(z-1,re);
        }
        else
            i++;
    }
    cout << s<< endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
typedef long long ll;
typedef double d;

using namespace std;
bool arr[1000005]={false};
int main()
{
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    ll n,x;
    string s;
    vector <ll> a;
    map <ll,ll> maap;
    cin >> s>>n;
    for(int i =0;i<n;i++)
    {
        cin >> x; maap[x]++;
    }
    map<ll,ll> ::iterator it;
    for(it=maap.begin();it!=maap.end();it++)
    {
        if(it->second%2)
            a.push_back(it->first);
    }
    sort(a.rbegin(),a.rend());
    ll last=s.size()/2+1;
    for(int i=0;i<a.size();i++)
    {
        if((a.size()-i+1)%2==0)
        {
        for(int k=a[i]-1;k<last-1;k++)
        {
            if(arr[k])
                arr[k]=0;
            else
                arr[k]=1;
        }
        }
        last=a[i];
    }
    for(int i =0;i<s.size();i++)
    {
        if(i<s.size()/2)
        {
            if(arr[i])
            cout << s[s.size()-i-1];
            else
                cout <<s[i];
        }
        if(i>=s.size()/2)
        {
            if(arr[s.size()-i-1])
                cout << s[s.size()-i-1];
            else
                cout << s[i];
        }
    } cout << endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
typedef long long ll;
typedef double d;

using namespace std;
bool arr[1000005]={false};
int main()
{
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    ll n,x;
    string s;
    vector <ll> a;
    map <ll,ll> maap;
    cin >> s>>n;
    for(int i =0;i<n;i++)
    {
        cin >> x; maap[x]++;
    }
    map<ll,ll> ::iterator it;
    for(it=maap.begin();it!=maap.end();it++)
    {
        if(it->second%2)
            a.push_back(it->first);
    }
    for(int i=0;i<a.size();i++)
    {
        for(int k=a[i]-1;k<s.size()/2;k++)
        {
            if(arr[k])
                arr[k]=0;
            else
                arr[k]=1;
        }
    }
    for(int i =0;i<s.size();i++)
    {
        if(i<s.size()/2)
        {
            if(arr[i])
            cout << s[s.size()-i-1];
            else
                cout <<s[i];
        }
        if(i>=s.size()/2)
        {
            if(arr[s.size()-i-1])
                cout << s[s.size()-i-1];
            else
                cout << s[i];
        }
    } cout << endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <stdio.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <cstdio>
typedef long long ll;
typedef double d;
typedef unsigned long long ull;
typedef float f;
using namespace std;

int main()
{
    string  s;
    ll n,z;
    vector <ll> day;
    cin >> s>>n;
    for(int i =0;i<n;i++)
    {
        cin >> z;
        day.push_back(z);
    }
    day.push_back(0);
    for(int i=0;i<n;i++)
    {
        if(day[i]!=day[i+1])
        {string re;
        re=s.substr(z-1,s.size()-z+1-z+1);
        reverse(re.begin(),re.end());
        s.erase(z-1,s.size()-z+1-z+1);
        s.insert(z-1,re);
        }
        else
            i++;
    }
    cout << s<< endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
typedef long long ll;
typedef double d;

using namespace std;
bool arr[1000005]={false};
int main()
{
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    ll n,x;
    string s;
    vector <ll> a;
    cin >> s>>n;
    for(int i =0;i<n;i++)
    {
        cin >> x;
        for(int i =x-1;i<s.size()/2;i++)
            {
                if(arr[i])
                    arr[i]=0;
                else
                    arr[i]=1;
            }
    }
    for(int i =0;i<s.size();i++)
    {
        if(i<s.size()/2)
        {
            if(arr[i])
            cout << s[s.size()-i-1];
            else
                cout <<s[i];
        }
        if(i>=s.size()/2)
        {
            if(arr[s.size()-i-1])
                cout << s[s.size()-i-1];
            else
                cout << s[i];
        }
    } cout << endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
typedef long long ll;
typedef double d;

using namespace std;
bool arr[1000005]={false};
int main()
{
    ll n,x;
    string s;
    vector <ll> a;
    cin >> s>>n;
    for(int i =0;i<n;i++)
    {
        cin >> x;
        for(int i =x-1;i<s.size()/2;i++)
            {
                if(arr[i])
                    arr[i]=0;
                else
                    arr[i]=1;
            }
    }
    for(int i =0;i<s.size();i++)
    {
        if(i<s.size()/2)
        {
            if(arr[i])
            cout << s[s.size()-i-1];
            else
                cout <<s[i];
        }
        if(i>=s.size()/2)
        {
            if(arr[s.size()-i-1])
                cout << s[s.size()-i-1];
            else
                cout << s[i];
        }
    } cout << endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
typedef long long ll;
typedef double d;

using namespace std;
bool arr[1000005]={false};
int main()
{
    ll n,x;
    string s;
    vector <ll> a;
    cin >> s>>n;
    for(int i =0;i<n;i++)
    {
        cin >> x;
        for(int i =x-1;i<s.size()/2;i++)
            {
                if(arr[i])
                    arr[i]=0;
                else
                    arr[i]=1;
            }
    }
    for(int i =0;i<s.size()/2;i++)
    {
        if(arr[i])
            swap(s[i],s[s.size()-i-1]);
    }
    cout << s<< endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <limits>
#include <map>
#include <math.h>
#include <list>
#include <set>
#include <queue>

using namespace std;

int main() {
    string s;
    int m,t;
    cin >> s;
    cin >> m;
    vector<int> v (s.length(), 0);
    for (int i = 0; i < m; i++) {
        cin >> t;
        v[t-1]++;
    }
    int adjswaps = 0;
    for (int i = 0; i < s.length()/2; i++) {
        int n = adjswaps + v[i];
        if (n % 2 != 0) {
            char c = s[i];
            s[i] = s[s.length()-i-1];
            s[s.length()-i-1] = c;
        }
        if (v[i] % 2 != 0) adjswaps++;
    }
    cout << s << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <limits>
#include <map>
#include <math.h>
#include <list>
#include <set>
#include <queue>

using namespace std;

int main() {
    string s;
    int m,t;
    map<int,int> h;
    cin >> s;
    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> t;
        for (int j = t-1; j < (s.length()/2); j++) {
            if (h.count(j)) {
                h[j]++;
            } else {
                h[j] = 1;
            }
        }
    }
    map<int,int>::iterator it;
    for (it = h.begin(); it != h.end(); it++) {
        if (it->second % 2 != 0) {
            char c = s[it->first];
            s[it->first] = s[s.length()-it->first-1];
            s[s.length()-it->first-1] = c;
        }
    }
    cout << s << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <limits>
#include <map>
#include <math.h>
#include <list>
#include <set>
#include <queue>

using namespace std;

int main() {
    string s;
    int m,t;
    map<int,int> h;
    cin >> s;
    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> t;
        if (h.count(t)) {
            h[t]++;
        } else {
            h[t] = 1;
        }
    }
    map<int,int>::iterator it;
    for (it = h.begin(); it != h.end(); it++) {
        if (it->second % 2 != 0) {
            string::iterator itt = s.begin();
            string::iterator ittt = s.end();
            int i = 1;
            while (i != it->first) {
                itt++;
                ittt--;
                i++;
            }
            reverse(itt, ittt);
        }
    }
    cout << s << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <limits>
#include <map>
#include <math.h>
#include <list>
#include <set>
#include <queue>

using namespace std;

int main() {
    string s;
    int m,t;
    cin >> s;
    cin >> m;
    vector<int> v (s.length(), 0);
    for (int i = 0; i < m; i++) {
        cin >> t;
        v[t-1]++;
    }
    int adjswaps = 0;
    for (int i = 0; i < s.length(); i++) {
        int n = adjswaps + v[i];
        if (n % 2 != 0) {
            char c = s[i];
            s[i] = s[s.length()-i-1];
            s[s.length()-i-1] = c;
            adjswaps++;
        }
    }
    cout << s << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
int main()
{
    string s;
    cin >> s;
    int m, a;
    cin >> m;
    int arr[s.length()/2 + 1];
    for(int i = 0; i < m; i++)
    {
        cin >> a;
        arr[a - 1]++;
        if(arr[a - 1]%2 == 0){arr[a - 1] = 0;}
    }
    for(int i = 1; i < s.length()/2 ; i++)
    {
        arr[i] = arr[i] + arr[i - 1];
    }
    for(int i = 0; i < s.length()/2 ; i++)
    {
        arr[i] %= 2;
        if(arr[i] == 0){
            char temp = s[i];
            s[i] = s[s.length() - (i) - 1];
            s[s.length() - (i) - 1] = temp;

        }
    }
    cout << s<< endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
int main()
{
    string s;
    cin >> s;
    int m, a;
    cin >> m;
    vector<ll> arr(s.length()/2 + 1);
    for(int i = 0; i < m; i++)
    {
        cin >> a;
        arr[a - 1]++;
        //if(arr[a - 1]%2 == 0){arr[a - 1] = 0;}
    }
    for(int i = 1; i < s.length()/2 ; i++)
    {
        arr[i] = arr[i] + arr[i - 1];
    }
    for(int i = 0; i < s.length()/2 ; i++)
    {
        arr[i] %= 2;
        if(arr[i] == 1){
            char temp = s[i];
            s[i] = s[s.length() - (i) - 1];
            s[s.length() - (i) - 1] = temp;

        }
    }
    cout << s<< endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
int main()
{
    string s;
    cin >> s;
    int m, a;
    cin >> m;
    ll arr[s.length()/2 + 1];
    for(int i = 0; i < m; i++)
    {
        cin >> a;
        arr[a - 1]++;
        //if(arr[a - 1]%2 == 0){arr[a - 1] = 0;}
    }
    for(int i = 1; i < s.length()/2 ; i++)
    {
        arr[i] = arr[i] + arr[i - 1];
    }
    for(int i = 0; i < s.length()/2 ; i++)
    {
        arr[i] %= 2;
        if(arr[i] == 0){
            char temp = s[i];
            s[i] = s[s.length() - (i) - 1];
            s[s.length() - (i) - 1] = temp;

        }
    }
    cout << s<< endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
int main()
{
    string s;
    cin >> s;
    int m, a;
    cin >> m;
    ll arr[s.length()/2 + 1];
    for(int i = 0; i < m; i++)
    {
        cin >> a;
        arr[a - 1]++;
        //if(arr[a - 1]%2 == 0){arr[a - 1] = 0;}
    }
    for(int i = 1; i < s.length()/2 ; i++)
    {
        arr[i] = arr[i] + arr[i - 1];
    }
    for(int i = 0; i < s.length()/2 ; i++)
    {
        arr[i] %= 2;
        if(arr[i] == 1){
            char temp = s[i];
            s[i] = s[s.length() - (i) - 1];
            s[s.length() - (i) - 1] = temp;

        }
    }
    cout << s<< endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
int main()
{
    string s;
    cin >> s;
    int m, a;
    cin >> m;
    int arr[s.length()/2 + 1];
    for(int i = 0; i < m; i++)
    {
        cin >> a;
        arr[a - 1]++;
        if(arr[a - 1]%2 == 0){arr[a - 1] = 0;}
    }
    for(int i = 1; i < s.length()/2 ; i++)
    {
        arr[i] = arr[i] + arr[i - 1];
    }
    for(int i = 0; i < s.length()/2 ; i++)
    {
        arr[i] %= 2;
        if(arr[i] == 1){
            char temp = s[i];
            s[i] = s[s.length() - (i) - 1];
            s[s.length() - (i) - 1] = temp;

        }
    }
    cout << s;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long int
int main()
{
    string s;
    cin >> s;
    int m, a;
    cin >> m;
    int arr[s.length()/2 + 1];
    for(int i = 0; i < m; i++)
    {
        cin >> a;
        arr[a - 1]++;
        if(arr[a - 1]%2 == 0){arr[a - 1] = 0;}
    }
    for(int i = 1; i < s.length()/2 ; i++)
    {
        arr[i] = arr[i] + arr[i - 1];
    }
    for(int i = 0; i < s.length()/2 ; i++)
    {
        arr[i] %= 2;
        if(arr[i] == 1){
            char temp = s[i];
            s[i] = s[s.length() - (i) - 1];
            s[s.length() - (i) - 1] = temp;

        }
    }
    cout << s<< endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){

	string s;
	int m;
	cin >> s;
	cin >> m;

	while(m--){

		int x;
		cin >> x;
		int i = x-1, j = s.length() - x;
		while(i < j){
			swap(s[i],s[j]);
			i++;
			j--;
		}

	}
	cout<<s;
}


#include<bits/stdc++.h>
using namespace std;
int main(){

	string s;
	int m;
	cin >> s;
	cin >> m;

	int x[m];
	memset(x,0,sizeof(x));
	for(int i = 0; i < m; i++){
		int c;
		cin >> c;
		x[c-1]++;
		x[s.length()-c+1]--;

	}
	int c = 0;
	for(int i = 0; i < s.length(); i++){
		c+=x[i];
		cout << (s[c&1 ? s.length()-i-1:i]);
	}
}