User ainta is making a web site. This time he is going to make a navigation of the pages. In his site, there are n pages numbered by integers from 1 to n. Assume that somebody is on the p-th page now. The navigation will look like this: << p - k p - k + 1 ... p - 1 (p) p + 1 ... p + k - 1 p + k >> 

When someone clicks the button "<<" he is redirected to page 1, and when someone clicks the button ">>" he is redirected to page n. Of course if someone clicks on a number, he is redirected to the corresponding page.

There are some conditions in the navigation:  If page 1 is in the navigation, the button "<<" must not be printed.  If page n is in the navigation, the button ">>" must not be printed.  If the page number is smaller than 1 or greater than n, it must not be printed.   

You can see some examples of the navigations. Make a program that prints the navigation.


-----Input-----

The first and the only line contains three integers n, p, k (3 ≤ n ≤ 100; 1 ≤ p ≤ n; 1 ≤ k ≤ n)


-----Output-----

Print the proper navigation. Follow the format of the output from the test samples.


-----Examples-----
Input
17 5 2

Output
<< 3 4 (5) 6 7 >> 
Input
6 5 2

Output
<< 3 4 (5) 6 
Input
6 1 2

Output
(1) 2 3 >> 
Input
6 2 2

Output
1 (2) 3 4 >>
Input
9 6 3

Output
<< 3 4 5 (6) 7 8 9
Input
10 6 3

Output
<< 3 4 5 (6) 7 8 9 >>
Input
8 5 4

Output
1 2 3 4 (5) 6 7 8

Difficulty: MEDIUM
Tags: Implementation

Starter code:

Solutions:
a = list(map(int, input().split()))
(pages, current, wide) = (a[0], a[1], a[2])
mid = '(' + str(current) + ')'
(start, end) = (current - wide, current + wide)
(prefix, suffix) = ('', '')
if start < 2:
	prefix = ' '.join([str(i) for i in range(1, current)]).rstrip()
else:
	prefix = ('<< ' + ' '.join([str(i) for i in range(start, current)])).rstrip()
if end >= pages:
	suffix = ' '.join([str(i) for i in range(current + 1, pages + 1)]).rstrip()
else:
	suffix = (' '.join([str(i) for i in range(current + 1, end + 1)]) + ' >>').rstrip()
if prefix == '' and suffix == '':
	print(mid)
elif prefix == '':
	print(mid, suffix)
elif suffix == '':
	print(prefix, mid)
else:
	print(prefix, mid, suffix)


inputs = input().split(' ')
(ran, base, limit) = (int(inputs[0]), int(inputs[1]), int(inputs[2]))
if base - limit > 0:
	start = base - limit
else:
	start = 1
if base + limit > ran:
	finish = ran + 1
else:
	finish = base + limit + 1
output = ''
if start is not 1:
	output += '<< '
for i in range(start, finish):
	if i == base:
		output += '(' + str(base) + ') '
	else:
		output += str(i) + ' '
if ran > finish - 1:
	output += '>>'
print(output)


(pages, current, k) = [int(x) for x in input().split(' ')]
string = ''
if current - k > 1:
	string += '<< '
for extra in range(current - k, current):
	if extra >= 1:
		string += str(extra) + ' '
string += '(' + str(current) + ') '
for extra in range(current + 1, current + (k + 1)):
	if extra <= pages:
		string += str(extra) + ' '
if current + k < pages:
	string += '>>'
print(string)


def pn(s):
	print(s, end='')

def main():
	(n, p, k) = map(int, input().split())
	if p - k < 1:
		r = range(1, p)
	else:
		r = range(p - k, p)
	if p - k - 1 >= 1:
		pn('<< ')
	for i in r:
		pn(str(i) + ' ')
	pn('(' + str(p) + ')')
	if p + k > n:
		r = range(p + 1, n + 1)
	else:
		r = range(p + 1, p + k + 1)
	for i in r:
		pn(' ' + str(i))
	if p + k + 1 <= n:
		pn(' >>')
	pn('\n')
main()


(n, p, k) = [int(i) for i in input().split()]
s = []
if p - k > 1:
	b = p - k
else:
	b = 1
if b != 1:
	s.append('<<')
if p + k < n:
	e = p + k
else:
	e = n
for i in range(b, e + 1):
	if i == p:
		s.append('(' + str(p) + ')')
	else:
		s.append(i)
if p + k < n:
	s.append('>>')
print(' '.join([str(i) for i in s]))


entrada = list(map(int, input().split()))
enumeracion = entrada[0]
posicion = entrada[1]
pag_de_lado = -entrada[2]
pag_lado = pag_de_lado - 1
cadena = ''
for i in range(entrada[2] * 2 + 1):
	pag_lado += 1
	if posicion + pag_lado <= 0 or posicion + pag_lado > enumeracion:
		continue
	cadena += str(posicion + pag_lado) + ' '
cadena = cadena.split()
for h in range(len(cadena)):
	if cadena[h] != '1' and h == 0:
		print('<<', end=' ')
	if cadena[h] == str(posicion):
		print('(' + cadena[h] + ')', end=' ')
	elif cadena[h] == '1' and h == 0:
		print(cadena[h], end=' ')
	elif cadena[h] == str(enumeracion):
		print(cadena[h], end='')
	else:
		print(cadena[h], end=' ')
	if str(enumeracion) != cadena[h] and h == max(range(len(cadena))):
		print('>>', end='')


(n, p, k) = map(int, input().split())
pages = [str(i) for i in range(1, n + 1)]
left = 0
if p - k - 1 >= 0:
	left = p - k - 1
elif k > p:
	left = 0
else:
	left = p - k
res = [' '.join(pages[left:p - 1]), '(' + str(p) + ')', ' '.join(pages[p:p + k])]
if p - k - 1 > 0:
	res.insert(0, '<<')
if p + k < n:
	res.append('>>')
print(' '.join(res).strip())


(n, p, k) = map(int, input().split())
if p - k > 1:
	print('<<', end=' ')
for i in range(p - k, p):
	if i > 0:
		print(i, end=' ')
print('({})'.format(p), end=' ')
for i in range(p + 1, p + k + 1):
	if i <= n:
		print(i, end=' ')
if p + k < n:
	print('>>', end=' ')


def read_int():
	return int(input().strip())

def read_int_list():
	return list(map(int, input().strip().split()))

def read_string():
	return input().strip()

def read_string_list(delim=' '):
	return input().strip().split(delim)
[n, p, k] = read_int_list()
out = ''
if p - k > 1:
	out += '<< '
for i in range(p - k, p + k + 1):
	if i < 1 or i > n:
		continue
	if i == p:
		out += '(' + str(p) + ') '
	else:
		out += str(i) + ' '
if p + k < n:
	out += '>>'
print(out)


def create_navigation(n, p, k):
	res = [str(x) for x in range(p - k, p + k + 1, 1) if x <= n and x >= 1]
	if res[-1] != str(n):
		res.append('>>')
	if res[0] != '1':
		res[res.index(str(p))] = '(' + str(p) + ')'
		return '<< ' + ' '.join(res)
	else:
		res[res.index(str(p))] = '(' + str(p) + ')'
		return ' '.join(res)
(n, p, k) = input().split()
print(create_navigation(int(n), int(p), int(k)))


(n, p, k) = map(int, input().split())
if p - k > 1:
	print('<<', end=' ')
for i in range(max(1, p - k), p):
	print(i, end=' ')
print('(', end='')
print(p, end='')
print(')', end=' ')
for i in range(p + 1, min(n, p + k) + 1):
	print(i, end=' ')
if p + k < n:
	print('>>', end=' ')


(n, p, k) = map(int, input().split(' '))
s = '({})'.format(str(p))
for i in range(1, k + 1):
	if p - i > 0:
		s = str(p - i) + ' ' + s
	if p + i <= n:
		s += ' ' + str(p + i)
if s[0] != '(' and int(s.split(' ')[0]) > 1:
	s = '<< ' + s
if s[-1] != ')' and int(s.split(' ')[-1]) < n:
	s += ' >>'
print(s)


(n, p, k) = list(map(int, input().split()))
li = []
if p - k > 1:
	li += ['<<']
for i in range(max(1, p - k), min(p + k, n) + 1):
	li += ['(' * int(i == p) + str(i) + ')' * int(i == p)]
li += ['>>' * int(p + k < n)]
print(*li)


_ = input().strip().split(' ')
n = int(_[0])
p = int(_[1])
k = int(_[2])
cnt = p - k
if cnt < 1:
	cnt = 1
if cnt != 1:
	print('<< ', end='')
while cnt <= n and cnt <= p + k:
	if cnt == p:
		print('(%d) ' % cnt, end='')
	else:
		print(cnt, end=' ')
	cnt += 1
if cnt - 1 != n:
	print('>>')


(n, p, k) = map(int, input().split())
ans = ' ({}) '.format(p)
x = ''
for i in range(max(p - k, 1), p):
	x += ' {}'.format(i)
ans = x + ans
for i in range(p + 1, min(n + 1, p + k + 1)):
	ans += '{} '.format(i)
if p + k < n:
	ans += '>>'
if p - k > 1:
	ans = '<<' + ans
print(ans)


(a, b, k) = map(int, input().split(' '))
flag1 = True
flag2 = True
if b - k > 1:
	print('<<', end=' ')
for i in range(b - k, b + k + 1):
	if i > a:
		break
	if i > 0:
		if i == b:
			print('(' + str(i) + ')', end=' ')
		else:
			print(i, end=' ')
if b + k < a:
	print('>>')


string = input().split()
n = int(string[0])
p = int(string[1])
k = int(string[2])
if p - k > 1:
	print('<<', end=' ')
for i in range(k, 0, -1):
	if p - i > 0:
		print(p - i, end=' ')
print('(' + str(p) + ')', end=' ')
for i in range(1, k + 1):
	if p + i <= n:
		print(p + i, end=' ')
if p + k < n:
	print('>>', end=' ')


(n, p, k) = input().split(' ')
(n, p, k) = (int(n), int(p), int(k))
pages = []
for i in range(p - k, p + k + 1):
	if i > 0 and i <= n:
		pages.append(i)
string = ''
if pages[0] != 1:
	string += '<< '
for i in pages:
	if i == p:
		string += '({0}) '.format(i)
	else:
		string += '{0} '.format(i)
if pages[-1] != n:
	string += '>>'
print(string)


(n, p, k) = list(map(int, input().split()))
l = []
i = 0
e = 0
while i <= k * 2 and e < n:
	e = p - k + i
	if e > 0:
		l.append(e)
	i = i + 1
if l[0] > 1:
	print('<<', end=' ')
for i in l:
	if i == p:
		i = '(' + str(i) + ')'
	print(i, end=' ')
if l[len(l) - 1] < n:
	print('>>')


(n, p, k) = [int(x) for x in input().split()]
res = str()
if p - k > 1:
	res += '<< '
for i in range(p - k, p):
	if i > 0:
		res += str(i) + ' '
res += '(' + str(p) + ')' + ' '
for i in range(p + 1, p + k + 1):
	if i <= n:
		res += str(i) + ' '
if p + k < n:
	res += '>>'
else:
	res = res[:-1]
print(res)


(n, p, k) = map(int, input().split())
a = '(' + str(p) + ')'
i = p + 1
while i <= p + k and i <= n:
	a += ' ' + str(i)
	i += 1
if i - 1 != n:
	a += ' >>'
i = p - 1
while p - k <= i and 1 <= i:
	a = str(i) + ' ' + a
	i -= 1
if i + 1 != 1:
	a = '<< ' + a
print(a)


s = input()
a = list(map(int, s.split()))
if a[1] + a[2] > a[0]:
	if a[1] - a[2] <= 1:
		for i in range(1, a[0] + 1):
			if i == a[1] and i != a[1] + a[2] + 1:
				print('(' + str(i) + ')', end=' ')
			elif i == a[1] + a[2] + 1:
				continue
			else:
				print(i, end=' ')
	else:
		print('<<', end=' ')
		for i in range(a[1] - a[2], a[0] + 1):
			if i == a[1] and i != a[1] + a[2] + 1:
				print('(' + str(i) + ')', end=' ')
			else:
				print(i, end=' ')
elif a[1] + a[2] == a[0]:
	if a[1] - a[2] <= 1:
		for i in range(1, a[1] + a[2] + 1):
			if i == a[1] and i != a[1] + a[2] + 1:
				print('(' + str(i) + ')', end=' ')
			elif i == a[1] + a[2] + 1:
				continue
			else:
				print(i, end=' ')
	else:
		print('<<', end=' ')
		for i in range(a[1] - a[2], a[1] + a[2] + 1):
			if i == a[1] and i != a[1] + a[2] + 1:
				print('(' + str(i) + ')', end=' ')
			else:
				print(i, end=' ')
elif a[1] - a[2] <= 1:
	for i in range(1, a[1] + a[2] + 1):
		if i == a[1] and i != a[1] + a[2] + 1:
			print('(' + str(i) + ')', end=' ')
		elif i == a[1] + a[2] + 1:
			continue
		else:
			print(i, end=' ')
	print('>>', end=' ')
else:
	print('<<', end=' ')
	for i in range(a[1] - a[2], a[1] + a[2] + 1):
		if i == a[1] and i != a[1] + a[2] + 1:
			print('(' + str(i) + ')', end=' ')
		else:
			print(i, end=' ')
	print('>>', end=' ')


def pages():
	num = input()
	n = int(num.split(' ')[0])
	p = int(num.split(' ')[1])
	k = int(num.split(' ')[2])
	pk1 = p - k
	pk2 = p + k
	if pk1 < 1:
		pk1 = 1
	if pk1 != 1:
		print('<<', end=' ')
	for i in range(pk1, p + k + 1):
		if i == p:
			print('(%i)' % i, end=' ')
		elif i <= p + k and i <= n:
			print('%i' % i, end=' ')
	if p + k < n:
		print('>>', end='')
pages()


inp = input().split()
totalpageno = int(inp[0])
pageno = int(inp[1])
showpagelst = int(inp[2])
lst = pageno - showpagelst
showlst = pageno + showpagelst
if lst > 1:
	print('<<', end=' ')
for i in range(lst, pageno + 1):
	if i > 0:
		if i == pageno:
			print(f'({i})', end=' ')
		else:
			print(i, end=' ')
for i in range(pageno + 1, showlst + 1):
	if i <= totalpageno:
		print(i, end=' ')
if showlst < totalpageno:
	print('>>')


s = list(map(int, input().split(' ')))
ar = []
if s[1] - s[2] > 1:
	ar.append('<<')
	for i in range(0, s[2]):
		ar.append(s[1] - s[2] + i)
	ar.append('({})'.format(s[1]))
	if s[0] - s[1] > s[2]:
		for i in range(0, s[2]):
			ar.append(s[1] + i + 1)
		ar.append('>>')
	else:
		for i in range(0, s[0] - s[1]):
			ar.append(s[1] + i + 1)
elif s[1] - s[2] == 1:
	for i in range(0, s[2]):
		ar.append(s[1] - s[2] + i)
	ar.append('({})'.format(s[1]))
	if s[0] - s[1] > s[2]:
		for i in range(0, s[2]):
			ar.append(s[1] + i + 1)
		ar.append('>>')
	else:
		for i in range(0, s[0] - s[1]):
			ar.append(s[1] + i + 1)
else:
	for i in range(0, s[2]):
		if s[1] - s[2] + i > 0:
			ar.append(s[1] - s[2] + i)
	ar.append('({})'.format(s[1]))
	if s[0] - s[1] > s[2]:
		for i in range(0, s[2]):
			ar.append(s[1] + i + 1)
		ar.append('>>')
	else:
		for i in range(0, s[0] - s[1]):
			ar.append(s[1] + i + 1)
print(*ar, sep=' ')


x = input().split()
n = int(x[0])
p = int(x[1])
k = int(x[2])
max_limit = min(n, p + k)
min_limit = max(1, p - k)
ans = ''
for i in range(min_limit, max_limit + 1):
	ans = ans + ' ' + str(i)
if ans.count(str(p)) == 1:
	ans = ans.replace(str(p), '(' + str(p) + ')')
else:
	temp = ans[:98]
	temp2 = ans[98:]
	temp = temp.replace(str(p), '(' + str(p) + ')')
	ans = temp + temp2
if int(min_limit) != 1:
	ans = '<<' + ans
if int(max_limit) != n:
	ans = ans + ' ' + '>>'
print(ans.lstrip())


(n, p, k) = map(int, input().split())
st = ''
left = [p - i for i in range(k, 0, -1)]
l = [j for j in left if j > 0]
if len(l) != 0 and p != 1 and (l[0] != 1):
	st = '<<'
	st += ' '
right = [p + i for i in range(1, k + 1)]
r = [j for j in right if j <= n]
for i in l:
	st += str(i) + ' '
st += '(' + str(p) + ')' + ' '
for i in r:
	st += str(i) + ' '
if len(r) != 0 and n != r[-1] and (p != n):
	st += '>>'
print(st)


import math, string, itertools, fractions, heapq, collections, re, array, bisect
from itertools import chain, dropwhile, permutations, combinations
from collections import defaultdict

def main(n, p, k):
	x = range(p - k, p + k + 1)
	x = [j for j in x if j >= 1 and j <= n]
	if 1 not in x:
		print('<< ', end='')
	for j in range(max(1, p - k), p):
		print(str(j), end=' ')
	print('(' + str(p) + ') ', end='')
	for j in range(p + 1, min(p + k, n) + 1):
		print(str(j), end=' ')
	if n not in x:
		print('>>')

