jfen

There is a one-person game to play on the H × W board. This game is a game to move 0 or 1 balls in each cell. You were playing this game and found it difficult to move the ball accurately from cell to cell because the ball is so round. So you decided to make a robot that would move the ball as instructed. Here, the notation (y, x) is used to represent the cell. This represents the cell in the xth column of the yth row.

Instructions to the robot are given by the four integers a, b, c, d. This means moving the ball at (a, b) to (c, d). At this time, it is guaranteed that the ball exists in (a, b) and does not exist in (c, d).

The state of the board is expressed by the following notation called "jfen".


[Data in the first line] / [Data in the second line] /.../ [Data in the H line]

This notation is a slash-separated concatenation of data representing each line on the board. The data in each row is represented by a character string, and the state of the cells in the 1st to Wth columns is described in order from the left. This string is represented by a number and the letter'b', where the integer represented by the number represents the number of consecutive blank cells and'b' represents the cell in which the ball resides. Here, integers must not be consecutive in the data of each row. Also, the sum of the integers written in the data of each line and the sum of the number of'b'are always W.

As an example, consider the following board surface condition. A blank cell is represented by a'.', And a cell in which the ball exists is represented by a'b'. The j character from the left of the i-th row in this example represents the state of the cell in the j-th column of the i-th row on the board.


....
.b.b
....


The above board is expressed in jfen as follows.


4 / 1b1b / 4

Create a program that outputs the board surface after the robot moves the ball when the robot is given the current board surface state and a command to move one ball. At this time, output the board surface in jfen notation.

Input

The input consists of multiple datasets. Each dataset has the following format.

> S
> a b c d

Each dataset consists of two lines, and the first line is given the jfen-formatted string S, which represents the state of the board. Here, the size of the board satisfies 2 ≤ W and H ≤ 9. Instructions to the robot are given to the following lines. This represents an instruction to move the ball at (a, b) to (c, d). The end of the input is represented by #.

Output

The output is one line of character string that expresses the state of the board after executing the instruction for each data set in jfen notation. There must be no other characters on the output line.

Sample Input


b1 / 1b
1 1 1 2
b5 / bbbbbb
2 4 1 4
b2b2b / 7
1 4 2 4


Output for Sample Input


1b / 1b
b2b2 / bbb1bb
b5b / 3b3


The initial state of the first input is as follows.


b.
.b


Since the ball of (1,1) is moved to (1,2), the board surface after the command is as follows.


.b
.b






Example

Input

b1/1b
1 1 1 2
b5/bbbbbb
2 4 1 4
b2b2b/7
1 4 2 4
#


Output

1b/1b
b2b2/bbb1bb
b5b/3b3

Source: aizu | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
while True:
	s = input()
	if s == '#':
		break
	s = s.split('/')
	area = [0] * len(s)
	for i in range(len(s)):
		t = []
		while True:
			if s[i][0] == 'b':
				t.append(1)
				s[i] = s[i][1:]
			elif 'b' in s[i]:
				t += [0] * int(s[i][:s[i].index('b')])
				s[i] = s[i][s[i].index('b'):]
			else:
				t += [0] * int(s[i])
				break
			if s[i] == '':
				break
		area[i] = t
	(a, b, c, d) = map(int, input().split())
	area[a - 1][b - 1] = 0
	area[c - 1][d - 1] = 1
	t = ''
	for i in range(len(area)):
		j = 0
		while True:
			if area[i][j] == 1:
				t += 'b'
				j += 1
			else:
				k = 0
				while j < len(area[i]) and area[i][j] == 0:
					k += 1
					j += 1
				t += str(k)
			if j == len(area[i]):
				break
		if i < len(area) - 1:
			t += '/'
	print(t)


while 1:
	S = input()
	if S == '#':
		break
	S = S.split('/')
	board = []
	for S_row in S:
		row = []
		for s in S_row:
			if s == 'b':
				row.append('b')
			else:
				for _ in range(int(s)):
					row.append('.')
		board.append(row)
	(a, b, c, d) = map(int, input().split())
	(board[a - 1][b - 1], board[c - 1][d - 1]) = (board[c - 1][d - 1], board[a - 1][b - 1])
	ans = ''
	for b_row in board:
		cnt = 0
		for b in b_row:
			if b == '.':
				cnt += 1
			else:
				if cnt != 0:
					ans += str(cnt)
					cnt = 0
				ans += 'b'
		if cnt != 0:
			ans += str(cnt)
		ans += '/'
	print(ans[:-1])