def main_input(info=0):
	(n, p, k) = map(int, input().split())
	main(n, p, k)

def __starting_point():
	main_input()
__starting_point()


a = input().split()
n = int(a[0])
p = int(a[1])
k = int(a[2])
s = ''
if p - k > 1:
	s = '<<'
for i in reversed(range(1, k + 1)):
	if p - i >= 1:
		s = s + f' {p - i}'
s = s + f' ({p})'
for i in range(1, k + 1):
	if p + i <= n:
		s = s + f' {p + i}'
if n - (p + k) > 0:
	s = s + f' >>'
print(s)


(total_count, current_page, border_value) = [int(_) for _ in input().split()]
pages_to_show = [str(_) for _ in range(current_page - border_value, current_page + border_value + 1)]
pages_to_show = [str(x) for x in pages_to_show if int(x) > 0 and int(x) <= total_count]
for i in range(len(pages_to_show)):
	if pages_to_show[i] == str(current_page):
		pages_to_show[i] = f'({current_page})'
		break
nav_bar = ' '.join(pages_to_show)
if f'{total_count}' in nav_bar and ('1' in nav_bar.split() or '(1)' in nav_bar.split()):
	pass
elif '1' in nav_bar.split() or '(1)' in nav_bar.split():
	nav_bar += ' >>'
elif f'{total_count}' in nav_bar:
	nav_bar = '<< ' + nav_bar
else:
	nav_bar = '<< ' + nav_bar + ' >>'
print(nav_bar)


def main():
	(n, p, k) = map(int, input().split())
	start = 1
	end = 0 + n
	addEnd = False
	(f, e, o) = ('<<', '>>', f'({p})')
	r = []
	if p - k > start:
		start = p - k
		r.append(f)
	if p + k < end:
		end = p + k
		addEnd = True
	for i in range(start, end + 1):
		if i == p:
			r.append(o)
		else:
			r.append(str(i))
	if addEnd:
		r.append(e)
	return ' '.join(r)
print(main())


(n, p, k) = list(map(int, input().split()))
l = ['(' + str(p) + ')']
i = 1
for _ in range(k):
	if p - i > 0:
		l = [p - i] + l
	if p + i <= n:
		l.append(p + i)
	i += 1
if p - k > 1:
	l = ['<<'] + l
if n - p > k:
	l.append('>>')
print(*l)


(n, p, k) = map(int, input().split())
lB = max(1, p - k)
rB = min(n, p + k)
if lB != 1:
	print('<< ', end='')
for i in range(lB, rB + 1):
	if i != p:
		print(i, end=' ')
	else:
		print('(' + str(i) + ') ', end='')
if rB != n:
	print('>>')


(x, y, z) = map(int, input().split())
ok = 1
ko = 1
if 1 >= y - z:
	ok = 0
if x <= y + z:
	ko = 0
if ok == 1:
	print('<<', end=' ')
for i in range(max(1, y - z), min(x, y + z) + 1):
	if i == y:
		print('(', end='')
		print(i, end='')
		print(')', end=' ')
	else:
		print(i, end=' ')
if ko == 1:
	print('>>')


s = input()
l = list(s.split(' '))
n = int(l[0])
p = int(l[1])
k = int(l[2])
j = k
l1 = []
l1.append('<<')
while j:
	if p - j >= 1:
		l1.append(str(p - j))
		j = j - 1
	else:
		j = j - 1
l1.append('(' + str(p) + ')')
for i in range(k):
	if p + (i + 1) <= n:
		l1.append(str(p + (i + 1)))
	else:
		break
l1.append('>>')
if '1' in l1 or '(1)' in l1:
	l1.remove('<<')
if str(n) in l1 or '(' + str(n) + ')' in l1:
	l1.remove('>>')
for i in l1:
	if i != 'n':
		print(i, end=' ')
	else:
		print(i)


inp = input()
x = list(inp.split(' '))
n = int(x[0])
p = int(x[1])
k = int(x[2])
b = 1 if p - k < 1 else p - k
e = n if p + k > n else p + k
if b != 1:
	print('<<', end=' ')
for i in range(b, e + 1):
	if i == p:
		print('(' + str(i) + ')', end=' ')
	else:
		print(i, end=' ')
if e != n:
	print('>>', end='')


(n, p, k) = map(int, input().split())
if p - k <= 1:
	for i in range(1, p):
		print(i, end=' ')
elif p - k > 1:
	print('<<', end=' ')
	for i in range(p - k, p):
		print(i, end=' ')
print('(' + str(p) + ')', end=' ')
if p + k < n:
	for i in range(p + 1, p + k + 1):
		print(i, end=' ')
	print('>>')
else:
	for i in range(p + 1, n + 1):
		print(i, end=' ')


(n, p, k) = map(int, input().split())
l_start = l_end = True
if p - k <= 1:
	start = 1
	l_start = False
else:
	start = p - k
if p + k >= n:
	stop = n + 1
	l_end = False
else:
	stop = p + k + 1
if l_start:
	print('<<', end=' ')
for i in range(start, stop, 1):
	if i == p:
		print('(' + str(i) + ')', end=' ')
	else:
		print(i, end=' ')
if l_end:
	print('>>')


(n, p, k) = map(int, input().split())
s = ''
t = p
start = end = 0
for x in range(p - k, p + k + 1):
	if 1 <= x <= n:
		if x == 1:
			start = 1
		if x == n:
			end = 1
		s += ' ' + ('(%d)' % x if x == p else str(x))
if not start:
	s = '<<' + s
if not end:
	s += ' >>'
print(s.strip())


(n, p, k) = list((int(a) for a in input().split()))
l = max(p - k, 1)
r = min(p + k, n)
if l != 1:
	print('<< ', end='')
while l < p:
	print(l, end=' ')
	l += 1
print('(', p, ')', sep='', end=' ')
l += 1
while l <= r:
	print(l, end=' ')
	l += 1
if r != n:
	print('>>', end='')
print()


def range_of_input(n, p, k):
	if p - k > 1:
		print('<< ', end=' ')
	for i in range(1, n + 1):
		if i in range(p - k, p + k + 1):
			if i == p:
				print('(%d) ' % i, end=' ')
			else:
				print('%d ' % i, end=' ')
	if p + k < n:
		print('>>')
from array import array
arr = array('i', [])
x = [int(x) for x in input().split()]
arr.extend(x)
n = arr[0]
p = arr[1]
k = arr[2]
range_of_input(n, p, k)


(n, p, k) = input().split()
(n, p, k) = (int(n), int(p), int(k))
x = p - k
y = p + k
f = 0
h = 0
if x <= 1:
	x = 1
	f = 1
if y >= n:
	y = n
	h = 1
lst = []
for i in range(x, y + 1):
	if i == p:
		lst.append('(' + str(p) + ')')
	else:
		lst.append(str(i))
if f == 1 and h == 0:
	print(' '.join(lst), '>>')
elif f == 0 and h == 1:
	print('<<', ' '.join(lst))
elif f == 1 and h == 1:
	print(' '.join(lst))
else:
	print('<<', ' '.join(lst), '>>')


(n, p, k) = map(int, input().split())
if p < 1 or p > n:
	print(None)
elif p - k > 1 and p + k < n:
	print('<<', ' '.join(('(%d)' % i if i == int((p - k + (p + k)) / 2) else str(i) for i in range(p - k, p + k + 1))), '>>')
elif p - k <= 1 and p + k >= n:
	print(' '.join(('(%d)' % i if i == int((p - k + (p + k)) / 2) else str(i) for i in range(1, n + 1))))
elif p - k > 1:
	print('<<', ' '.join(('(%d)' % i if i == int((p - k + (p + k)) / 2) else str(i) for i in range(p - k, n + 1))))
elif p + k < n:
	print(' '.join(('(%d)' % i if i == int((p - k + (p + k)) / 2) else str(i) for i in range(1, p + k + 1))), '>>')


(n, p, k) = input().split()
n = int(n)
p = int(p)
k = int(k)
a = ''
if n > p - k > 1:
	l1 = p - k
	a += '<<'
elif p - k <= 1:
	l1 = 1
if p + k < n:
	l2 = p + k + 1
	s = ' >>'
elif p + k >= n:
	l2 = n + 1
	s = ''
for i in range(l1, l2):
	if i == p:
		a += ' (' + str(p) + ')'
	elif i != p:
		a += ' ' + str(i)
a += s
print(a.strip())


def addingSymbols(string, n, val):
	if len(string) != 0:
		if val == 'front':
			if int(string.split(' ')[0]) == 1:
				return string
			elif int(string.split(' ')[0]) < 1:
				return ' '.join([str(i) for i in string.split(' ') if int(i) >= 1])
			else:
				return '<< ' + string
		elif int(string.split(' ')[-1]) == n:
			return string
		elif int(string.split(' ')[-1]) > n:
			return ' '.join([str(i) for i in string.split(' ') if int(i) <= n])
		else:
			return string + ' >>'
	else:
		return string

def navigationPage(n, p, k, val):
	l = []
	if val == 'sub':
		while k != 0:
			if p > 1:
				l.append(p - k)
			else:
				l = []
			k -= 1
	else:
		while k != 0:
			if p <= n:
				l.append(p + k)
			else:
				l = []
			k -= 1
		l.sort()
	return ' '.join([str(i) for i in l])

def calculateReq(n, p, k):
	prev_ = navigationPage(n, p, k, 'sub')
	next_ = navigationPage(n, p, k, 'add')
	prev_ = addingSymbols(prev_, n, 'front')
	next_ = addingSymbols(next_, n, 'back')
	answer = prev_ + ' (' + str(p) + ') ' + next_
	return answer.strip()
(n, p, k) = map(int, input().split(' '))
answer = calculateReq(n, p, k)
print(answer)


list1 = list()
x = input()
(n, p, k) = x.split()
n = int(n)
p = int(p)
k = int(k)
for i in range(n + 1):
	list1.append(i)
if p - k > 1:
	print('<<', end=' ')
for i in range(2 * k + 1):
	if p - k + i == p:
		print('(' + str(p) + ')', end=' ')
	if p - k + i > 0 and p - k + i <= n and (p - k + i != p):
		print(list1[p - k + i], end=' ')
if p + k < n:
	print('>>')


(n, p, k) = map(int, input().split())
a = []
if p > k:
	for i in range(2 * k + 1):
		if p - k + i > n:
			break
		a.append(p - k + i)
elif p <= k:
	for i in range(1, p):
		a.append(i)
	a.append(p)
	for i in range(k):
		if p + i + 1 > n:
			break
		a.append(p + i + 1)
s = ''
if a[0] != 1:
	s += '<< '
for i in a:
	if i == p:
		s += '(' + str(i) + ')' + ' '
	else:
		s += str(i) + ' '
if a[len(a) - 1] != n:
	s += '>>'
print(s.strip())


(n, p, k) = list(map(int, input().split()))
s = ''
if p - k > 1:
	s = '<< '
	for i in range(p - k, p):
		s += str(i) + ' '
else:
	for i in range(1, p):
		s += str(i) + ' '
s += '(' + str(p) + ') '
if p + k <= n:
	for i in range(p + 1, p + k + 1):
		s += str(i) + ' '
	if p + k != n:
		s += '>>'
else:
	for i in range(p + 1, n + 1):
		s += str(i) + ' '
print(s)


(n, p, k) = map(int, input().split())
ans = []
lp = '(' + str(n) + ')'
ans.append('(' + str(p) + ')')
for i in range(p - 1, p - k - 1, -1):
	if i > 0:
		ans.insert(0, i)
	else:
		break
for i in range(p + 1, p + k + 1, 1):
	if i <= n:
		ans.append(i)
	else:
		break
if ans[0] != 1 and ans[0] != '(1)':
	ans.insert(0, '<<')
if ans[-1] != n and ans[-1] != lp:
	ans.append('>>')
print(*ans)


(n, p, k) = map(int, input().split())
string = ''
if p != 1 and p != n:
	if p - k <= 1:
		string += ' '.join(map(str, [i for i in range(1, p)]))
		string += ' ({}) '.format(p)
	else:
		string += '<< '
		string += ' '.join(map(str, [i for i in range(p - k, p)]))
		string += ' ({}) '.format(p)
	if p + k >= n:
		string += ' '.join(map(str, [i for i in range(p + 1, n + 1)]))
	else:
		string += ' '.join(map(str, [i for i in range(p + 1, p + k + 1)]))
		string += ' >>'
elif p == 1:
	string += '(1) '
	if p + k >= n:
		string += ' '.join(map(str, [i for i in range(p + 1, n + 1)]))
	else:
		string += ' '.join(map(str, [i for i in range(p + 1, p + k + 1)]))
		string += ' >>'
else:
	if p - k <= 1:
		string += ' '.join(map(str, [i for i in range(1, p)]))
	else:
		string += '<< '
		string += ' '.join(map(str, [i for i in range(p - k, p)]))
	string += ' ({})'.format(n)
print(string)


def pages(n: int, p: int, k: int) -> str:
	res = []
	if 1 < p - k:
		res.append('<<')
	for i in range(max(1, p - k), p):
		res.append(str(i))
	res.append('({})'.format(p))
	for i in range(p + 1, min(n, p + k) + 1):
		res.append(str(i))
	if p + k < n:
		res.append('>>')
	return ' '.join(res)
(n, p, k) = map(int, input().split())
ans = pages(n, p, k)
print(ans)


(n, p, k) = [int(x) for x in input().split()]
L = []
L.append('(' + str(p) + ')')
i = 1
while p - i >= 1 and i <= k:
	L.insert(0, str(p - i))
	i = i + 1
if p - i + 1 != 1:
	L.insert(0, '<<')
j = 1
while p + j <= n and j <= k:
	L.append(str(p + j))
	j = j + 1
if p + j - 1 != n:
	L.append('>>')
for i in range(len(L) - 1):
	print(L[i], end=' ')
print(L[len(L) - 1])


import math
(n, p, k) = map(int, input().split())
if p - k > 1:
	print('<<', end=' ')
if p - k > 1:
	a = p - k
else:
	a = 1
for i in range(a, p):
	print(i, end=' ')
print('(' + str(p) + ')', end=' ')
if p + k > n:
	a = n + 1
else:
	a = p + k + 1
for i in range(p + 1, a):
	print(i, end=' ')
if p + k < n:
	print('>>')


(n, p, k) = [int(i) for i in input().strip().split()]
result = range(p - k, p + k + 1)
result = [i for i in result if i in range(1, n + 1)]
for i in result:
	if 0 < i <= n:
		continue
if 1 not in result:
	result.insert(0, '<<')
if n not in result:
	result.append('>>')
result[result.index(p)] = '(' + str(p) + ')'
for i in result:
	print(i, '', end='')


(n, k, p) = input().split()
pages = [str(i) for i in range(int(k) - int(p), int(k) + int(p) + 1) if 1 <= i <= int(n)]
output = ''.join((page + ' ' for page in pages))[:-1]
if pages[0] != '1':
	output = '<< ' + output
if pages[-1] != n:
	output += ' >>'
k_index = output.index(k)
output = f'{output[:k_index]}({k}){output[k_index + len(k):]}'
print(output)


a = [int(i) for i in input().split(' ')]
n = a[0]
p = a[1]
k = a[2]
s = []
a = range(max(1, p - k), min(n + 1, p + k + 1))
for i in a:
	if i != p:
		s.append(str(i))
	else:
		s.append('(' + str(i) + ')')
if s[0] != '1' and s[0] != '(1)':
	s[0] = '<< ' + s[0]
if s[-1] != str(n) and s[-1] != '(' + str(n) + ')':
	s[-1] = s[-1] + ' >>'
print(' '.join(s))


def myint(a):
	if a[0] == '(':
		a = a[1:-1]
	return int(a)
(n, p, k) = map(int, input().split())
ls = ['(' + str(p) + ')']
for i in range(1, k + 1):
	if p + i <= n:
		ls.append(str(p + i))
start = p - k
if start < 1:
	start = 1
for (i, x) in enumerate(range(start, p)):
	ls.insert(i, str(x))
if myint(ls[0]) > 1:
	ls.insert(0, '<<')
if myint(ls[len(ls) - 1]) < n:
	ls.append('>>')
print(' '.join(ls))


(n, p, k) = list(map(int, input().split()))
output = []
start = max(1, p - k)
end = min(n, p + k)
if start != 1:
	output.append('<<')
for i in range(start, end + 1):
	if i == p:
		output.append('(' + str(i) + ')')
	else:
		output.append(str(i))
if end != n:
	output.append('>>')
print(' '.join(output))


(n, p, k) = map(int, input().split())
s = []
s += [p - k + i for i in range(2 * k + 1) if p - k + i > 0 and p - k + i <= n]
if 1 not in s:
	s = ['<<'] + s
if n not in s:
	s.append('>>')

def f(i, p):
	if i == p:
		return '(' + str(i) + ')'
	return str(i)
print(' '.join([f(i, p) for i in s]))


s = input()
l = list(s.split(' '))
n = int(l[0])
p = int(l[1])
k = int(l[2])
if p - k == 1 and p + k < n:
	j = k
	while j:
		if p - j >= 1:
			print(str(p - j) + ' ', end='')
			j = j - 1
		else:
			break
	print('(' + str(p) + ') ', end='')
	for i in range(k):
		if p + (i + 1) <= n:
			print(str(p + (i + 1)) + ' ', end='')
		else:
			break
	print('>>')
elif p - k == 1 and p + k == n:
	j = k
	while j:
		if p - j >= 1:
			print(str(p - j) + ' ', end='')
			j = j - 1
		else:
			break
	print('(' + str(p) + ') ', end='')
	for i in range(k):
		if p + (i + 1) <= n:
			print(str(p + (i + 1)) + ' ', end='')
		else:
			break
elif p - k > 1 and p + k == n:
	print('<< ', end='')
	j = k
	while j:
		if p - j >= 1:
			print(str(p - j) + ' ', end='')
			j = j - 1
		else:
			break
	print('(' + str(p) + ') ', end='')
	for i in range(k):
		if p + (i + 1) <= n:
			print(str(p + (i + 1)) + ' ', end='')
		else:
			break
elif p - k > 1 and p + k < n:
	print('<< ', end='')
	j = k
	while j:
		if p - j >= 1:
			print(str(p - j) + ' ', end='')
			j = j - 1
		else:
			break
	print('(' + str(p) + ') ', end='')
	for i in range(k):
		if p + (i + 1) <= n:
			print(str(p + (i + 1)) + ' ', end='')
		else:
			break
	print('>>')
elif p - k > 1 and p + k > n:
	print('<< ', end='')
	j = k
	while j:
		if p - j >= 1:
			print(str(p - j) + ' ', end='')
			j = j - 1
		else:
			break
	print('(' + str(p) + ') ', end='')
	for i in range(k):
		if p + (i + 1) <= n:
			print(str(p + (i + 1)) + ' ', end='')
		else:
			break
elif p - k == 1 and p + k > n:
	j = k
	while j:
		if p - j >= 1:
			print(str(p - j) + ' ', end='')
			j = j - 1
		else:
			break
	print('(' + str(p) + ') ', end='')
	for i in range(k):
		if p + (i + 1) <= n:
			print(str(p + (i + 1)) + ' ', end='')
		else:
			break
elif p - k < 1 and p + k >= n:
	j = k
	while j:
		if p - j >= 1:
			print(str(p - j) + ' ', end='')
			j = j - 1
		else:
			j = j - 1
	print('(' + str(p) + ') ', end='')
	for i in range(k):
		if p + (i + 1) <= n:
			print(str(p + (i + 1)) + ' ', end='')
		else:
			break
elif p - k < 1 and p + k < n:
	j = k
	while j:
		if p - j >= 1:
			print(str(p - j) + ' ', end='')
			j = j - 1
		else:
			j = j - 1
	print('(' + str(p) + ') ', end='')
	for i in range(k):
		if p + (i + 1) <= n:
			print(str(p + (i + 1)) + ' ', end='')
		else:
			break
	print('>>')
else:
	pass


x = list(map(int, input().split()))
n = x[0]
p = x[1]
k = x[2]
if p - k > 1:
	print('<<', end=' ')
for i in range(k):
	if p + i - k > 0:
		print(p + i - k, end=' ')
print('(', end='')
print(p, end='')
print(')', end=' ')
for i in range(1, k + 1):
	if p + i <= n:
		print(p + i, end=' ')
if p + k < n:
	print('>>', end=' ')


(n, p, k) = map(int, input().split())
s = [i for i in range(p - k, p + k + 1) if i > 0 and i <= n]
ans = ''
for x in s:
	if x == p:
		ans += ' (' + str(x) + ')'
	else:
		ans += ' ' + str(x)
ans = ans.lstrip()
if s[0] != 1:
	ans = ans[::-1]
	ans += ' <<'
	ans = ans[::-1]
if s[-1] != n:
	ans += ' >>'
print(ans)


(n, p, k) = map(int, input().split(' '))
leftmost = max(p - k, 1)
rightmost = min(p + k, n)
print(''.join(['<< ' if leftmost > 1 else '', ' '.join(map(str, range(leftmost, p))), f' ({p}) ', ' '.join(map(str, range(p + 1, rightmost + 1))), ' >>' if rightmost < n else '']))


(n, p, k) = [int(i) for i in input().split()]
l = ['(' + str(p) + ')']
for i in range(p + 1, min(p + k + 1, n + 1)):
	l.append(i)
for i in range(p - 1, max(0, p - k - 1), -1):
	l = [i] + l
if p - k > 1:
	l = ['<<'] + l
if p + k < n:
	l.append('>>')
for i in l:
	print(i, '', end='')


(n, p, k) = map(int, input().split())
out = []
if p == 1 and p + k < n:
	out.append('(1)')
	for i in range(1, k + 1):
		out.append(str(1 + i))
	out.append('>>')
elif p == 1 and p + k >= n:
	out.append('(1)')
	for i in range(1, n):
		out.append(str(i + 1))
elif p == n and p - k > 1:
	out.append('<<')
	for i in range(k, 0, -1):
		out.append(str(n - i))
	out.append('(' + str(n) + ')')
elif p == n and p - k <= 1:
	for i in range(1, n):
		out.append(str(i))
	out.append('(' + str(n) + ')')
elif p + k < n and p - k > 1:
	out.append('<<')
	for i in range(p - k, p):
		out.append(str(i))
	out.append('(' + str(p) + ')')
	for i in range(p + 1, p + k + 1):
		out.append(str(i))
	out.append('>>')
elif p + k < n and p - k <= 1:
	for i in range(1, p):
		out.append(str(i))
	out.append('(' + str(p) + ')')
	for i in range(p + 1, p + k + 1):
		out.append(str(i))
	out.append('>>')
elif p + k >= n and p - k > 1:
	out.append('<<')
	for i in range(p - k, p):
		out.append(str(i))
	out.append('(' + str(p) + ')')
	for i in range(p + 1, n + 1):
		out.append(str(i))
else:
	for i in range(1, p):
		out.append(str(i))
	out.append('(' + str(p) + ')')
	for i in range(p + 1, n + 1):
		out.append(str(i))
print(*out)


def pages(n, p, k):
	output = ''
	if p < 1 or p > n:
		return output
	if p - k > 1:
		output += '<< '
	for i in range(p - k, p + k + 1):
		if i <= n and i >= 1:
			if i == p:
				output += '(' + str(i) + ') '
			else:
				output += str(i) + ' '
	if p + k < n:
		output += '>>'
	return output
(n, p, k) = map(int, input().split())
print(pages(n, p, k))


s = input().split()
[n, p, k] = [int(i) for i in s]
pages = []
for k_i in range(-k, 1):
	if p + k_i >= 1:
		pages.append(str(p + k_i))
for k_i in range(1, k + 1):
	if p + k_i <= n:
		pages.append(str(p + k_i))
if pages[-1] != str(n):
	pages.append('>>')
if pages[0] != str(1):
	pages = ['<<'] + pages
pages[pages.index(str(p))] = '(' + pages[pages.index(str(p))] + ')'
print(' '.join(pages))


(n, p, k) = map(int, input().split())
if p - k > 1 and p + k < n:
	print('<<', end=' ')
	for i in range(p - k, p):
		print(i, end=' ')
	print('(' + str(p) + ')', end=' ')
	for i in range(p + 1, p + k + 1):
		print(i, end=' ')
	print('>>')
elif not (p - k > 1 or p + k < n):
	for i in range(max(p - k, 1), p):
		print(i, end=' ')
	print('(' + str(p) + ')', end=' ')
	for i in range(p + 1, min(p + k + 1, n + 1)):
		print(i, end=' ')
elif p - k > 1:
	print('<<', end=' ')
	for i in range(p - k, p):
		print(i, end=' ')
	print('(' + str(p) + ')', end=' ')
	for i in range(p + 1, min(p + k + 1, n + 1)):
		print(i, end=' ')
elif p + k < n:
	for i in range(max(p - k, 1), p):
		print(i, end=' ')
	print('(' + str(p) + ')', end=' ')
	for i in range(p + 1, p + k + 1):
		print(i, end=' ')
	print('>>')


n = list(map(int, input().strip().split()))
if n[1] - n[2] > 1:
	print('<<', end=' ')
for i in range(n[1] - n[2], n[1] + n[2] + 1):
	if i < 1:
		continue
	if i > n[0]:
		break
	else:
		if i == n[1]:
			print('(' + str(i) + ')', end='')
			print(end=' ')
			continue
		print(i, end=' ')
if n[1] + n[2] < n[0]:
	print('>>', end=' ')


def task_399A(n, p, k):
	ans = ''
	if p - k > 1:
		ans += '<< '
		for i in range(p - k, p):
			ans += str(i)
			ans += ' '
	else:
		for i in range(1, p):
			ans += str(i)
			ans += ' '
	ans += '({:d})'.format(p)
	if p + k < n:
		for i in range(p + 1, p + k + 1):
			ans += ' '
			ans += str(i)
		ans += ' >>'
	else:
		for i in range(p + 1, n + 1):
			ans += ' '
			ans += str(i)
	return ans
(n, p, k) = map(int, input().split())
print(task_399A(n, p, k))


def solve(n, p, k):
	res = []
	if 1 <= p <= n:
		arr = [p + x for x in range(-k, k + 1, 1) if 1 <= p + x <= n]
		if arr[0] != 1:
			res.append('<<')
		for a in arr:
			if a == p:
				res.append('(%d)' % a)
			else:
				res.append('%d' % a)
		if arr[-1] != n:
			res.append('>>')
		return ' '.join(res)

def main():
	(n, p, k) = list(map(int, input().split()))
	print(solve(n, p, k))
main()


m = input().split()
n = int(m[0])
p = int(m[1])
k = int(m[2])
sup = min(p + k, n)
inf = max(p - k, 1)
print_list = []
print_list.append('<<' * (inf != 1))
for i in range(inf, sup + 1):
	if i == p:
		print_list.append('(' + str(i) + ')')
	else:
		print_list.append(str(i))
print_list.append('>>' * (sup != n))
print(' '.join(print_list).strip())


(n, p, k) = input().split()
(n, p, k) = (int(n), int(p), int(k))
l = []
if p - k > 1 and p + k < n:
	l.append('<<')
	for i in range(p - k, p):
		l.append(i)
	l.append('(' + str(p) + ')')
	for i in range(p + 1, p + k + 1):
		l.append(i)
	l.append('>>')
elif p - k <= 1 and p + k < n:
	for i in range(1, p):
		l.append(i)
	l.append('(' + str(p) + ')')
	for i in range(p + 1, p + k + 1):
		l.append(i)
	l.append('>>')
elif p - k > 1 and p + k >= n:
	l.append('<<')
	for i in range(p - k, p):
		l.append(i)
	l.append('(' + str(p) + ')')
	for i in range(p + 1, n + 1):
		l.append(i)
else:
	for i in range(1, p):
		l.append(i)
	l.append('(' + str(p) + ')')
	for i in range(p + 1, n + 1):
		l.append(i)
print(*l)


(n, p, k) = map(int, input().split())
lo = max(p - k, 1)
hi = min(n, p + k)
ans = ''
if lo > 1:
	ans = '<<'
for i in range(lo, p):
	ans += ' ' + str(i)
if p > 1:
	ans += ' '
ans += '({0:d})'.format(p)
for i in range(p + 1, hi + 1):
	ans += ' ' + str(i)
if hi < n:
	ans += ' >>'
print(ans)


def main():
	(n, p, k) = input().split()
	n = int(n)
	p = int(p)
	k = int(k)
	s = ''
	if p - k > 1 and p + k < n:
		s = s + '<< '
		for i in range(p - k, p + k + 1):
			if i == p:
				s = s + '(' + str(i) + ')' + ' '
			else:
				s = s + str(i) + ' '
		s = s + '>>'
	if p - k <= 1 and p + k < n:
		for i in range(1, p + k + 1):
			if i == p:
				s = s + '(' + str(i) + ')' + ' '
			else:
				s = s + str(i) + ' '
		s = s + '>>'
	if p + k >= n and p - k > 1:
		s = s + '<< '
		for i in range(p - k, n + 1):
			if i == p:
				s = s + '(' + str(i) + ')' + ' '
			else:
				s = s + str(i) + ' '
	if p - k <= 1 and p + k >= n:
		for i in range(1, n + 1):
			if i == p:
				s = s + '(' + str(i) + ')' + ' '
			else:
				s = s + str(i) + ' '
	print(s)
main()


(n, p, k) = map(int, input().split())
ans = str()
first = p - k
last = p + k + 1
if first > 1:
	ans += '<< '
else:
	first = 1
if p + k <= n:
	last = p + k + 1
else:
	last = n + 1
for i in range(first, last):
	if i == p:
		ans += '(%d) ' % i
	else:
		ans += str(i) + ' '
if p + k < n:
	ans += ' >>'
print(ans)


import math
import cmath
(n, s, m) = map(int, input().split())
left = max(1, s - m)
right = min(n, s + m)
if left != 1:
	print('<<', end=' ')
for x in range(left, s):
	print(x, end=' ')
print('(', end='')
print(s, end='')
print(')', end=' ')
for x in range(s + 1, right + 1):
	print(x, end=' ')
if right != n:
	print('>>')


def solution(n, p, k):
	if p - k > 1:
		result = ['<<']
	else:
		result = []
	for i in range(max(1, p - k), min(n, p + k) + 1):
		if i == p:
			result.append('({})'.format(i))
		else:
			result.append(str(i))
	if p + k < n:
		result.append('>>')
	return ' '.join(result)

def tester():
	tests = [((17, 5, 2), '<< 3 4 (5) 6 7 >>'), ((6, 5, 2), '<< 3 4 (5) 6'), ((6, 1, 2), '(1) 2 3 >>'), ((6, 2, 2), '1 (2) 3 4 >>'), ((9, 6, 3), '<< 3 4 5 (6) 7 8 9'), ((10, 6, 3), '<< 3 4 5 (6) 7 8 9 >>'), ((8, 5, 4), '1 2 3 4 (5) 6 7 8')]
	for test in tests:
		(n, p, k) = test[0]
		try:
			assert solution(n, p, k) == test[1]
		except:
			print('Test:', test[0])
			print('Answer:', test[1])
			print('Solution:', solution(n, p, k))
			raise
tester()
(n, p, k) = tuple(map(int, input().split()))
print(solution(n, p, k))


from sys import stdout
write = stdout.write
(n, p, k) = map(int, input().split())
if p - k > 1:
	write('<< ')
for i in range(p - k, p + k + 1):
	if 1 <= i <= n:
		write(f'{i} ' if i != p else f'({i}) ')
if p + k < n:
	print('>>')
else:
	print()


(n, p, k) = map(int, input().split())
if p - k > 1:
	print('<<', end=' ')
i = p - k
while i <= 0:
	i += 1
while i <= p + k and i <= n:
	if i == p:
		print('(', end='')
		print(i, end='')
		print(')', end=' ')
		i += 1
		continue
	print(i, end=' ')
	i += 1
if i != n + 1:
	print('>> ')


nums = input().split(' ')
(n, p, k) = [int(i) for i in nums]
front = last = ''
if p - k > 1:
	front = '<< '
if p + k < n:
	last = ' >>'
(f, l) = ([], [])
for i in range(max(1, p - k), p):
	f.append(str(i))
for i in range(p + 1, 1 + min(n, p + k)):
	l.append(str(i))
res = front + ' '.join(f + ['(' + str(p) + ')'] + l) + last
print(res)


(n, p, k) = [int(c) for c in input().split()]
lst = []
i = 0
while i <= k:
	if p + i == p:
		lst.append('(' + str(p) + ')')
	else:
		if p + i <= n and p + i <= p + k:
			lst.append(str(p + i))
		if p - i > 0 and p - i >= p - k:
			lst.insert(0, str(p - i))
	i += 1
if p - k > 1:
	lst.insert(0, '<<')
if p + k < n:
	lst.append('>>')
print(' '.join(lst))


ins = input()
inputs = ins.split(' ')
n = int(inputs[0])
p = int(inputs[1])
k = int(inputs[2])
string = ''
if p - k <= 1:
	l = 1
else:
	l = p - k
if p + k >= n:
	r = n
else:
	r = p + k
if l != 1:
	string = string + '<< '
for i in range(l, r + 1, 1):
	if i == p:
		string = string + '(' + str(i) + ') '
	elif i == r:
		string = string + str(i)
	else:
		string = string + str(i) + ' '
if r != n:
	string = string + ' >>'
print(string)


(n, p, k) = [int(i) for i in input().split()]
a = (2 * k + 1) * [0]
z = p - k
for i in range(2 * k + 1):
	a[i] = z + i
b = a[:]
for i in range(2 * k, -1, -1):
	if a[i] < 1 or a[i] > n:
		b.pop(i)
z = '(' + str(p) + ')'
z2 = b.index(p)
x = ''
if 1 not in b:
	x += '<< '
for i in range(z2):
	x += str(b[i]) + ' '
x += z + ' '
if n not in b:
	for i in range(z2 + 1, len(b)):
		x += str(b[i]) + ' '
	x += '>>'
else:
	for i in range(z2 + 1, len(b)):
		x += str(b[i]) + ' '
print(x)


def solution(n, p, k):
	arr = []
	for i in range(1, n + 1):
		arr.append(i)
	string = '(' + str(p) + ') '
	rotation = p - 2
	steps = k
	string_left = ''
	while rotation >= 0 and steps > 0:
		string_left = str(arr[rotation]) + ' ' + string_left
		rotation -= 1
		steps -= 1
	string = string_left + string
	left_arr = string_left.split(' ')
	if len(left_arr) > 1 and int(left_arr[0]) != arr[0]:
		string = '<< ' + string
	rotation = p
	steps = k
	string_right = ''
	while rotation < n and steps > 0:
		string_right += str(arr[rotation]) + ' '
		rotation += 1
		steps -= 1
	right_arr = string_right.split(' ')
	if len(right_arr) > 1 and int(right_arr[-2]) != arr[-1]:
		string_right += '>>'
	string += string_right
	print(string)