while True:
	s = input()
	if s == '#':
		break
	(a, b, c, d) = map(lambda x: int(x) - 1, input().split())
	cell = []
	for (i, x) in enumerate(s.split('/')):
		cell.append([])
		for ch in x:
			if ch == 'b':
				cell[i].append('b')
			else:
				cell[i] += list('.' * int(ch))
	cell[a][b] = '.'
	cell[c][d] = 'b'
	ans = []
	for i in range(len(cell)):
		jfen = ''
		cnt = 0
		for j in range(len(cell[i])):
			if cell[i][j] == 'b':
				if cnt > 0:
					jfen += str(cnt)
				cnt = 0
				jfen += 'b'
			else:
				cnt += 1
		if cnt > 0:
			jfen += str(cnt)
		ans.append(jfen)
	print('/'.join(ans))


while True:
	s = input()
	if s == '#':
		break
	else:
		(a, b, c, d) = map(int, input().split())
		s_list = s.split('/')
		a_str = ''
		if a == c:
			for i in s_list[a - 1]:
				if i == 'b':
					a_str += 'b'
				else:
					a_str += '.' * int(i)
			a_tmp = a_str[min(b, d) - 1]
			c_tmp = a_str[max(b, d) - 1]
			a_rep = a_str[:min(b, d) - 1] + c_tmp + a_str[min(b, d):max(b, d) - 1] + a_tmp + a_str[max(b, d):]
			a_s = ''
			count = 0
			flag = 0
			for i in a_rep:
				if i == '.':
					flag = 1
					count += 1
				elif flag == 1:
					a_s += str(count)
					a_s += str('b')
					flag = 0
					count = 0
				else:
					a_s += str('b')
					flag = 0
					count = 0
			if flag == 1:
				a_s += str(count)
				flag = 0
			s_list[a - 1] = a_s
		else:
			for i in s_list[a - 1]:
				if i == 'b':
					a_str += 'b'
				else:
					a_str += '.' * int(i)
			a_tmp = a_str[b - 1]
			c_str = ''
			for i in s_list[c - 1]:
				if i == 'b':
					c_str += 'b'
				else:
					c_str += '.' * int(i)
			c_tmp = c_str[d - 1]
			a_rep = a_str[:b - 1] + c_tmp + a_str[b:]
			c_rep = c_str[:d - 1] + a_tmp + c_str[d:]
			flag = 0
			count = 0
			a_s = ''
			for i in a_rep:
				if i == '.':
					flag = 1
					count += 1
				elif flag == 1:
					a_s += str(count)
					a_s += str('b')
					flag = 0
					count = 0
				else:
					a_s += str('b')
					flag = 0
					count = 0
			if flag == 1:
				a_s += str(count)
				flag = 0
			count = 0
			c_s = ''
			for i in c_rep:
				if i == '.':
					flag = 1
					count += 1
				elif flag == 1:
					c_s += str(count)
					c_s += str('b')
					flag = 0
					count = 0
				else:
					c_s += str('b')
					flag = 0
					count = 0
			if flag == 1:
				c_s += str(count)
			s_list[a - 1] = a_s
			s_list[c - 1] = c_s
		out = ''
		for i in range(len(s_list)):
			out += s_list[i]
			if i < len(s_list) - 1:
				out += '/'
		print(out)


import copy
while 1:
	S = input()
	if S == '#':
		break
	(a, b, c, d) = map(lambda x: int(x) - 1, input().split())
	F = list(S.split('/'))
	if a != c:
		f1 = list(F[a])
		f2 = list(F[c])
		F[a] = []
		for x in f1:
			if x == 'b':
				F[a].append('b')
			else:
				F[a] += [0] * int(x)
		F[c] = []
		for x in f2:
			if x == 'b':
				F[c].append('b')
			else:
				F[c] += [0] * int(x)
		F[a][b] = 0
		F[c][d] = 'b'
		l = 0
		y = ''
		for x in F[a]:
			if x == 'b':
				if l > 0:
					y += str(l)
					l = 0
				y += 'b'
			else:
				l += 1
		if l > 0:
			y += str(l)
		F[a] = y
		l = 0
		y = ''
		for x in F[c]:
			if x == 'b':
				if l > 0:
					y += str(l)
					l = 0
				y += 'b'
			else:
				l += 1
		if l > 0:
			y += str(l)
		F[c] = y
		print(*F, sep='/')
	else:
		f1 = list(F[a])
		F[a] = []
		for x in f1:
			if x == 'b':
				F[a].append('b')
			else:
				F[a] += [0] * int(x)
		F[a][b] = 0
		F[c][d] = 'b'
		l = 0
		y = ''
		for x in F[a]:
			if x == 'b':
				if l > 0:
					y += str(l)
					l = 0
				y += 'b'
			else:
				l += 1
		if l > 0:
			y += str(l)
		F[a] = y
		print(*F, sep='/')