arr = input().split(' ')
solution(int(arr[0]), int(arr[1]), int(arr[2]))


(a, b, c) = input().split()
a = int(a)
b = int(b)
c = int(c)
li = []
for i in range(b - c, b + c + 1):
	if i > 0:
		li.append(i)
if li[0] != 1:
	print('<<', end=' ')
for i in li:
	if i == b:
		print('(' + str(i) + ')', end=' ')
	else:
		print(i, end=' ')
	if i == a:
		break
if a not in li:
	print('>>')


(n, p, k) = map(int, input().split())
if p >= 1 or p <= n:
	if p - k > 1:
		print('<<', end=' ')
	l = max(1, p - k)
	h = min(n, p + k)
	while l <= h:
		if l == p:
			print('(' + str(p) + ')', end=' ')
		else:
			print(l, end=' ')
		l += 1
	if p + k < n:
		print('>>', end=' ')


(n, p, k) = map(int, input().split())
b = p - k
if b <= 1:
	for i in range(1, p):
		print(i, end=' ')
else:
	print('<<', end=' ')
	for i in range(b, p):
		print(i, end=' ')
print('(', end='')
print(p, end='')
print(')', end=' ')
b = p + k
if b >= n:
	for i in range(p + 1, n + 1):
		print(i, end=' ')
else:
	for i in range(p + 1, p + k + 1):
		print(i, end=' ')
	print('>>')


output = ''
(n, p, k) = input().split()
n = int(n)
p = int(p)
k = int(k)
for i in range(p - k, p + k + 1):
	if i <= 0:
		pass
	elif i == p:
		output += '(' + str(i) + ') '
	else:
		output += str(i) + ' '
	if i == n:
		break
if output[0:2] == '1 ' or output[0] == '(':
	pass
else:
	output = '<< ' + output
if output[len(str(n)) * -1 - 1:-1] == str(n) or output[-2] == ')':
	pass
else:
	output = output + '>>'
print(output)


(n, p, k) = map(int, input().split())
res = ''
l = ' '.join(list(map(str, range(max(p - k, 1), p))))
r = ' '.join(list(map(str, range(p + 1, min(p + k + 1, n + 1)))))
if p - k > 1:
	res += '<< '
if l:
	res += l + ' '
res += '({})'.format(p)
if r:
	res += ' ' + r
if p + k < n:
	res += ' >>'
print(res)


npk = list(map(int, input().rstrip().split()))
n = npk[0]
p = npk[1]
k = npk[2]
if p - k > 1:
	print('<<', end=' ')
for i in range(p - k, p + k + 1):
	if i in range(1, n + 1):
		if i == p:
			print('({})'.format(i), end=' ')
		else:
			print(i, end=' ')
if p + k < n:
	print('>>')


(n, p, k) = map(int, input().split())
l = []
start = p - k
stop = p + k
if start <= 0:
	start = 1
if stop > n:
	stop = n
l.append('<<')
for i in range(start, stop + 1):
	if i == p:
		l.append('(' + str(i) + ')')
	else:
		l.append(i)
l.append('>>')
str_a = '(1)'
str_b = '(' + str(n) + ')'
if (1 in l or str_a in l) and (n in l or str_b in l):
	l.pop()
	l.pop(0)
elif 1 in l or str_a in l:
	l.pop(0)
elif n in l or str_b in l:
	l.pop()
for i in l:
	print(i, end=' ')


(n, p, k) = map(int, input().split())
if p - k > 1:
	print('<< ', end='')
print(' '.join(('(' + str(p) + ')' if i == p else str(i) for i in filter(lambda x: 0 < x <= n, range(p - k, p + k + 1)))), end='')
print(' >>' if p + k < n else '')


(n, p, k) = map(int, input().split())
if p - k > 1:
	print('<<', end=' ')
for i in range(p - k, p + k + 1):
	if i > n:
		pass
	elif i < 1:
		continue
	elif i == p:
		print(f'({i})', end=' ')
	elif i == p + k:
		print(i, end=' ')
	else:
		print(i, end=' ')
if p + k < n:
	print('>>', end='')


from sys import stdin, stdout
(n, p, k) = map(int, stdin.readline().split())
ar = list()
for i in range(p - k, p + k + 1):
	ar.append(i)
f = 0
if 1 not in ar:
	stdout.write('<<')
	f = 1
for i in ar:
	if i < 1 or i > n:
		continue
	if f == 1:
		stdout.write(' ')
	f = 1
	if i == p:
		stdout.write('(' + str(i) + ')')
	else:
		stdout.write(str(i))
if n not in ar:
	stdout.write(' >>')
stdout.write('\n')


n_arry = [int(i) for i in input().split()][:3]
n = n_arry[0]
p = n_arry[1]
k = n_arry[2]
if p - k > 1:
	print('<<', end=' ')
if p - k > 0:
	for i in range(k, 0, -1):
		if p - i > 0 and i > 0:
			print(p - i, end=' ')
elif p - k - 1 < 0:
	for a in range(1, p):
		print(a, end=' ')
print('(', p, ')', sep='', end=' ')
for i in range(1, k + 1):
	if p + i <= n:
		print(p + i, end=' ')
if p + k < n:
	print('>>')


(n, p, k) = tuple(map(int, input().split()))[:]
if p < 1 or p > n:
	exit()
navigation_bar = [i for i in range(max(1, p - k), min(p + k, n) + 1)]
if 1 not in navigation_bar:
	navigation_bar.insert(0, '<<')
if n not in navigation_bar:
	navigation_bar.append('>>')
for i in navigation_bar:
	if i == p:
		print('(', end='')
		print(i, end='')
		print(')', end=' ')
	elif i == navigation_bar[-1]:
		print(i)
	else:
		print(i, end=' ')


string_input = input()
string_input = list(map(int, string_input.split(' ')))
n = string_input[0]
p = string_input[1]
k = string_input[2]
left = True
right = True
if p - k <= 1:
	left = False
if p + k >= n:
	right = False
output = [str(x) if x != p else '(' + str(x) + ')' for x in range(p - k, p + k + 1) if x >= 1 and x <= n]
output = ' '.join(output)
if left:
	output = '<< ' + output
if right:
	output = output + ' >>'
print(output)


import unittest
import sys

class Tests(unittest.TestCase):

	def test1(self):
		f1 = open('tests/1.txt', 'r')
		f2 = open('tests/1a.txt', 'r')
		sys.stdin = f1
		self.assertEqual(main(), f2.read().strip(), 'test №1')
		f1.close()
		f2.close()

	def test2(self):
		f1 = open('tests/2.txt', 'r')
		f2 = open('tests/2a.txt', 'r')
		sys.stdin = f1
		self.assertEqual(main(), f2.read().strip(), 'test №2')
		f1.close()
		f2.close()

	def test3(self):
		f1 = open('tests/3.txt', 'r')
		f2 = open('tests/3a.txt', 'r')
		sys.stdin = f1
		self.assertEqual(main(), f2.read().strip(), 'test №3')
		f1.close()
		f2.close()

	def test4(self):
		f1 = open('tests/4.txt', 'r')
		f2 = open('tests/4a.txt', 'r')
		sys.stdin = f1
		self.assertEqual(main(), f2.read().strip(), 'test №4')
		f1.close()
		f2.close()

	def test5(self):
		f1 = open('tests/5.txt', 'r')
		f2 = open('tests/5a.txt', 'r')
		sys.stdin = f1
		self.assertEqual(main(), f2.read().strip(), 'test №5')
		f1.close()
		f2.close()

	def test6(self):
		f1 = open('tests/6.txt', 'r')
		f2 = open('tests/6a.txt', 'r')
		sys.stdin = f1
		self.assertEqual(main(), f2.read().strip(), 'test №6')
		f1.close()
		f2.close()

	def test7(self):
		f1 = open('tests/7.txt', 'r')
		f2 = open('tests/7a.txt', 'r')
		sys.stdin = f1
		self.assertEqual(main(), f2.read().strip(), 'test №7')
		f1.close()
		f2.close()

def main():
	(n, p, k) = map(int, input().split(' '))
	st = ''
	if p - k <= 1:
		if p == 1:
			st += '(1) '
		else:
			st += '1 '
	else:
		st += '<< '
	for i in range(p - k, p + k + 1):
		if i <= 1:
			continue
		if i == p:
			st += '(' + str(i) + ') '
			continue
		if i >= n:
			if i == n:
				st += str(n)
			break
		st += str(i) + ' '
	else:
		st += '>>'
	return st
print(main())


(n, p, k) = list(map(int, input().split()))
final_list = [i for i in range(1, n + 1)]
if p - k > 1 and p + k < n:
	f = f'({final_list[p - 1]})'
	print('<< ', *final_list[p - (k + 1):p - 1], f, *final_list[p:p + k], '>>')
if p - k <= 1 and p + k < n:
	f = f'({final_list[p - 1]})'
	print(*final_list[:p - 1], f, *final_list[p:p + k], '>>')
if p - k > 1 and p + k > n - 1:
	f = f'({final_list[p - 1]})'
	print('<< ', *final_list[p - (k + 1):p - 1], f, *final_list[p:n])
if p - k <= 1 and p + k >= n:
	f = f'({final_list[p - 1]})'
	print(*final_list[:p - 1], f, *final_list[p:n])


def main():
	s = list(map(int, input().split()))
	(n, p, k) = [s[0], s[1], s[2]]
	(y, z) = (0, 0)
	prefix = ''
	suffix = ''
	if p - k > 1:
		prefix = '<< '
	if p + k < n:
		suffix = '>>'
	print(prefix, end='')
	z = n if p + k > n else p + k
	y = 1 if p - k < 1 else p - k
	for i in range(y, z + 1):
		if i == p:
			print('({})'.format(p), end=' ')
		else:
			print(i, end=' ')
	print(suffix)
main()


(n, p, k) = map(int, input().split())
res = ''
(inf, sup) = (p - k, p + k)
if inf <= 1:
	inf = 1
else:
	res += '<< '
for i in range(inf, p):
	res += '%d ' % i
res += '(%d) ' % p
for i in range(p + 1, min(sup, n) + 1):
	res += '%d ' % i
if sup < n:
	res += '>>'
print(res)


import sys
from math import *

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())
(n, p, k) = mints()
a = []
if p - k - 1 > 0:
	a.append('<<')
for i in range(max(p - k, 1), p):
	a.append(str(i))
a.append('(' + str(p) + ')')
for i in range(p + 1, min(p + k + 1, n + 1)):
	a.append(str(i))
if p + k + 1 <= n:
	a.append('>>')
print(*a)


(n, p, k) = map(int, input().split())
s = '(' + str(p) + ')'
for _ in range(1, k + 1):
	if p - _ > 0:
		s = str(p - _) + ' ' + s
	if p + _ <= n:
		s = s + ' ' + str(p + _)
if p + k < n:
	s = s + ' >>'
if p - (k + 2) >= 0:
	s = '<< ' + s
print(s)


(n, p, k) = map(int, input().split())
st = max(p - k, 1)
la = min(p + k + 1, n + 1)
if st > 1:
	print('<<', end=' ')
for i in range(st, la):
	if i == p:
		print('({0})'.format(i), end=' ')
	else:
		print(i, end=' ')
if la - 1 != n:
	print('>>')


(n, k, p) = map(int, input().split())
s = '(' + str(k) + ')'
ans = ''
for i in range(k - p, k + p + 1):
	if i == k:
		ans += s + ' '
	if i <= n and i != k and (i > 0):
		ans += str(i) + ' '
A = ans.split()
if A[-1] == s and int(A[0]) > 1:
	print('<< ' + ' '.join(A))
elif A[-1] == s and int(A[0]) == 1:
	print(' '.join(A))
elif (A[0] == '(1)' or int(A[0]) == 1) and int(A[-1]) < n:
	print(' '.join(A) + ' >>')
elif int(A[-1]) == n and (A[0] == '(1)' or int(A[0]) == 1):
	print(' '.join(A))
elif int(A[-1]) < n and int(A[0]) > 1:
	print('<< ' + ' '.join(A) + ' >>')
elif int(A[-1]) == n and int(A[0]) > 1:
	print('<< ' + ' '.join(A))


(n, k, p) = map(int, input().split())
print('<<' if k - p > 1 else '', end=' ')
for _ in range(max(1, k - p), min(n, k + p) + 1):
	print('(' + str(_) + ')' if _ == k else str(_), end=' ')
print('>>' if k + p < n else '', end=' ')


def sol():
	(n, p, k) = map(int, input().split())
	outstring = ''
	has_one = False
	has_n = False
	prefix = ''
	for i in range(p - k, p + k + 1):
		if i == 1:
			has_one = True
		if i == n:
			has_n = True
		if i < 1 or i > n:
			continue
		else:
			if i == p:
				outstring += prefix + '({})'.format(str(i))
			else:
				outstring += prefix + str(i)
			prefix = ' '
	if not has_one:
		outstring = '<< ' + outstring
	if not has_n:
		outstring += ' >>'
	print(outstring)
sol()


(n, p, k) = map(int, input().strip().split())
lo = max(p - k, 1)
hi = min(n, p + k)
ans = ''
if lo > 1:
	ans += '<<'
for i in range(lo, p):
	ans += ' ' + str(i)
if p > 1:
	ans += ' '
ans += '(' + str(p) + ')'
for i in range(p + 1, hi + 1):
	ans += ' ' + str(i)
if hi < n:
	ans += ' >>'
print(ans)


(n, p, k) = map(int, input().split())
out = [str(i) for i in range(max(1, p - k), p)] + ['(%d)' % p] + [str(i) for i in range(p + 1, min(p + k + 1, n + 1))]
if p - k > 1:
	out.insert(0, '<<')
if p + k < n:
	out.append('>>')
print(' '.join(out))


(n, p, k) = input().split()
(n, p, k) = (int(n), int(p), int(k))
if p - k > 1:
	print('<<', end=' ')
	p1 = p - k
else:
	p1 = 1
q = min(n, p + k)
while p1 <= q:
	if p1 == p:
		print('(', p, ')', sep='', end=' ')
	else:
		print(p1, end=' ')
	p1 += 1
if q < n:
	print('>>', end='')


(n, p, k) = map(int, input().split())
h = []
for i in range(max(1, p - k), min(n, k + p) + 1):
	if i == p:
		h.append('(' + str(i) + ')')
	else:
		h.append(str(i))
l = ['1', '(1)', '({})'.format(n), '{}'.format(n)]
if h[0] not in l:
	h.insert(0, '<<')
if h[-1] not in l:
	h.append('>>')
print(*h)


def printer(n, p, k):
	ch_left = ''
	ch_right = ''
	t1 = True
	t2 = True
	for i in range(p - 1, p - k - 1, -1):
		if i == 0:
			t1 = False
			break
		ch_left = str(i) + ' ' + ch_left
		if i == 1:
			t1 = False
			break
	ch_left = '<< ' * t1 + ch_left
	for i in range(p + 1, p + k + 1):
		if i == n + 1:
			t2 = False
			break
		ch_right += str(i) + ' '
		if i == n:
			t2 = False
			break
	ch_right += '>>' * t2
	print(ch_left + '(' + str(p) + ')', ch_right)

def main():
	(n, p, k) = input().split()
	printer(int(n), int(p), int(k))
main()


(n, p, k) = map(int, input().split())
s = p - k
e = p + k
if s < 1:
	s = 1
if e > n:
	e = n
if s != 1:
	print('<<', end=' ', sep=' ')
for x in range(s, e + 1):
	if p == x:
		print('(' + str(p) + ')', end=' ', sep=' ')
		continue
	print(x, end=' ', sep=' ')
if e != n:
	print('>>', end=' ', sep=' ')


(a, b, c) = [int(x) for x in input().split()]
if b - c <= 1 or b == 1:
	print('', end='')
else:
	print('<<', end=' ')
for i in range(max(b - c, 1), b):
	print(i, end=' ')
print('(' + str(b) + ')', end=' ')
for i in range(b + 1, min(b + c + 1, a + 1)):
	print(i, end=' ')
if b + c >= a or b >= a:
	print(' ')
else:
	print('>>')


(n, p, k) = map(int, input().split())
if p - k > 1:
	first = p - k
else:
	first = 1
if p + k <= n:
	last = p + k
else:
	last = n
if not first == 1:
	print('<<', end=' ')
for i in range(first, last + 1):
	if i == p:
		print('(' + str(p) + ')', end=' ')
	else:
		print(i, end=' ')
if not last == n:
	print(' >>')


x = input()

def convert(x):
	lst = x.split(' ')
	return lst
data = convert(x)
n = int(data[0])
p = int(data[1])
k = int(data[2])
num = []
for i in range(1, n + 1):
	num.append(i)
res = []
r = ['>>']
l = ['<<']
for i in range(p - k, p + k + 1):
	if i > 0 and len(num) >= i:
		res.append(num[i - 1])
if res[0] == 1 and res[len(res) - 1] == n:
	ans = listToStr = ' '.join([str(elem) for elem in res])
	an = ans.replace(str(p), '(' + str(p) + ')', 1)
elif res[0] == 1:
	ans = listToStr = ' '.join([str(elem) for elem in res + r])
	an = ans.replace(str(p), '(' + str(p) + ')', 1)