while 1:
	s = input()
	if '#' in s:
		break
	p = 0
	e = [[] * 2 for _ in range(10)]
	for x in s:
		if x == 'b':
			e[p] += ['b']
		elif x == '/':
			p += 1
		else:
			e[p] += '.' * int(x)
	ans = ''
	(a, b, c, d) = map(int, input().split())
	(e[a - 1][b - 1], e[c - 1][d - 1]) = (e[c - 1][d - 1], e[a - 1][b - 1])
	for i in range(p + 1):
		if i:
			ans += '/'
		a = 0
		for j in e[i]:
			if j == 'b':
				if a:
					ans += str(a)
				ans += 'b'
				a = 0
			else:
				a += 1
		if a:
			ans += str(a)
	print(ans)


now = input()
while now != '#':
	order_raw = input()
	order = [int(s) - 1 for s in order_raw.split(' ')]
	box = [[]]
	for n in now:
		if n == '/':
			box.append([])
		elif n == 'b':
			box[-1].append('b')
		else:
			for _ in range(int(n)):
				box[-1].append('.')
	box[order[0]][order[1]] = '.'
	box[order[2]][order[3]] = 'b'
	res = ''
	index = 0
	for bo in box:
		for b in bo:
			if b == 'b':
				if index > 0:
					res += str(index)
					index = 0
				res += 'b'
			else:
				index += 1
		if index > 0:
			res += str(index)
			index = 0
		res += '/'
	print(res[:-1])
	now = input()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 998244353