elif res[len(res) - 1] == n:
	ans = listToStr = ' '.join([str(elem) for elem in l + res])
	an = ans.replace(str(p), '(' + str(p) + ')', 1)
else:
	ans = listToStr = ' '.join([str(elem) for elem in l + res + r])
	an = ans.replace(str(p), '(' + str(p) + ')', 1)
print(an)


def main():
	data: list = list(map(int, input().split()))
	n: int = data[0]
	p: int = data[1]
	k: int = data[2]
	tmp: list = list()
	nav: list = list()
	for i in range(k + 1):
		x = p - i
		if 0 < x:
			if x is not p:
				tmp.append(str(x))
	tmp.reverse()
	nav = tmp.copy()
	tmp.clear()
	for i in range(k + 1):
		x = p + i
		if x <= n:
			if x is not p:
				tmp.append(str(x))
	nav.append('(%d)' % p)
	nav = nav + tmp
	tmp.clear()
	if nav[0].strip('(').strip(')') != '1':
		print('<<', end=' ')
	if nav[len(nav) - 1].strip('(').strip(')') != str(n):
		print(' '.join(nav), end=' >>\n')
	else:
		print(' '.join(nav))
main()


(n, p, k) = map(int, input().split())
m = [i + 1 for i in range(n)]
if p - k > 1:
	print('<<', end=' ')
for i in range(max(0, p - k - 1), min(p + k, n)):
	if i + 1 == p:
		print(f'({i + 1})', end=' ')
	else:
		print(i + 1, end=' ')
if p + k < n:
	print('>>')


(p, n, k) = map(int, input().split())
u = 1
d = p + 1
if n - k <= 1:
	ans = []
else:
	ans = ['<<']
if n + k + 1 <= p:
	d = n + k + 1
if n - k > 0:
	u = n - k
for i in range(u, d):
	if i == n:
		ans.append('(' + str(n) + ')')
	else:
		ans.append(i)
if n < p - k:
	ans.append('>>')
ans = str(ans).replace(',', ' ')
ans = ans.replace("'", '')
print(ans[1:-1])


[n, p, k] = list(map(int, input().split()))
nav = []
low = 1 if p - k < 1 else p - k
high = n if p + k > n else p + k
if p > k + 1:
	nav += ['<<']
nav += [*list(range(low, p))]
nav += ['(' + str(p) + ')']
nav += [*list(range(p + 1, high + 1))]
if p < n - k:
	nav += ['>>']
print(*nav)


l = list(map(int, input().split()))
n = l[0]
p = l[1]
k = l[2]
s = ''
if p - k > 1:
	s += '<< '
s += ''.join(map(lambda x: str(x) + ' ' if 0 < x <= n else '', range(p - k, p)))
s += '(' + str(p) + ') '
s += ''.join(map(lambda x: str(x) + ' ' if 0 < x <= n else '', range(p + 1, p + k + 1)))
if p + k < n:
	s += '>>'
print(s)


(n, p, k) = map(int, input().split())
if p - k > 1:
	print('<<', end=' ')
for i in range(k, 0, -1):
	if p - i <= 0:
		continue
	print(p - i, end=' ')
print('(' + str(p) + ')', end=' ')
for i in range(1, k + 1):
	if p + i > n:
		break
	print(p + i, end=' ')
if p + k < n:
	print('>>')


import sys, math, random
inp = sys.stdin.read().split()
inp = [int(i) for i in inp]
a = '<<'
b = '>>'
c = '('
d = ')'
n = inp[0]
p = inp[1]
k = inp[2]
r = list(range(p - k, p + k + 1))
end = b
start = a
mid = []
for i in r:
	if i >= n:
		end = n
		continue
	elif i <= 1:
		start = 1
		continue
	else:
		mid.append(i)
note = []
note.append(start)
note.extend(mid)
note.append(end)
for i in note:
	if i == p:
		print(c + str(i) + d, end=' ')
	else:
		print(i, end=' ')


(n, p, k) = input().split()
(n, p, k) = (int(n), int(p), int(k))
q = str(p)
q = '(' + q + ')'
a = [p]
for i in range(k):
	if p - i - 1 < 1:
		break
	else:
		a = [p - i - 1] + a
for i in range(p + 1, p + k + 1):
	if i > n:
		break
	else:
		a = a + [i]
if a[0] > 1:
	a = ['<<'] + a
if a[len(a) - 1] < n:
	a = a + ['>>']
for i in range(len(a)):
	if a[i] == p:
		a[i] = q
		break
print(*a, sep=' ')


(n, p, k) = map(int, input().split())
ans = list()
if p - k > 1:
	ans.append('<< ')
for i in range(max(1, p - k), p):
	ans.append(f'{i} ')
ans.append(f'({p}) ')
for i in range(p + 1, min(n + 1, p + k + 1)):
	ans.append(f'{i} ')
if p + k < n:
	ans.append('>>')
print(''.join(ans))


(n, p, k) = [int(x) for x in input().split()]
L = []
if p - k > 1:
	L.append('<<')
	i = p - k
else:
	i = 1
while i <= p + k and i <= n:
	if i != p:
		L.append(str(i))
	else:
		L.append('(' + str(p) + ')')
	i += 1
if p + k < n:
	L.append('>>')
print(' '.join(L))


(n, p, k) = map(lambda x: int(x), input().split())
if p - k > 1:
	a = '<<'
else:
	a = ''
b = ' '.join(map(lambda x: str(x), [i for i in range(p - k, p) if i >= 1]))
d = ' '.join(map(lambda x: str(x), [i for i in range(p + 1, p + k + 1) if i <= n]))
if p + k < n:
	e = '>>'
else:
	e = ''
p = str(p)
print('{0} {1} ({2}) {3} {4}'.format(a, b, p, d, e))


s = input()
s = [int(x) for x in s.split(' ')]
(n, p, k) = (s[0], s[1], s[2])
if p - k > 1:
	print('<< ', end='')
for i in range(-k, k + 1):
	if i + p < 1:
		continue
	if i + p <= n:
		if i == 0:
			print('(', i + p, ') ', sep='', end='')
		else:
			print(i + p, end=' ')
if i + p < n:
	print('>>')


import fileinput

def test():
	pass

def __starting_point():
	(n, p, k) = list(map(int, input().split()))
	output = ''
	if p - k > 1:
		output = '<< '
	for i in range(p - k, p + k + 1):
		if i == p:
			output += '(' + str(i) + ') '
		elif i > n:
			break
		elif i > 0:
			output += str(i) + ' '
	if p + k < n:
		output += '>>'
	print(output)
__starting_point()


nums = list(input().split())
(n, p, k) = (int(nums[0]), int(nums[1]), int(nums[2]))
if p > k + 1:
	print('<< ', end='')
for i in range(k):
	if p - k + i > 0:
		print(f'{p - k + i} ', end='')
print(f'({p}) ', end='')
for i in range(1, k + 1):
	if p + i <= n:
		print(f'{p + i} ', end='')
if n > p + k:
	print('>>')


(n, c, e) = map(int, input().split())
prefix = ' '.join(map(str, range(max(1, c - e), c)))
suffix = ' '.join(map(str, range(c + 1, min(n + 1, c + e + 1))))
print('{}{}({}){}{}'.format('<< ' if c - e > 1 else '', prefix + ' ' if prefix != '' else '', c, ' ' + suffix if suffix != '' else '', ' >>' if c + e < n else ''))


(pages, current, gaps) = [int(x) for x in input().split()]
ans = []
if current - gaps > 1:
	ans.append('<<')
ans += list(range(1, pages + 1))[max(0, current - gaps - 1):min(pages, current + gaps)]
if ans[-1] != pages:
	ans.append('>>')
ans[ans.index(current)] = '(' + str(current) + ')'
print(*ans)


(n, p, k) = map(int, input().split())
result_list = ['({p})'.format(p=p)]
end = beg = p
if p < n:
	for i in range(k):
		if end >= n:
			break
		end += 1
		result_list.append(end)
	if end < n:
		result_list.append('>>')
if p > 1:
	for i in range(k):
		if beg <= 1:
			break
		beg -= 1
		result_list.insert(0, beg)
	if beg > 1:
		result_list.insert(0, '<<')
for i in result_list:
	print(i, end=' ')


(n, p, k) = map(int, input().split())
z = []
if p - k > 1:
	z.append('<<')
for i in range(max(p - k, 1), min(p + k, n) + 1):
	if i == p:
		z.append('(' + str(i) + ')')
	else:
		z.append(str(i))
if p + k < n:
	z.append('>>')
print(*z)


(n, current_page, k) = input().split()
(n, current_page, k) = (int(n), int(current_page), int(k))
s = ''
i = current_page - k
jump = 2 * k + 1
if i <= 0:
	jump -= abs(i) + 1
	i = 1
if current_page == 1:
	jump = k + 1
if i != 1:
	s += '<< '
for j in range(i, i + jump):
	if j == current_page:
		s += '(' + str(j) + ')'
	else:
		s += str(j)
	if j == n:
		break
	if j != i + jump - 1:
		s += ' '
if j < n:
	s += ' >>'
print(s)


(n, p, k) = map(int, input().split())
s = ''
k1 = 0
k2 = 0
for i in range(p - k, p + k + 1):
	if i > 0 and i <= n:
		if k1 == 0:
			if i > 1:
				s = s + '<< '
			k1 = 1
		k2 = i
		if i == p:
			s = s + '(' + str(p) + ')' + ' '
		else:
			s = s + str(i) + ' '
if k2 < n:
	s = s + '>>'
print(s)


(n, x, k) = map(int, input().split())
s = ''
if x > k + 1:
	s += '<< '
for i in range(max(1, x - k), min(n, x + k) + 1):
	if i == x:
		s += '(' + str(i) + ') '
	else:
		s += str(i) + ' '
if x + k < n:
	s += '>>'
print(s)


(n, p, k) = [int(x) for x in input().split()]
start = p - k if p - k > 0 else 1
end = p + k if p + k < n else n
if start != 1:
	print('<< ', end='')
for i in range(start, end + 1):
	if i == p:
		print(f'({p}) ', end='')
	else:
		print(f'{i} ', end='')
if end != n:
	print('>>', end='')


(n, p, k) = [int(x) for x in input().split()]
if p - k > 1:
	print('<<', end=' ')
for i in range(-k, k + 1, 1):
	if p + i < 1 or p + i > n:
		continue
	elif p + i == p:
		print('(' + str(p) + ')', end=' ')
	else:
		print(p + i, end=' ')
if p + k < n:
	print('>>')


(n, p, k) = map(int, input().split())
rightArrow = '>>'
leftArrow = '<< '
s = ''
startingIndex = 0
endingIndex = 0
if p - k <= 1:
	startingIndex = 1
else:
	startingIndex = p - k
	s += leftArrow
if p + k >= n:
	endingIndex = n
else:
	endingIndex = p + k
for i in range(startingIndex, endingIndex + 1):
	if i is p:
		s += '(' + str(i) + ') '
	else:
		s += str(i) + ' '
if p + k < n:
	s += rightArrow
print(s)


X = list(map(int, input().split()))
Pages = [str(i + 1) for i in range(X[0])]
Pages[X[1] - 1] = '(' + Pages[X[1] - 1] + ')'
if X[1] - X[-1] > 1:
	print('<< ', end='')
print(*Pages[max(0, X[1] - X[-1] - 1):min(X[0], X[1] + X[-1])], end=' ')
if X[1] < X[0] - X[-1]:
	print('>>')


def solve():
	(n, p, k) = map(int, input().split())
	pages = range(1, n + 1)
	result = []
	if p - k > 1:
		result.append('<<')
	if p - 1 - k > 0:
		left_side = p - 1 - k
	else:
		left_side = 0
	result.extend(pages[left_side:p - 1])
	result.append('({})'.format(pages[p - 1]))
	result.extend(pages[p:p + k])
	if p + k < n:
		result.append('>>')
	print(' '.join(map(str, result)))
solve()


test = list(map(int, input().split(' ')))
n = test[0]
p = test[1]
k = test[2]
start = p - k
end = p + k
start = max(1, start)
end = min(n, end)
if start != 1:
	print('<<', end=' ')
for i in range(start, end + 1):
	if i == p:
		print('(%d)' % i, end=' ')
		continue
	print(i, end=' ')
if end != n:
	print('>>')


def calc(cond, string):
	global res
	res += string if cond else ''
(n, p, k) = list(map(int, input().split()))
res = ''
calc(p - k > 1, '<< ')
for x in range(k, 0, -1):
	calc(p - x >= 1, str(p - x) + ' ')
calc(1 <= p and p <= n, '(' + str(p) + ')')
for x in range(1, k + 1):
	calc(p + x <= n, ' ' + str(p + x))
calc(p + k < n, ' >>')
print(res)


(n, p, k) = [int(i) for i in input().split()]
s = ''
for i in range(p - k, p):
	if i >= 1:
		s += str(i) + ' '
s += '(' + str(p) + ') '
for i in range(p + 1, p + k + 1):
	if i <= n:
		s += str(i) + ' '
if p - k > 1:
	s = '<< ' + s
if p + k < n:
	s += '>>'
print(s)


(n, p, k) = list(map(int, input().split()))
pages = range(max(1, p - k), min(p + k + 1, n + 1))
(pre, suf) = ('<< ', ' >>')
if pages[0] == 1:
	pre = ''
if pages[-1] == n:
	suf = ''
pages = list(map(str, pages))
for i in range(len(pages)):
	if pages[i] == str(p):
		pages[i] = '(' + pages[i] + ')'
print(pre + ' '.join(map(str, pages)) + suf)


def solve(n, c, off):
	ans = '({})'.format(c)
	tem_off = off
	counter = c + 1
	while tem_off and counter <= n:
		ans += ' {}'.format(counter)
		counter += 1
		tem_off -= 1
	if n - c > off:
		ans += ' >>'
	tem_off = off
	counter = c - 1
	while tem_off and counter >= 1:
		ans = '{} '.format(counter) + ans
		counter -= 1
		tem_off -= 1
	if c - 1 > off:
		ans = '<< ' + ans
	print(ans.strip())
(n, k, off) = map(int, input().split(' '))
solve(n, k, off)


(n, p, k) = map(int, input().split(' '))

def pages():
	for i in range(p - k, p + k + 1):
		if i < 1:
			continue
		if i > n:
			break
		if i == p:
			print('(' + str(i) + ')', end='')
			print(end=' ')
		else:
			print(i, end=' ')
	if i < n:
		print('>>')
if p - k > 1:
	print('<<', end=' ')
	pages()
else:
	pages()


entrada = input()
numbers = entrada.split()
n = int(numbers[0])
p = int(numbers[1])
k = int(numbers[2])
if p + k >= n and p - k <= 1:
	for i in range(1, n + 1):
		if i == p:
			print('(' + str(p) + ')', end=' ')
		else:
			print(i, end=' ')
if p + k >= n and p - k > 1:
	print('<<', end=' ')
	for i in range(p - k, n + 1):
		if i == p:
			print('(' + str(p) + ')', end=' ')
		else:
			print(i, end=' ')
if p + k < n and p - k <= 1:
	for i in range(1, p + k + 1):
		if i == p:
			print('(' + str(p) + ')', end=' ')
		else:
			print(i, end=' ')
	print('>>')
if p + k < n and p - k > 1:
	print('<<', end=' ')
	for i in range(p - k, p + k + 1):
		if i == p:
			print('(' + str(p) + ')', end=' ')
		else:
			print(i, end=' ')
	print('>>')


x = input()
xx = x.split()
n = int(xx[0])
p = int(xx[1])
k = int(xx[2])
if p - k <= 1:
	kk = p - 1
	while kk != 0:
		print(p - kk, end=' ')
		kk -= 1
else:
	kk = k
	print('<<', end=' ')
	while kk != 0:
		print(p - kk, end=' ')
		kk -= 1
print('(', end='')
print(p, end='')
print(')', end=' ')
if p + k >= n:
	kk = n - p
	for i in range(1, kk + 1):
		print(p + i, end=' ')
else:
	kk = k
	for i in range(1, kk + 1):
		print(p + i, end=' ')
	print('>>')


(n, p, k) = list(map(int, input().split()))
L = max(p - k, 1)
R = min(p + k + 1, n + 1)
Larrow = ['<<'] if L is not 1 else list()
Rarrow = ['>>'] if R is not n + 1 else list()
middle = list(range(L, p)) + [f'({p})'] + list(range(p + 1, R))
res = Larrow + middle + Rarrow
print(*res)


(a, b, c) = map(int, input().split())
x = []
for i in range(1, a + 1):
	x.append(i)
if max(b - c, 1) != 1:
	print('<<', end=' ')
for i in range(max(b - c - 1, 0), min(b + c, a)):
	if x[i] == b:
		print('(' + str(x[i]) + ')', end=' ')
	else:
		print(x[i], end=' ')
if min(b + c, a) != a:
	print('>>')


user_input = input().split(' ')
(n, p, k) = user_input
n = int(n)
p = int(p)
k = int(k)
nav = []
start = p - k
if start <= 1:
	start = 1
else:
	nav.append('<<')
for i in range(start, p + k + 1):
	if i < n:
		if i == p:
			nav.append(f'({str(i)})')
		else:
			nav.append(str(i))
	else:
		if i == p:
			nav.append(f'({str(i)})')
		else:
			nav.append(str(i))
		break
else:
	nav.append('>>')
print(' '.join(nav))


n = list(map(int, input().split(' ')))
if n[1] - n[2] > 1:
	print('<<', end=' ')
for i in range(1, n[0] + 1):
	if i == n[1]:
		print('(', i, end='', sep='')
	if i >= n[1] - n[2] and i <= n[1] + n[2] and (i != n[1]):
		print(i, end=' ')
	if i == n[1]:
		print(')', end=' ')
if n[1] + n[2] < n[0]:
	print('>>')


(n, p, k) = [int(v) for v in input().split()]
pages = [num for num in range(p - k, p + k + 1) if 0 < num <= n]
result = '' if 1 in pages else '<<'
for page in pages:
	if page != p:
		temp = ' {}'
	else:
		temp = ' ({})'
	result += temp.format(page)
result += '' if n in pages else ' >>'
print(result.strip())


from collections import deque

def pages(n, p, k):
	ans = deque(['(' + str(p) + ')'])
	for i in range(1, k + 1):
		if p - i >= 1:
			ans.appendleft(str(p - i))
		if p + i <= n:
			ans.append(str(p + i))
	if p - k > 1:
		ans.appendleft('<<')
	if p + k < n:
		ans.append('>>')
	return ' '.join(ans)
arr = list(map(int, input().split()))
print(pages(arr[0], arr[1], arr[2]))


n = list(map(lambda x: int(x), input().split(' ')))
(n, p, k) = (n[0], n[1], n[2])
pages = []
for i in range(-k, k + 1):
	if p + i == p:
		pages.append(f'({p})')
	elif p + i > 0 and p + i < n + 1:
		pages.append(str(p + i))
if '1' not in pages and '(1)' not in pages:
	pages.insert(0, '<<')
if str(n) not in pages and f'({n})' not in pages:
	pages.append('>>')
print(str(' '.join(pages)))


string = input()
l = string.split(' ')
(n1, n2, n3) = (int(l[0]), int(l[1]), int(l[2]))
l = []
for i in range(n2 - n3, n2 + n3 + 1):
	if i > 0 and i <= n1:
		l.append(i)
string = ''
for i in l:
	if i == n2:
		string += '(' + str(i) + ') '
	else:
		string += str(i) + ' '
string = string[:-1]
if l[0] != 1:
	string = '<< ' + string
if l[-1] != n1:
	string = string + ' >>'
print(string)


(n, p, k) = map(int, input().split())

def selectPages():
	menuNums = []
	for i in range(k + 1):
		if p - i < 1:
			break
		menuNums.insert(0, p - i)
	for i in range(p + 1, k + p + 1):
		if i > n:
			break
		menuNums.append(i)
	return menuNums

def navigate(array):
	menu = ''
	if p - k > 1:
		menu += '<<'
	for x in array:
		if x == p:
			menu += ' (' + str(x) + ')'
		else:
			menu += ' ' + str(x)
	if p + k < n:
		menu += ' >>'
	return menu.lstrip()
print(navigate(selectPages()))


strI = input().split(' ')
(n, p, k) = [int(i) for i in strI]
i = 1
end = p + k
ch1 = p - k
ch2 = p + k
if ch2 >= n:
	ch2 = n
if ch1 <= 1:
	i = 1
else:
	i = ch1
out = ''
while i <= ch2:
	if i == 1 and p == 1:
		out += '(' + str(i) + ') '
	elif i == 1:
		out += str(i) + ' '
	elif i == ch1 and p == ch1:
		out += '<< (' + str(i) + ') '
	elif i == ch1:
		out += '<< ' + str(i) + ' '
	elif i == n and p == n:
		out += '(' + str(i) + ') '
	elif i == n:
		out += str(i) + ' '
	elif i == ch2 and p == ch2:
		out += '(' + str(i) + ') >>'
	elif i == ch2:
		out += str(i) + ' >>'
	elif i == p:
		out += '(' + str(i) + ') '
	else:
		out += str(i) + ' '
	i += 1
print(out)


array = input().split()
array = list(map(lambda x: int(x) if x.isdigit() else 0, array))
l = 0
h = 0
if array[1] + array[2] >= array[0]:
	h = array[0]
else:
	h = array[1] + array[2]
if array[1] - array[2] <= 1:
	l = 1
else:
	l = array[1] - array[2]
if array[1] - array[2] > 1:
	print('<<', end=' ')
for i in range(l, h + 1):
	if i == array[1]:
		print('(', end='')
		print(i, end='')
		print(')', end=' ')
	else:
		print(i, end=' ')
if array[1] + array[2] < array[0]:
	print('>>', end=' ')


(n, p, k) = map(int, input().split())
a = ''
sum = 0
if p - k != 1 and p - k > 0:
	a = a + '<<'
i = 0
while sum != p:
	r = p + i - k
	sum = r
	i = i + 1
	if sum < 1:
		continue
	if sum == p:
		a = a + ' ' + '(' + str(p) + ')'
		break
	else:
		a = a + ' ' + str(sum)
i = i - 2
while sum != p + k:
	if sum == n:
		break
	sum = p + k - i
	i = i - 1
	a = a + ' ' + str(sum)
if p + k < n:
	a = a + ' ' + '>>'
print(a)


import sys

def input():
	return sys.stdin.readline().strip()

def int_input():
	return int(input())

def input_in_line():
	return map(int, input().split())

def main():
	(n, s, k) = input_in_line()
	a = []
	if s - k > 1:
		a += ['<<']
	for i in range(max(1, s - k), min(s + k, n) + 1):
		a += ['(' * int(i == s) + str(i) + ')' * int(i == s)]
	a += ['>>' * int(s + k < n)]
	print(*a)
main()


(n, p, k) = map(int, input().split())
ans = [i for i in range(p - k, p + k + 1)]
while ans[0] < 1:
	ans.pop(0)
while ans[-1] > n:
	ans.pop()
if ans[0] > 1:
	ans = ['<<'] + ans
if ans[-1] < n:
	ans.append('>>')
for i in range(len(ans)):
	if ans[i] == p:
		ans[i] = f'({p})'
print(*ans)


(n, p, k) = [int(i) for i in input().split()]
a = max(1, p - k)
b = min(n, p + k)
l = list(range(a, p)) + list(range(p, b + 1))
if l[0] != 1:
	print('<< ', end='')
for i in l:
	if i == p:
		print('(' + str(i) + ')', end=' ')
	else:
		print(i, end=' ')
if l[-1] != n:
	print('>>', end='')
print()


(no_page, present_page, display_range) = map(int, input().split())
if present_page - display_range <= 1:
	starting_page = 1
else:
	starting_page = present_page - display_range
if present_page + display_range >= no_page:
	ending_page = no_page
else:
	ending_page = present_page + display_range
for i in range(starting_page, ending_page + 1, +1):
	if i == present_page:
		(print('(' + str(i) + ')', end=' '),)
	elif i == 1:
		(print(i, end=' '),)
	elif i == starting_page and starting_page > 1:
		(print('<<', i, end=' '),)
	elif i == ending_page and ending_page == no_page:
		(print(i),)
	elif i == ending_page and ending_page != no_page:
		(print(i, '>>', end=' '),)
	else:
		(print(i, end=' '),)


from sys import stdin

def main():
	a = stdin.readline().split()
	b = int(a[0])
	c = int(a[1])
	d = int(a[2])
	e = []
	g = str(c)
	k = []
	if c == 1:
		e = e
	elif c > 1 and c - d > 1:
		e.append('<<')
		for i in range(d):
			e.append(str(c - d + i))
	elif c - d == 1:
		for i in range(d):
			e.append(str(c - d + i))
	elif c - d < 1:
		j = 2
		i = 0
		while j > 1:
			j = c - i - 1
			k.append(j)
			i = i + 1
		k.sort()
		for i in range(len(k)):
			k[i] = str(k[i])
		e = k + e
	f = str('(' + g + ')')
	e.append(f)
	if c + d == b:
		for i in range(d):
			e.append(str(c + i + 1))
	elif c == b:
		e = e
	elif c + d > b:
		j = 1
		i = 0
		while j < b:
			j = c + i + 1
			e.append(str(j))
			i = i + 1
	elif c < b and c + d < b:
		for i in range(d):
			e.append(str(c + i + 1))
		e.append('>>')
	h = ' '.join(e)
	print(h)
main()


x = list(map(int, input().split()))
lista = []
for i in range(-x[2], x[2] + 1):
	if x[1] + i > x[0] or x[1] + i <= 0:
		continue
	else:
		lista.append(x[1] + i)
n = lista[:]
n[n.index(x[1])] = '(' + str(x[1]) + ')'
n = list(map(str, n))
n = ' '.join(n)
if lista[0] > 1 and lista[-1] < x[0]:
	print('<<', n, '>>')
elif lista[0] > 1:
	print('<<', n)
elif lista[-1] < x[0]:
	print(n, '>>')
else:
	print(n)


(n, p, k) = map(int, input().split())
a = []
for i in range(p - k, p + k + 1):
	a.append(i)
while a[0] < 1:
	a.pop(0)
while a[len(a) - 1] > n:
	a.pop()
if a[0] != 1:
	print('<<', end=' ')
for i in a:
	v = i
	if v == p:
		v = '(' + str(v) + ')'
	print(v, end=' ')
if a[len(a) - 1] != n:
	print('>>')


(all, current, distance) = [int(i) for i in input().split()]
if current > 1 + distance:
	print('<<', end=' ')
for i in range(current - distance, current + distance + 1):
	if i == current:
		print(f'({i})', end=' ')
	elif i > 0 and i <= all:
		print(i, end=' ')
if current < all - distance:
	print('>>')


(n, p, k) = input().split()
n = int(n)
p = int(p)
k = int(k)
leftP = []
before = p - 1
while len(leftP) < k and before >= 1:
	leftP.insert(0, str(before))
	before -= 1
rightP = []
after = p + 1
while len(rightP) < k and after <= n:
	rightP.append(str(after))
	after += 1
pages = ['<< ', ' '.join(leftP) + ' (' + str(p) + ') ' + ' '.join(rightP), ' >>']
if len(leftP) > 0:
	if int(leftP[0]) <= 1:
		pages.pop(0)
else:
	pages.pop(0)
if len(rightP) > 0:
	if int(rightP[len(rightP) - 1]) >= n:
		pages.pop()
else:
	pages.pop()
print(''.join(pages))


(n, p, k) = [int(i) for i in input().strip().split(' ')]
if p - k > 1:
	print('<<', end=' ')
for i in range(p - k, p + k + 1):
	if i < 1:
		continue
	if i > n:
		continue
	if i == p:
		print('(' + str(i) + ')', end=' ')
	else:
		print(i, end=' ')
if p + k < n:
	print('>>', end=' ')
print('')


(n, p, k) = map(int, input().split(' '))
v = [x for x in range(p - k, p + k + 1)]
nv = list()
for c in v:
	if c > 0 and c <= n:
		nv.append(c)
v = nv
if v[0] != 1:
	v.insert(0, '<<')
if v[len(v) - 1] != n:
	v.append('>>')
pin = v.index(p)
v[pin] = '(' + str(p) + ')'
for c in v:
	print(c, end=' ')


(b, p, f) = [int(a) for a in input().split(' ')]
t = ''
l = p - f
m = p + f
if l <= 1:
	l = 1
else:
	t = t + '<<' + ' '
if m > b:
	m = b
for g in range(l, m + 1):
	if g == p:
		t = t + '(' + str(p) + ')' + ' '
	else:
		t = t + str(g) + ' '
if m < b:
	t = t + '>>'
print(t)


(n, p, k) = [int(x) for x in input().split()]
left = p - k
right = p + k
left = max(left, 1)
if left != 1:
	print('<< ', end='')
right = min(right, n)
for i in range(left, p):
	print(i, end=' ')
print('({0})'.format(p), end=' ')
for i in range(p + 1, right + 1):
	print(i, end=' ')
if right != n:
	print('>>')


(n, p, k) = map(int, input().split())
a = p - k if p > k else 1
b = p + k if p + k <= n else n
s = ''
for i in range(a, b + 1):
	if i == a and i != 1:
		s += '<< ' + str(i)
		continue
	if i == p:
		s += ' (' + str(p) + ') '
		continue
	if i == b and i != n:
		s += str(b) + ' >>'
		continue
	s += ' ' + str(i) + ' '
print(s)


wew = input().split()
n = int(wew[0])
p = int(wew[1])
k = int(wew[2])
f = []
for a in range(1, int(n) + 1):
	f.append(str(a))
if p + k >= n and p - k <= 1:
	print(' '.join(f[:p - 1]) + ' (' + str(p) + ') ' + ' '.join(f[p:]))
elif p + k >= n:
	print('<< ' + ' '.join(f[p - k - 1:p - 1]) + ' (' + str(p) + ') ' + ' '.join(f[p:]))
elif p - k <= 1:
	print(' '.join(f[:p - 1]) + ' (' + str(p) + ') ' + ' '.join(f[p:p + k]) + ' >>')
else:
	print('<< ' + ' '.join(f[p - k - 1:p - 1]) + ' (' + str(p) + ') ' + ' '.join(f[p:p + k]) + ' >>')


R = lambda : [*map(int, input().split())]
(n, p, k) = R()
out = '(' + str(p) + ') '
bef = ''
aft = ''
if p > 1:
	j = 0
	while j != k:
		if p - k + j > 0:
			bef += str(p - k + j) + ' '
		j += 1
	if p - k > 1:
		out = '<< ' + bef + out
	else:
		out = bef + out
j = k - 1
while j != -1:
	if p + k - j <= n:
		aft += str(p + k - j) + ' '
	j -= 1
if aft.find(str(n)) == -1 and p != n:
	out = out + aft + '>>'
else:
	out = out + aft
print(out)


def npages(n, p, k):
	ran_left = p - k
	ran_right = p + k
	page = []
	if ran_left <= 0 or ran_left == 1:
		for i in range(1, p + 1):
			page.append(i)
	else:
		page.append('<<')
		for i in range(ran_left, p + 1):
			page.append(i)
	if ran_right >= n:
		for i in range(p + 1, n + 1):
			page.append(i)
	else:
		for i in range(p + 1, ran_right + 1):
			page.append(i)
		page.append('>>')
	ind = page.index(p)
	page[ind] = '(' + str(p) + ')'
	return page
output = list(map(int, input().split()))
n = output[0]
p = output[1]
k = output[2]
pagination = npages(n, p, k)
for i in pagination:
	print(i, end=' ')


class Solution:

	def navigation(self, n, p, k):
		start = max(1, p - k)
		end = min(p + k, n)
		pagination = ''
		if start > 1:
			pagination += '<< '
		while start <= end:
			if start == p:
				pagination += '(' + str(start) + ') '
			else:
				pagination += str(start) + ' '
			start += 1
		if end < n:
			pagination += '>>'
		return pagination
sol = Solution()
[n, p, k] = list(map(int, input().strip().split()))
print(sol.navigation(n, p, k))


def f(i):
	return str(i) if i != p else '(' + str(i) + ')'
s = input()
(n, p, k) = map(int, s.split())
(l, r) = (max(1, p - k), min(n, p + k))
ans = '<< ' if l != 1 else ''
for i in range(l, r):
	ans += f(i) + ' '
ans += f(r)
if r != n:
	ans += ' >>'
print(ans)


(n, p, k) = input().split()
(n, p, k) = (int(n), int(p), int(k))
Ahead = []
Back = []
(x, y) = (p, p)
for i in range(k):
	x = x + 1
	y = y - 1
	if x <= n:
		Ahead.append(x)
	if y > 0:
		Back.append(y)
Back = list(reversed(Back))
if p == 1:
	if n in Ahead:
		print('(1)', *Ahead)
	else:
		print('(1)', *Ahead, ' ' + '>>')
elif p == n:
	if 1 in Back:
		print(*Back, '({})'.format(p))
	else:
		print('<<', *Back, '({})'.format(p))
elif n not in Ahead and 1 not in Back:
	print('<<', *Back, '({})'.format(p), *Ahead, '>>')
elif n in Ahead and 1 not in Back:
	print('<<', *Back, '({})'.format(p), *Ahead)
elif n not in Ahead and 1 in Back:
	print(*Back, '({})'.format(p), *Ahead, '>>')
elif n in Ahead and 1 in Back:
	print(*Back, '({})'.format(p), *Ahead)


def print_navigation(start, p, end):
	string = ''
	if p == start:
		print('(' + str(p) + ')', end=' ')
		for i in list(range(p + 1, end + 1)):
			string = ' '.join([string, str(i)])
		print(string[1:], end='')
	else:
		for i in list(range(start, p)):
			print(i, end=' ')
		print('(' + str(p) + ')', end='')
		for i in list(range(p + 1, end + 1)):
			string = ' '.join([string, str(i)])
		print(string, end='')

def generate_pattern(n, p, k):
	if p - k > 1 and p + k < n:
		print('<<', end=' ')
		start = p - k
		end = p + k
		print_navigation(start, p, end)
		print(' >>')
	elif p - k <= 1:
		if p + k < n:
			start = 1
			end = p + k
			print_navigation(start, p, end)
			print(' >>')
		else:
			start = 1
			end = n
			print_navigation(start, p, end)
	else:
		print('<<', end=' ')
		start = p - k
		end = n
		print_navigation(start, p, end)
input_list = list(map(int, input().split(' ')))
n = input_list[0]
p = input_list[1]
k = input_list[2]
generate_pattern(n, p, k)


(n, p, k) = map(int, input().split())
x = 0
close_symbol = True
pages = ''
if p - k > 1:
	pages += '<< '