dd = [(0, -1), (1, 0), (0, 1), (-1, 0)]
ddn = [(0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, -1), (-1, 0), (-1, 1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	rr = []
	st = string.digits + string.ascii_uppercase

	def decode(s):
		t = s.split('/')
		a = []
		for c in t:
			b = []
			for k in c:
				if k == 'b':
					b.append(1)
				else:
					for _ in range(int(k)):
						b.append(0)
			a.append(b)
		return a

	def encode(a):
		t = []
		for c in a:
			k = ''
			tc = 0
			for b in c:
				if b == 0:
					tc += 1
				else:
					if tc > 0:
						k += str(tc)
						tc = 0
					k += 'b'
			if tc > 0:
				k += str(tc)
			t.append(k)
		return '/'.join(t)
	while True:
		s = S()
		if s == '#':
			break
		(a, b, c, d) = LI()
		t = decode(s)
		t[a - 1][b - 1] = 0
		t[c - 1][d - 1] = 1
		rr.append(encode(t))
	return '\n'.join(map(str, rr))
print(main())


def j2b(S):
	rows = S.split('/')
	for (i, row) in enumerate(rows):
		cand = []
		for s in row:
			if s == 'b':
				cand.append(s)
			else:
				cand.extend(['.'] * int(s))
		rows[i] = cand
	return rows

def b2j(rows):
	ret = []
	for row in rows:
		r = []
		c = 0
		for s in row:
			if s == 'b':
				if c:
					r.append(str(c))
				r.append(s)
				c = 0
			else:
				c += 1
		if c:
			r.append(str(c))
		ret.append(''.join(r))
	return '/'.join(ret)
while True:
	S = input()
	if S == '#':
		break
	rows = j2b(S)
	(a, b, c, d) = [int(x) - 1 for x in input().split()]
	(rows[a][b], rows[c][d]) = (rows[c][d], rows[a][b])
	print(b2j(rows))


def main():
	S = input().split('/')
	if S[0] == '#':
		return
	for s in range(len(S)):
		for i in range(10):
			S[s] = S[s].replace(str(i), '.' * i)
	(a, b, c, d) = map(int, input().split())
	S[a - 1] = S[a - 1][:b - 1] + '.' + S[a - 1][b:]
	S[c - 1] = S[c - 1][:d - 1] + 'b' + S[c - 1][d:]
	for s in range(len(S)):
		ref = ''
		temp = 0
		for i in S[s]:
			if i == '.':
				temp += 1
			else:
				ref += (str(temp) if temp is not 0 else '') + 'b'
				temp = 0
		S[s] = ref + (str(temp) if temp is not 0 else '')
	print('/'.join(S))
	main()
	return
main()


while True:
	S = input()
	if S == '#':
		exit()
	B = []
	W = 0
	for c in S:
		if c == 'b':
			B.append(1)
		elif c != '/':
			B.extend([0] * int(c))
		elif W == 0:
			W = len(B)
	assert len(B) % W == 0
	H = len(B) // W
	(a, b, c, d) = map(lambda x: int(x) - 1, input().split())
	B[a * W + b] = 0
	B[c * W + d] = 1
	ans = ''
	cnt = 0
	for y in range(H):
		for x in range(W):
			if B[y * W + x] == 0:
				cnt += 1
			else:
				if cnt > 0:
					ans += str(cnt)
				cnt = 0
				ans += 'b'
		if cnt > 0:
			ans += str(cnt)
		cnt = 0
		ans += '/'
	print(ans[:-1])


while True:
	s = input()
	if s == '#':
		break
	rows = s.split('/')
	(a, b, c, d) = map(int, input().split())
	a -= 1
	b -= 1
	c -= 1
	d -= 1
	grid = ['' for _ in rows]
	for (i, row) in enumerate(rows):
		for kk in row:
			if kk == 'b':
				grid[i] += 'b'
			else:
				grid[i] += '.' * int(kk)
	grid[a] = grid[a][:b] + '.' + grid[a][b + 1:]
	grid[c] = grid[c][:d] + 'b' + grid[c][d + 1:]
	ans = []
	for row in grid:
		s = ''
		tmp = 0
		for kk in row:
			if kk == 'b':
				if tmp != 0:
					s += str(tmp)
					tmp = 0
				s += 'b'
			else:
				tmp += 1
		if tmp != 0:
			s += str(tmp)
			tmp = 0
		ans.append(s)
	print('/'.join(ans))


while 1:
	s = input()
	if s == '#':
		break
	M = []
	for l in s.split('/'):
		num = 0
		tmp = []
		for c in l:
			if c == 'b':
				if num > 0:
					tmp.extend([0] * num)
				tmp.append(1)
				num = 0
			else:
				num = 10 * num + int(c)
		if num > 0:
			tmp.extend([0] * num)
		M.append(tmp)
	(a, b, c, d) = map(int, input().split())
	assert M[a - 1][b - 1] == 1
	M[a - 1][b - 1] = 0
	assert M[c - 1][d - 1] == 0
	M[c - 1][d - 1] = 1
	ans = []
	for l in M:
		tmp = ''
		cnt = 0
		for c in l:
			if c:
				if cnt > 0:
					tmp += str(cnt)
				cnt = 0
				tmp += 'b'
			else:
				cnt += 1
		if cnt > 0:
			tmp += str(cnt)
		ans.append(tmp)
	print('/'.join(ans))


while True:
	S = input()
	if S == '#':
		break
	(a, b, c, d) = map(int, input().split())
	hasBall = [[False for _ in range(10)] for _ in range(10)]
	rows = S.split('/')
	H = len(rows)
	for (h, row) in enumerate(rows, start=1):
		cur = 1
		colsize = 0
		for ch in row:
			if ch == 'b':
				hasBall[h][cur] = True
				colsize += 1
				cur += 1
			else:
				colsize += int(ch)
				cur += int(ch)
		W = colsize
	hasBall[a][b] = False
	hasBall[c][d] = True
	rows = []
	for h in range(1, H + 1):
		streak = 0
		row = ''
		for w in range(1, W + 1):
			if hasBall[h][w]:
				if streak:
					row += str(streak)
					streak = 0
				row += 'b'
			else:
				streak += 1
		if streak:
			row += str(streak)
		rows.append(row)
	print('/'.join(rows))


while 1:
	s = input()
	if s == '#':
		break
	s = s.split('/')
	field = [list(''.join(['b' if c == 'b' else '.' * int(c) for c in s[i]])) for i in range(len(s))]
	(a, b, c, d) = map(int, input().split())
	(field[a - 1][b - 1], field[c - 1][d - 1]) = ('.', 'b')
	print('/'.join(['b'.join(('' if len(c) == 0 else str(len(c)) for c in ''.join(field[i]).split('b'))) for i in range(len(field))]))


while True:
	st = list(input().split('/'))
	if st == ['#']:
		break
	(a, b, c, d) = map(int, input().split())
	s = []
	for i in range(len(st)):
		str = []
		for ele in st[i]:
			if ele == 'b':
				str.append('b')
			else:
				for _ in range(int(ele)):
					str.append('.')
		s.append(str)
	s[a - 1][b - 1] = '.'
	s[c - 1][d - 1] = 'b'
	ans = []
	for i in range(len(s)):
		sr = ''
		c = 0
		for j in range(len(s[i])):
			if s[i][j] == 'b':
				if c != 0:
					sr += '{}'.format(c)
				sr += 'b'
				c = 0
			elif s[i][j] == '.':
				c += 1
		if c != 0:
			sr += '{}'.format(c)
		ans.append(sr)
	ass = '/'.join(ans)
	print(ass[:])


while True:
	Y = input().split('/')
	if Y[0] == '#':
		break
	L = [[False for i in range(9)] for i in range(9)]
	MX = 1
	MY = len(Y)
	for i in range(len(Y)):
		p = 0
		for str_ in Y[i]:
			if str_ == 'b':
				L[i][p] = True
				p += 1
			else:
				p += int(str_)
			MX = max(MX, p)
	(y1, x1, y2, x2) = map(int, input().split(' '))
	L[y1 - 1][x1 - 1] = False
	L[y2 - 1][x2 - 1] = True
	ans = ''
	f = False
	for y in range(MY):
		ans_ = ''
		cnt = 0
		for x in range(MX):
			if L[y][x]:
				if cnt > 0:
					ans_ += str(cnt)
				ans_ += 'b'
				cnt = 0
			else:
				cnt += 1
		if cnt > 0:
			ans_ += str(cnt)
		if y != MY - 1:
			ans_ += '/'
		ans += ans_
	print(ans)


def decode(s):
	ret = []
	for line in s.split('/'):
		a = ''
		for c in line:
			if c == 'b':
				a += 'b'
			else:
				a += '.' * (ord(c) - ord('0'))
		ret.append(list(a))
	return ret

def encode(s):
	ret = []
	for line in s:
		x = ''.join(line)
		x = x.split('b')
		a = ''
		for i in range(len(x) - 1):
			if len(x[i]) > 0:
				a += str(len(x[i]))
			a += 'b'
		if len(x[len(x) - 1]) > 0:
			a += str(len(x[len(x) - 1]))
		ret.append(a)
	return '/'.join(ret)

def main():
	while True:
		s = input()
		if s == '#':
			break
		(a, b, c, d) = map(int, input().split())
		f = decode(s)
		f[a - 1][b - 1] = '.'
		f[c - 1][d - 1] = 'b'
		print(encode(f))
main()


def parse_line(line):
	ret = []
	for c in line:
		if c == 'b':
			ret.append('b')
		else:
			for _ in range(int(c)):
				ret.append('.')
	return ret

def parse_jfen(s):
	return list(map(parse_line, s.split('/')))

def to_jfen(mp):
	ret = ''
	cnt = 0
	for line in mp:
		cnt = 0
		for c in line:
			if c == 'b':
				if cnt != 0:
					ret += str(cnt)
					cnt = 0
				ret += 'b'
			else:
				cnt += 1
		if cnt != 0:
			ret += str(cnt)
		ret += '/'
	return ret[:-1]
while True:
	s = input()
	if s == '#':
		break
	mp = parse_jfen(s)
	(a, b, c, d) = map(int, input().split())
	mp[a - 1][b - 1] = '.'
	mp[c - 1][d - 1] = 'b'
	print(to_jfen(mp))


while True:
	s = input()
	if s == '#':
		break
	(a, b, c, d) = map(lambda x: int(x) - 1, input().split())
	tb = []
	for (i, x) in enumerate(s.split('/')):
		tb.append([])
		for ch in x:
			if ch == 'b':
				tb[i].append('b')
			else:
				tb[i] += list('.' * int(ch))
	tb[a][b] = '.'
	tb[c][d] = 'b'
	ans = []
	for i in range(len(tb)):
		tmp = ''
		cnt = 0
		for j in range(len(tb[i])):
			if tb[i][j] == 'b':
				if cnt > 0:
					tmp += str(cnt)
				cnt = 0
				tmp += 'b'
			else:
				cnt += 1
		if cnt > 0:
			tmp += str(cnt)
		ans.append(tmp)
	print('/'.join(ans))