if k <= p:
	for x in range(k):
		if p - k + x == 0:
			continue
		pages += str(p - k + x) + ' '
else:
	for x in range(1, p):
		pages += str(x) + ' '
	if x == 0:
		x = k - p
	else:
		x = k - 1
pages += '(' + str(p) + ') '
while x >= 0:
	if p + k - x <= n:
		pages += str(p + k - x) + ' '
	if p + k - x >= n:
		close_symbol = False
	x -= 1
if close_symbol:
	pages += '>>'
print(pages)


(n, p, k) = map(int, input().split())
(left, right) = (False, False)
(minn, maxx) = (None, None)
if p - k < 1:
	left = True
	minn = 1
else:
	minn = p - k
if p + k > n:
	right = True
	maxx = n
else:
	maxx = p + k
if left == False and minn != 1:
	print('<<', end=' ')
for i in range(minn, maxx + 1):
	if i != p:
		print(i, end=' ')
	else:
		print('(', end='')
		print(i, end='')
		print(')', end=' ')
if right == False and maxx != n:
	print('>>')


x = list(map(int, input().split()))
n = int(x[0])
p = int(x[1])
k = int(x[2])
st = ''
if p - k >= 1:
	if p - k != 1:
		st += '<<' + ' '
	for i in range(p - k, p):
		st += str(i) + ' '
else:
	for i in range(1, p):
		st += str(i) + ' '
st += '(' + str(p) + ')' + ' '
if p + k >= n:
	for i in range(p + 1, n + 1):
		st += str(i) + ' '
else:
	for i in range(p + 1, p + k + 1):
		st += str(i) + ' '
	st += '>>'
print(st)


(n, p, k) = map(int, input().split())
if p - k > 1:
	print('<< ', end='')
for i in range(p - k, p + k + 1):
	if i < 1 or i > n:
		continue
	if i == p:
		print('(', p, ') ', sep='', end='')
	else:
		print(i, '', end='')
if p + k < n:
	print('>>')
else:
	print()


(n, p, k) = map(int, input().split())
ans = ''
for num in range(p - k, p + k + 1):
	if n >= num > 0:
		if num == p:
			ans += '(' + str(num) + ')'
		else:
			ans += str(num)
		if num != p + k:
			ans += ' '
if p - k > 1:
	ans = '<< ' + ans
if p + k < n:
	ans += ' >>'
print(ans)


s = str(input())
npk = list(s.split(' '))
n = int(npk[0])
p = int(npk[1])
k = int(npk[2])
if n >= p:
	if p - k > 1:
		print('<< ', end='')
	for i in range(max(1, p - k), min(n, p + k) + 1):
		if i == p:
			print('(' + str(p) + ') ', end='')
		else:
			print(str(i) + ' ', end='')
	if p + k < n:
		print('>>', end='')


def pages_cf():
	(n, p, k) = list(map(int, input().split()))
	res = []
	if p - k <= 1:
		[res.append(str(i)) for i in range(1, p)]
	else:
		res.append('<<')
		[res.append(str(i)) for i in range(p - k, p)]
	res.append('({})'.format(str(p)))
	if p + k >= n:
		[res.append(str(i)) for i in range(p + 1, n + 1)]
	else:
		[res.append(str(i)) for i in range(p + 1, p + k + 1)]
		res.append('>>')
	return ' '.join(res)
print(pages_cf())


[n, p, k] = [int(x) for x in input().split()]
navigation = []
if p - k > 1:
	navigation.append('<<')
navigation += [str(x) for x in range(max(p - k, 1), p)]
navigation.append('(%i)' % p)
navigation += [str(x) for x in range(p + 1, min(p + k + 1, n + 1))]
if p + k < n:
	navigation.append('>>')
print(' '.join(navigation))


def print_pages(n, p, k):
	if p - k > 1:
		print('<<', end=' ')
	for i in range(max(1, p - k), min(n, p + k) + 1):
		if i == p:
			print('(' + str(i) + ')', end=' ')
		else:
			print(i, end=' ')
	if p + k < n:
		print('>>')
(n, p, k) = map(int, input().split())
print_pages(n, p, k)


(page_number, current_page, period) = map(int, input().split())
right = '>>'
left = '<<'
page_list = range(1, page_number + 1)
res = []
page_index = page_list.index(current_page)
if page_index > period:
	res.append(left)
for i in reversed(range(1, period + 1)):
	tmp_number = current_page - i
	if tmp_number in page_list:
		res.append(str(current_page - i))
res.append('({})'.format(str(current_page)))
for i in range(1, period + 1):
	tmp_number = current_page + i
	if tmp_number in page_list:
		res.append(str(current_page + i))
if page_index < page_number - period - 1:
	res.append(right)
print(' '.join(res))


(n, p, k) = map(int, input().split())
x = p - k
y = p + k
s = ''
if x < 1:
	x = 1
if y > n:
	y = n
if x != 1:
	s += '<< '
for i in range(x, y + 1):
	if i == p:
		s += '(' + str(i) + ') '
	elif i == y:
		s += str(i)
	else:
		s += str(i) + ' '
if y != n:
	s += ' >>'
print(s)


x = list(map(int, input().split()))
f = ''
f = ' ' + f + '(' + str(x[1]) + ')' + ' '
y = x[2]
i = 1
zs = x[1]
zm = x[1]
while y > 0:
	if zm < x[0]:
		zm += 1
		f = f + str(x[1] + i) + ' '
	if zs > 1:
		zs -= 1
		f = ' ' + str(x[1] - i) + f
	i += 1
	y -= 1
ff = f[1:len(f)]
if zs > 1:
	ff = '<<' + ' ' + ff
if zm < x[0]:
	ff = ff + ' ' + '>>'
print(ff)


(n, p, k) = list(map(int, input().split()))
global res
res = ''

def calc(cond, string):
	global res
	if cond:
		res += string
originK = k
calc(p - k > 1, '<< ')
while k >= 1:
	calc(p - k >= 1, str(p - k) + ' ')
	k -= 1
calc(1 <= p and p <= n, '(' + str(p) + ')')
k = 1
while k <= originK:
	calc(p + k <= n, ' ' + str(p + k))
	k += 1
calc(p + originK < n, ' >>')
print(res)


(n, p, k) = list(map(int, input().split(' ')))
navigation = '(' + str(p) + ')'
for i in range(1, k + 2):
	if p + i <= n and i <= k:
		navigation += ' ' + str(p + i)
	elif p + i > n:
		break
	else:
		navigation += ' >>'
for i in range(1, k + 2):
	if p - i >= 1 and i <= k:
		navigation = str(p - i) + ' ' + navigation
	elif p - i < 1:
		break
	else:
		navigation = '<< ' + navigation
print(navigation)


def function(n, p, k):
	builder = ''
	if p - k > 1:
		builder += '<< '
	if p - k > 0:
		start = p - k
	else:
		start = 1
	if p + k >= n:
		end = n + 1
	else:
		end = p + k + 1
	for i in range(start, end):
		if i == p:
			builder += '(' + str(i) + ') '
		else:
			builder += str(i) + ' '
	if p + k < n:
		builder += '>>'
	return builder

def main():
	inp = list(map(int, input().strip().split()))
	out = function(*inp)
	print(out.strip())
main()


def pr(x, n, p):
	s = ''
	if x[0] != 1:
		s += '<< '
	for i in range(len(x)):
		if x[i] == p:
			s += '(' + str(x[i]) + ') '
		else:
			s += str(x[i])
			s += ' '
	if x[len(x) - 1] != n:
		s += '>>'
	print(s)
x = [int(x) for x in input().split()]
l = [x[1]]
for i in range(1, x[2] + 1):
	a = x[1] + i
	b = x[1] - i
	if a <= x[0]:
		l.append(a)
	if b > 0:
		l.insert(0, b)
pr(l, x[0], x[1])


(n, p, k) = map(int, input().split())
s = ''
poc = p - k
kr = p + k + 1
if poc > 1:
	s = '<< '
if poc <= 0:
	poc = 1
for i in range(poc, kr):
	if i <= n:
		if i == p:
			s += '(' + str(i) + ')'
		else:
			s += str(i)
		s += ' '
if str(n) not in s:
	s += '>>'
print(s)


strs = input().split(' ')
n = int(strs[0])
p = int(strs[1])
k = int(strs[2])
start = max(1, p - k)
end = min(p + k, n)
string = ''
if start != 1:
	string += '<< '
for i in range(start, end + 1, 1):
	if i == p:
		string += '(' + str(i) + ') '
	else:
		string += str(i) + ' '
if end != n:
	string += '>>'
print(string)


def stringofnumbers(start, end):
	string = ''
	for x in range(start, end):
		string += '%i ' % x
	return string
input = list(map(int, input().split(' ')))
string = ''
if input[1] - input[2] > 1:
	string += '<< '
	startingnum = input[1] - input[2]
else:
	startingnum = 1
string += stringofnumbers(startingnum, input[1])
string += '(%i) ' % input[1]
string += stringofnumbers(input[1] + 1, min([input[0], input[1] + input[2]]) + 1)
if input[1] + input[2] < input[0]:
	string += '>> '
print(string)


(n, p, k) = tuple(map(int, input().split()))
l = max(p - k, 1)
r = min(p + k, n)
ans = ''
if l != 1:
	ans = '<< '
for i in range(l, p):
	ans += str(i) + ' '
ans += '(' + str(p) + ')' + ' '
for i in range(p + 1, r + 1):
	ans += str(i) + ' '
if r != n:
	ans += '>>'
print(ans)


def do():
	(n, p, k) = map(int, input().split(' '))
	res = []
	if p - k > 1:
		res.append('<<')
	for i in range(max(1, p - k), min(n, p + k) + 1):
		if i == p:
			res.append('(' + str(i) + ')')
		else:
			res.append(str(i))
	if p + k < n:
		res.append('>>')
	return ' '.join(res)
print(do())


s = list(map(int, input().split()))
n = s[0]
p = s[1]
k = s[2]
s = '(' + str(p) + ')'
for i in range(min(k, p - 1)):
	s = str(p - 1 - i) + ' ' + s
for i in range(min(k, n - p)):
	s = s + ' ' + str(p + 1 + i)
if p - 1 > k:
	s = '<< ' + s
if n - p > k:
	s = s + ' >>'
print(s)


(n, p, k) = map(int, input().split())
(p1, p2) = (max(1, p - k), min(n, p + k))
if p1 > 1:
	print('<< ', end='')
for i in range(p1, p2 + 1):
	print(i if i != p else '(' + str(p) + ')', end=' ')
print('>>' if p2 < n else '')


def pages():
	values = input().split(' ')
	n = int(values[0])
	p = int(values[1])
	k = int(values[2])
	ini = p - k
	fin = p + k
	if p - k <= 0:
		ini = 1
	if p + k > n:
		fin = n
	pages = list(range(ini, fin + 1))
	if 1 in pages and n in pages:
		listOfPages = map(lambda x: '(' + str(p) + ')' if x == p else x, pages)
		print(*listOfPages)
	elif 1 in pages:
		listOfPages = map(lambda x: '(' + str(p) + ')' if x == p else x, pages)
		print(*listOfPages, '>>')
	elif n in pages:
		listOfPages = map(lambda x: '(' + str(p) + ')' if x == p else x, pages)
		print('<<', *listOfPages)
	elif p < 1 or p > n:
		print(' ')
	else:
		listOfPages = map(lambda x: '(' + str(p) + ')' if x == p else x, pages)
		print('<<', *listOfPages, '>>')
pages()


(n, p, k) = map(int, input().split())
mas = []
for i in range(p, p - k - 1, -1):
	if i == 1:
		mas.append(i)
		break
	else:
		mas.append(i)
mas.reverse()
if mas[-1] != n:
	for i in range(p + 1, p + k + 1):
		if i == n:
			mas.append(i)
			break
		else:
			mas.append(i)
if mas[0] != 1:
	print('<<', end=' ')
for i in mas:
	if i == p:
		print('({})'.format(i), end=' ')
	else:
		print(i, end=' ')
if mas[-1] != n:
	print('>>')


(n, p, k) = map(int, input().split())
if not p - k <= 1:
	print('<<', end=' ')
for i in range(p - k, p):
	if i >= 1:
		print(i, end=' ')
print(f'({p})', end=' ')
for i in range(p + 1, p + k + 1):
	if i <= n:
		print(i, end=' ')
if not p + k >= n:
	print('>>', end='')
print()


(n, p, k) = [int(i) for i in input().split()]
l = max(p - k, 1)
r = min(p + k, n)
s = []
if l > 1:
	s.append('<<')
for i in range(l, r + 1):
	t = ''
	if i == p:
		t += '('
	t += str(i)
	if i == p:
		t += ')'
	s.append(t)
if r < n:
	s.append('>>')
print(' '.join(s))


(n, p, k) = map(int, input().split())
s = '(' + str(p) + ')'
check_1 = 0 + (1 if p == n else 0)
check_2 = 0 + (1 if p == 1 else 0)
i = 1
while i <= k and p + i <= n:
	if p + i == n:
		check_1 = 1
	s = s + ' ' + str(p + i)
	i += 1
i = 1
while i <= k and p - i >= 1:
	if p - i == 1:
		check_2 = 1
	s = str(p - i) + ' ' + s
	i += 1
if check_1 == 0:
	s = s + ' >> '
if check_2 == 0:
	s = '<< ' + s
print(s)


import copy
(n, p, k) = map(int, input().split())
a = []
p1 = copy.copy(p)
a.append('(' + str(p) + ')')
v = 0
while p < n and v < k:
	p += 1
	v += 1
	a.insert(v, str(p))
while k > 0 and p1 > 1:
	p1 -= 1
	a.insert(0, str(p1))
	k -= 1
if '1' not in a and '(1)' not in a:
	a.insert(0, '<<')
if str(n) not in a and '(' + str(n) + ')' not in a:
	a.insert(len(a), '>>')
print(' '.join(a))


(n, p, k) = map(int, input().split())
start = True
end = True
if p - k <= 1:
	start = False
if p + k >= n:
	end = False
if start:
	print('<< ', end='')
for i in range(p - k, p):
	if i >= 1:
		print(str(i) + ' ', end='')
print('(' + str(p) + ') ', end='')
for j in range(p + 1, p + k + 1):
	if j > n:
		break
	print(str(j) + ' ', end='')
if end:
	print('>>', end='')


(n, p, k) = map(int, input().split())
back = []
for i in range(p - 1, max(p - k - 1, 0), -1):
	back.append(i)
if len(back) > 0 and back[-1] > 1:
	back.append('<<')
back = back[::-1]
forward = []
for i in range(p + 1, min(p + k + 1, n + 1)):
	forward.append(i)
if len(forward) > 0 and forward[-1] < n:
	forward.append('>>')
print('%s (%d) %s' % (' '.join(map(str, back)), p, ' '.join(map(str, forward))))


def printNav(n, p, k):
	if p - k > 1:
		print('<<', end=' ')
	for i in range(p - k, p + k + 1):
		if i > 0 and i <= n:
			if i == p:
				print('(', i, ')', sep='', end=' ')
				continue
			print(i, end=' ')
	if p + k < n:
		print('>>')
(n, p, k) = map(int, input().split())
printNav(n, p, k)


(n, p, k) = list(map(int, input().split()))
if p - k > 1:
	print('<< ', end='')
for i in range(k):
	if p - k + i >= 1:
		print(p - k + i, end=' ')
print('(', end='')
print(p, end=') ')
for i in range(k):
	if p + i + 1 <= n:
		print(p + i + 1, end=' ')
if p + k < n:
	print('>>')


(n, p, k) = map(int, input().split())
d = [''] * (2 * k + 1)
m = 0
for i in range(-k, k + 1):
	if i == 0:
		d[m] = '(' + str(p) + ')'
	elif p + i <= n and p + i >= 1:
		d[m] = str(p + i)
	m = m + 1
if '' in d:
	d.remove('')
check = '(' + str(n) + ')'
if not '1' in d and (not '(1)' in d):
	d.insert(0, '<<')
if not str(n) in d and (not check in d):
	d.insert(len(d), '>>')
print(' '.join(d))


q = lambda : map(int, input().split())
(n, p, k) = q()
a = [int(i) for i in range(p - k, p + k + 1) if n >= int(i) > 0]
if a[0] != 1:
	print('<< ', end='')
for i in a:
	if i == p:
		print('(' + str(i) + ') ', end='')
	else:
		print(str(i) + ' ', end='')
if a[-1] != n:
	print('>>', end='')


(n, p, k) = map(int, input().split())
print('{} {} ({}) {} {}'.format('<<' if p - k > 1 else '', ' '.join(map(str, range(max(1, p - k), p))), p, ' '.join(map(str, range(p + 1, min(n, p + k) + 1))), '>>' if p + k < n else '').strip())


(n, p, k) = map(int, input().split(' '))
ans = ''
if p - k > 1:
	ans += '<< '
for i in range(p - k, p + k + 1):
	if i > 0 and i <= n:
		if i == p:
			ans += '(' + str(p) + ') '
		else:
			ans += str(i) + ' '
if p + k < n:
	ans += '>>'
if ans[len(ans) - 1] == ' ':
	print(ans[0:len(ans) - 1])
else:
	print(ans)


(a, b, c) = map(int, input().split(' '))
ll = max(1, b - c)
rl = min(a, b + c)
left = [i for i in range(b - 1, ll - 1, -1)]
right = [i for i in range(b + 1, rl + 1)]
l_bar = '<< '
if ll == 1:
	l_bar = ''
r_bar = ' >>'
if rl == a:
	r_bar = ''
left.reverse()
print(l_bar, *left, '({})'.format(b), *right, r_bar)


out = []
(n, p, k) = map(int, input().split())
left = p - k
right = p + k
closed = True
if left > 1:
	print('<< ', end='')
else:
	left = 1
if right >= n:
	closed = False
	right = n
for i in range(left, right + 1):
	if i == p:
		print('(', i, ') ', sep='', end='')
	else:
		print(i, end=' ')
if closed:
	print('>>')


(n, p, k) = map(int, input().split())
q = []
for i in range(n):
	q.append(i + 1)
q[p - 1] = '(' + str(p) + ')'
q = q[max(p - k - 1, 0):p] + q[p:p + k]
if '(1)' != q[0] != 1:
	q = ['<<'] + q
if '(' + str(p) + ')' != q[-1] != n:
	q = q + ['>>']
print(*q)


def printPage(n, p, k):
	if p < 1 or p > n:
		return ''
	printList = []
	if p - k >= 2:
		printList.append('<<')
	for i in range(p - k, p):
		if i < 1:
			continue
		else:
			printList.append(str(i))
	printList.append('(' + str(p) + ')')
	for i in range(p + 1, p + k + 1):
		if i > n:
			break
		else:
			printList.append(str(i))
	if p + k < n:
		printList.append('>>')
	return ' '.join(printList)
(n, p, k) = map(int, input().split())
print(printPage(n, p, k))


(n, p, k) = map(int, input().split())
num = []
for i in range(1, n + 1):
	num.append(i)
res = []
r = ['>>']
l = ['<<']
for i in range(p - k, p + k + 1):
	if i > 0 and len(num) >= i:
		res.append(num[i - 1])
if res[0] == 1 and res[len(res) - 1] == n:
	ans = listToStr = ' '.join([str(elem) for elem in res])
	an = ans.replace(str(p), '(' + str(p) + ')', 1)
elif res[0] == 1:
	ans = listToStr = ' '.join([str(elem) for elem in res + r])
	an = ans.replace(str(p), '(' + str(p) + ')', 1)
elif res[len(res) - 1] == n:
	ans = listToStr = ' '.join([str(elem) for elem in l + res])
	an = ans.replace(str(p), '(' + str(p) + ')', 1)
else:
	ans = listToStr = ' '.join([str(elem) for elem in l + res + r])
	an = ans.replace(str(p), '(' + str(p) + ')', 1)
print(an)


(n, p, k) = input().split()
n = int(n)
p = int(p)
k = int(k)
s = p + k
t = p - k
if s >= n and t <= 1:
	for i in range(1, p, 1):
		print(i, end=' ')
	print('(', end='')
	print(p, end='')
	print(')', end=' ')
	for i in range(p + 1, n + 1, 1):
		print(i, end=' ')
if s >= n and t > 1:
	print('<<', end=' ')
	for i in range(t, p, 1):
		print(i, end=' ')
	print('(', end='')
	print(p, end='')
	print(')', end=' ')
	for i in range(p + 1, n + 1, 1):
		print(i, end=' ')
if s < n and t <= 1:
	for i in range(1, p, 1):
		print(i, end=' ')
	print('(', end='')
	print(p, end='')
	print(')', end=' ')
	for i in range(p + 1, s + 1, 1):
		print(i, end=' ')
	print('>>', end=' ')
if s < n and t > 1:
	print('<<', end=' ')
	for i in range(p - k, p, 1):
		print(i, end=' ')
	print('(', end='')
	print(p, end='')
	print(')', end=' ')
	for i in range(p + 1, s + 1, 1):
		print(i, end=' ')
	print('>>', end=' ')


from sys import stdin

def main():
	h = []
	c = []
	j = []
	x = stdin.readline().split()
	i = 0
	while int(x[1]) + 1 + i <= int(x[0]) and i < int(x[2]):
		h.append(int(x[1]) + i + 1)
		i = i + 1
	i = 0
	while int(x[1]) - 1 - i >= 1 and i < int(x[2]):
		c.append(int(x[1]) - i - 1)
		c.sort()
		i = i + 1
	if len(c) >= 1:
		if c[0] > 1:
			c.insert(0, '<<')
	if len(h) >= 1:
		if int(x[0]) > h[len(h) - 1]:
			h.append(str('>>'))
	g = str('(' + x[1] + ')').split()
	j = c + g + h
	for i in range(len(j)):
		j[i] = str(j[i])
	d = ' '.join(j)
	print(d)
main()


(Max, This, Range) = map(int, input().split(' '))
Result = ''
MinRange = This - Range
if This - Range > 1:
	Result += '<< '
else:
	MinRange = 1
MaxRange = This + Range
if This + Range > Max:
	MaxRange = Max
MinMaxRange = This - 1
MaxMinRange = This + 1
if MinMaxRange >= MinRange:
	for i in range(MinRange, MinMaxRange + 1):
		Result += str(i) + ' '
Result += '(' + str(This) + ')'
if MaxMinRange <= MaxRange:
	Result += ' '
	for i in range(MaxMinRange, MaxRange + 1):
		Result += str(i) + ' '
	Result = Result[:-1]
if This + Range < Max:
	Result += ' >>'
print(Result)


def main():
	n = list(map(int, input().split(' ')))
	navigation = []
	for i in range(n[1] - n[2], n[1]):
		if i > 0:
			navigation.append(i)
	for i in range(n[1], n[1] + n[2] + 1):
		if i <= n[0]:
			navigation.append(i)
	if navigation[0] > 1:
		navi = [0] * len(navigation)
		navi[0] = '<<'
		navi[1:len(navigation)] = navigation
		navigation = navi
	if navigation[len(navigation) - 1] < n[0]:
		navigation.append('>>')
	string = ''
	for i in navigation:
		if str(i) == str(n[1]):
			string += '({}) '.format(i)
		else:
			string += '{} '.format(i)
	print(string[:-1])
main()


def Print(num, n):
	if num > 0 and num <= n:
		print(num, end=' ')

def main():
	_input = list(map(int, input().split()))
	(n, p, k) = (_input[0], _input[1], _input[2])
	if p - k > 1:
		print('<< ', end=' ')
	for page in range(p - k, p):
		Print(page, n)
	print('(' + str(p) + ') ', end='')
	for page in range(p + 1, p + k + 1):
		Print(page, n)
	if p + k < n:
		print('>> ')
main()


(n, p, k) = map(int, input().split())
(lower, upper) = (max(1, p - k), min(n, p + k))
if lower != 1:
	result = '<<'
else:
	result = ''
for i in range(lower, upper + 1):
	if i == p:
		result += ' (' + str(i) + ')'
	else:
		result += ' ' + str(i)
if upper != n:
	result += ' >>'
print(result)


(n, p, k) = map(int, input().split())
s = [i for i in range(p - k, p) if i > 0]
t = [i for i in range(p + 1, p + k + 1) if i <= n]
x = ''
if s != [] and s[0] != 1:
	x = '<< '
if s != []:
	x += ' '.join(map(str, s))
x += ' ({0})'.format(p)
if t != []:
	x += ' ' + ' '.join(map(str, t))
if t != [] and t[len(t) - 1] != n:
	x += ' >>'
print(x)


import sys

def main():
	(n, p, k) = [int(v) for v in sys.stdin.readline().split()]
	s = []
	if p - k > 1:
		s.append('<<')
	for i in range(p - k, p + k + 1):
		if i >= 1 and i <= n:
			if i == p:
				s.append('(' + str(i) + ')')
			else:
				s.append(str(i))
	if p + k < n:
		s.append('>>')
	print(' '.join(s))
main()


(n, p, k) = [int(s) for s in input().split()]
lnums = list(range(max(1, p - k), p))
rnums = list(range(p + 1, min(n + 1, p + k + 1)))
lbit = '<< ' if 1 not in lnums and len(lnums) != 0 else ''
rbit = ' >>' if n not in rnums and len(rnums) != 0 else ''
print(lbit + ' '.join((str(n) for n in lnums)) + ' ({}) '.format(p) + ' '.join((str(n) for n in rnums)) + rbit)


from collections import deque
(n, p, k) = [int(x) for x in input().split()]
nav = [x for x in range(p - k, p + k + 1)]
nav_str = '<<' if nav[0] > 1 else ''
for e in nav:
	if e > n:
		break
	elif e >= 1:
		nav_str += ' ' + str(e)
print(nav_str.replace('{}'.format(p), '({})'.format(p), 1).strip() + (' >>' if nav[-1] < n else ''))


arr = list(map(int, input().split()))
n = arr[0]
p = arr[1]
k = arr[2]
string = ''
start = p - k
if p - k > 1:
	string += '<<'
	while start != p:
		string += str(' ' + str(start))
		start += 1
else:
	start = 1
	for i in range(1, p):
		string += str(' ' + str(start))
		start += 1
	start = p
string += str(' (' + str(p) + ')')
start += 1
if p + k >= n:
	for i in range(p, n):
		string += str(' ' + str(start))
		start += 1
else:
	end = p + k + 1
	while start != end:
		string += str(' ' + str(start))
		start += 1
	string += ' >>'
print(string)


a = list(map(int, input().split()))
n = a[0]
p = a[1]
k = a[2]
first = list()
flag1 = 0
for i in range(k, 0, -1):
	if p - i != 1 and flag1 == 0 and (p - i > 0):
		first.append('<<')
		flag1 = 1
	if p - i == 1 and p - i > 0:
		flag1 = 1
	if p - i > 0:
		first.append(p - i)
first.append('(' + str(p) + ')')
for i in range(1, k + 1):
	if p + i <= n:
		first.append(p + i)
if p != n:
	if first[-1] != n:
		first.append('>>')
for i in first:
	print(i, end=' ')


(n, p, k) = map(int, input().split(' '))
l = []
l.append(p)
for i in range(1, k + 1):
	if i + p > n:
		break
	else:
		l.append(p + i)
for i in range(1, k + 1):
	if p - i == 0:
		break
	else:
		l.append(p - i)
l.sort()
for i in range(len(l)):
	if i == 0 and l[i] != p:
		if l[0] != 1:
			print('<<', end=' ')
			print(l[0], end=' ')
		else:
			print(l[0], end=' ')
	elif i == len(l) - 1 and l[i] != p:
		if l[i] != n:
			print(l[i], end=' ')
			print('>>')
		else:
			print(l[i])
	elif l[i] == p:
		print('(', end='')
		print(l[i], end='')
		print(')', end=' ')
	else:
		print(l[i], end=' ')


(n, p, k) = map(int, input().split())
s = ''
l = max(p - k, 1)
r = min(p + k, n)
for i in range(l, r + 1):
	if i == p:
		s += '(' + str(i) + ')'
	else:
		s += str(i)
	s += ' '
if l != 1:
	s = '<< ' + s
if r != n:
	s += '>>'
print(s)


import sys
from functools import reduce
from collections import Counter
import time
import datetime
from math import sqrt, gcd

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

def sip():
	return sys.stdin.readline()

def mip():
	return map(int, sys.stdin.readline().split())

def mips():
	return map(str, sys.stdin.readline().split())

def lip():
	return list(map(int, sys.stdin.readline().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.append(arr)
	return lst

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def minJumps(arr, n):
	jumps = [0 for i in range(n)]
	if n == 0 or arr[0] == 0:
		return float('inf')
	jumps[0] = 0
	for i in range(1, n):
		jumps[i] = float('inf')
		for j in range(i):
			if i <= j + arr[j] and jumps[j] != float('inf'):
				jumps[i] = min(jumps[i], jumps[j] + 1)
				break
	return jumps[n - 1]

def dic(arr):
	return Counter(arr)

def check_prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
(n, p, k) = mip()
lst = []
start = p - k
end = p + k
if start <= 0:
	start = 1
if end > n:
	end = n
for i in range(start, end + 1):
	lst.append(i)
if lst[0] != 1:
	lst.insert(0, '<<')
if lst[-1] != n:
	lst.insert(len(lst), '>>')
for item in lst:
	if item != p:
		print(item, end=' ')
	else:
		print('(' + str(item) + ')', end=' ')


(n, p, k) = map(int, input().strip().split())
i = max(1, p - k)
answer = []
if i != 1:
	answer.append('<<')
while i <= min(p + k, n):
	if i == p:
		answer.append(f'({p})')
	else:
		answer.append(i)
	i += 1
if p + k < n:
	answer.append('>>')
print(*answer)


(n, p, k) = map(int, input().split())
first = p - k
last = p + k
if first < 1:
	first = 1
if last > n:
	last = n
if first != 1:
	print('<<', end='')
for i in range(first, last + 1):
	print(('%s ' if p == 1 or first == 1 else ' %s ') % ('(%d)' % i if i == p else i), end='')
if last < n:
	print('>>', end='')


(n, p, k) = [int(x) for x in input().split()]
l = ''
if p - k > 1:
	l = '<<'
r = ''
if p + k < n:
	r = '>>'
o = []
for i in range(max(1, p - k), p):
	o.append(str(i))
o.append('({x})'.format(x=p))
for i in range(p + 1, min(p + k, n) + 1):
	o.append(str(i))
print(' '.join([l, *o, r]).strip())


(n, p, k) = map(int, input().split())
s = ''
q = 0
for i in range(p - k, p + k + 1, 1):
	if i < 1 or i > n:
		continue
	if i == 1:
		if i == p:
			s += '(1)' + ' '
			continue
		else:
			s += '1' + ' '
			continue
	elif i == n:
		if i == p:
			s += '(' + str(n) + ')'
			break
		else:
			s += str(n)
			break
	if i == p - k:
		s += '<< '
	if i == p:
		s += '(' + str(i) + ') '
	else:
		s += str(i) + ' '
	if i == p + k:
		s += '>>'
print(s)


def funny(n, p, k):
	a = p - k if p - k > 0 else 1
	b = p + k if p + k < n else n
	s = ''
	if a != 1:
		s = '<< '
	for i in range(a, b + 1):
		if i == p:
			s += '(' + str(p) + ')'
		else:
			s += str(i)
		s += ' '
	if b != n:
		s += ' >>'
	return s
x = list(map(int, input().split()))
print(funny(x[0], x[1], x[2]))


(pages, curpage, nav) = [int(x) for x in input().split(' ')]
answer = f'({curpage})'
for i in range(1, nav + 1):
	if curpage - i > 0:
		answer = f'{curpage - i} {answer}'
	if curpage + i <= pages:
		answer = f'{answer} {curpage + i}'
if curpage - nav > 1:
	answer = f'<< {answer}'
if curpage + nav < pages:
	answer = f'{answer} >>'
print(answer)


(n, p, k) = map(int, input().split())
arr = []
arr.append('<<')
for i in range(p - k, p + k + 1):
	if i <= n and i >= 1:
		if i == p:
			arr.append('(' + str(p) + ')')
		else:
			arr.append(i)
arr.append('>>')
if p - k <= 1:
	if p + k >= n:
		x = arr[1:]
		print(*x[:-1])
	else:
		print(*arr[1:])
elif p + k >= n:
	print(*arr[:-1])
else:
	print(*arr)


(n, p, k) = map(lambda x: int(x), input().split())
L = []
if p - k > 1:
	L.append('<<')
for i in range(k):
	if p + (i - k) >= 1:
		L.append(str(p + (i - k)))
L.append('(' + str(p) + ')')
for i in range(1, k + 1):
	if p + i > n:
		break
	L.append(str(p + i))
if p + k < n:
	L.append('>>')
print(' '.join(L))


data_out = ''
data_in = input('')
params = data_in.split(' ', 3)
if len(params) != 3:
	raise Exception('Wrong number of arguments')
totalpages = int(params[0])
currentpage = int(params[1])
navigationsize = int(params[2])
if totalpages < 3 or totalpages > 100:
	raise Exception('Wrong argument')
if currentpage < 1 or currentpage > totalpages:
	raise Exception('Wrong argument')
if navigationsize < 1 or navigationsize > totalpages:
	raise Exception('Wrong argument')
s = currentpage - navigationsize - 1
e = currentpage + navigationsize
if s + 1 > 1:
	data_out += '<< '
for i in range(s, e):
	page = i + 1
	if page == currentpage:
		data_out += '(%i) ' % page
	elif page >= 1 and page <= totalpages:
		data_out += '%i ' % page
if e < totalpages:
	data_out += '>>'
print(data_out.strip())


(n, p, k) = [int(y) for y in input().split()]
if p + k >= n:
	er = n + 1
else:
	er = p + k + 1
if p - k <= 1:
	sr = 1
else:
	sr = p - k
if p + k >= n and p - k <= 1:
	for z in range(sr, er):
		if z == p:
			print('(' + str(p) + ')', end=' ')
		else:
			print(z, end=' ')
if p + k >= n and p - k > 1:
	print('<<', end=' ')
	for z in range(sr, er):
		if z == p:
			print('(' + str(p) + ')', end=' ')
		else:
			print(z, end=' ')
if p + k < n and p - k <= 1:
	for z in range(sr, er):
		if z == p:
			print('(' + str(p) + ')', end=' ')
		else:
			print(z, end=' ')
	print('>>', ' ')
if p + k < n and p - k > 1:
	print('<<', end=' ')
	for z in range(sr, er):
		if z == p:
			print('(' + str(p) + ')', end=' ')
		else:
			print(z, end=' ')
	print('>>', ' ')