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.

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

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

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 = 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('>>')

_ = input().strip().split(' ')
n = int(_[0])
p = int(_[1])
k = int(_[2])
# print(n, p, k)
cnt = p - k
if cnt < 1:
    while 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('>>')

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 = 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 = 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)

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()

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] = [int(x) for x in raw_input().split()]

pages = range(1,n+1)
fwd,rev = True, True
if p+k >= n:
    fwd = False
if p-k <= 1:
    rev = False
stri = ""
if rev == True:
    stri = stri+"<< "
for i in range(k):
    if p-(k-i)<1:
        continue
    else:
        stri = stri+str(p-(k-i))+" "
stri = stri+"("+str(p)+")"
for i in range(k):
    if p+i+1 >n:
        continue
    else:
        stri = stri+" "+str(p+i+1)
if fwd == True:
    stri=stri+" >>"
print stri

[n, p, k] = [int(i) for i in raw_input().split()]

def makeString (n,p,k) :
	res = ""
	if p-k <= 1 :
		for i in range (1, p):
			res = res + "{} ".format(i)
	else :
		res = "<< "
		for i in range ( p - k, p, 1):
			res = res + "{} ".format(i)
	res += "({}) ".format(p)
	if p+k >= n:
		for i in range (p+1, n+1):
			res = res + "{} ".format(i)
	else :
		for i in range ( p+1, p+k+1,1):
			res = res + "{} ".format(i)
		res += ">>"
	return res

print(makeString(n,p,k))

n, p, k = map(int, raw_input().split())
arr = sorted(list(set([i for i in range(max(1,p-k),min(n+1,p+k+1))])))
s=''
if max(p-k,1) != 1:
    s += "<< "
for i in arr:
    if i < 1:
        arr.remove(i)
    if i > n:
        arr.remove(i)
ind = arr.index(p)
arr[ind] = "(" + str(arr[ind]) + ")"
s += ' '.join(str(i)for i in arr)
if min(p+k,n)!= n:
    s += " >>"
print s

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

start = max(p - k, 1)
end = min(p + k, n)

if start > 1:
    print("<<", end=' ')
for i in range(start, p):
    print(i, end=' ')
print(f"({p})", end=' ')

for i in range(p + 1, end + 1):
    print(i, end=' ')

if end < n:
    print(">>")

def print_navigation(start,p,end):
	string=''
	if p==start:
		#print('start')
		print('('+str(p)+')',end=' ')
		for i in list(range(p+1,end+1)):
			#print(i,end=' ')
			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)):
			#print(i,end=' ')
			string=' '.join([string,str(i)])
		print(string,end='')

#print_navigation(2,4,8)

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 :
		#print(1,end=' ')
		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=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,raw_input().split())
a=[]
for i in xrange(max(1,p-k),min(n,p+k)+1):
	if i==p:
		a+=['(%d)'%i]
	else:
		a+=[str(i)]
if p-k>1:
	a=['<<']+a
if p+k<n:
	a+=['>>']
print ' '.join(a)

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())

if p-k>1:
        print ("<<",end = " ")

for i in range(p-k,p):
        if i<=0:
                continue
        print(i,end = " ")

print ("(",end = "")
print (p,end = "")
print (")",end = " ")

for i in range(p+1,p+k+1):
        if i>n:
                continue
        print (i,end = " ")

if p+k<n:
        print (">>",end = " ")

n, p, k = map(int, raw_input().split())
pages = range(max(p - k, 1), min(p + k + 1, n + 1))
if pages[0] > 1:
	print '<<',
for pg in pages:
	if pg == p:
		print ('(%d)' % pg),
	else:
		print pg,
if pages[-1] < n:
	print '>>'

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)
#print(inputs, len(inputs))

s = raw_input()
numbers = map(int, s.split())
n= numbers[0]
p= numbers[1]
k= numbers[2]
towrite=[]
if p-k>1:
    towrite.append("<<")
    for poop in range(k):
        cool= p-(k-poop)
        towrite.append(str(cool))
elif p-k==1:
    for poop in range (k):
        towrite.append(str(1+poop))
else:
    x=1
    while x!=p:
        towrite.append(str(x))
        x+=1

towrite.append("("+str(p)+")")

if p+k<n:
    for poop in range(k):
        towrite.append(str(p+poop+1))
    towrite.append(">>")
else:
    poop=0
    while p+poop != n:
        poop+=1
        towrite.append(str(p+poop))

print " ".join(towrite)

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 = 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())

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)

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, p, k = map(int, raw_input().split())

l = max(p-k, 1)
r = min(p + k, n)

if l != 1:
	print('<<'),
for i in range(l, p):
	print (i),
print('(%d)' % p),
for i in range(p+1, r+1):
	print(i),
if r != n:
	print('>>'),

def main():
    data: list = list(map(int, input().split()))
    # x = [6, 1, 2]
    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))

if __name__ == '__main__':
    main()

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=" ")

x = raw_input()
x = x.split(' ')
pages = int(x[0])
page = int(x[1])
excess = int(x[2])
answer = ''
if page - excess > 1:
    answer += '<< '
    if page + excess <= pages:
        total = 2*excess + 1
        for count in range(total):
            if page == page-excess+count:
                answer += '('
            answer += str(page-excess+count)
            if page == page-excess+count:
                answer += ')'
            answer += ' '
        if page + excess != pages:
            answer += '>>'
    else:
        for count in range(page-excess, pages+1):
            if page == count:
                answer += '('
            answer += str(count)
            if page == count:
                answer += ')'
            answer += ' '
else:
    if page + excess <= pages:
        for count in range(page + excess):
            if page == count+1:
                answer += '('
            answer += str(count+1)
            if page == count+1:
                answer += ')'
            answer += ' '
        if page + excess != pages:
            answer += '>>'
    else:
        for count in range(pages):
            if page == count+1:
                answer += '('
            answer += str(count+1)
            if page == count+1:
                answer += ')'
            answer += ' '
print answer

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

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)

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=' ')

n,p,k=[int(x) for x in raw_input().split()]
l=range(max(1,p-k),min(n+1,p+k+1))
mm=[]
if l[0]!=1:
	mm.append('<<')
for i in l:
	if p==i:
		mm.append('('+str(p)+')')
	else:
		mm.append(str(i))
if l[-1]!=n:
	mm.append('>>')
print ' '.join(mm)

# # import numpy as np
#
# def spliter(arr,low,high):
#     if(high-low==1):
#         # print("1")
#         return 1
#
#     if(arr[low:high]==sorted(arr[low:high])):
#         # print("here "+str(high-low))
#         return high-low
#     else:
#         mid=(high+low)//2
#         # print("----------")
#         # print((low,mid))
#         # print("---------")
#         # print((mid,high))
#         # print("-----------")
#         a=spliter(arr,low,mid)
#         # print("was here")
#         b=spliter(arr,mid,high)
#
#         # print((a,b))
#         if(a>=b):
#             return a
#         else:
#             return b
#
# def main():
#     n=int(input())
#     arr=list(map(int,input().split(" ")))
#     lenght = n
#     if arr==sorted(arr):
#         print(n)
#     else:
#         mid=lenght//2
#         a=spliter(arr,0,mid)
#         b=spliter(arr,mid,lenght)
#         if(a>b):
#             print(a)
#         else:
#             print(b)
#
# main()

# def main():
#     checker="nineteen"
#     # n="nneteenabcnneteenabcnneteenabcnneteenabcnneteenabcii"
#     n=input()
#     number={}
#     # print(set(n))
#     for i in n:
#         if i in checker:
#             number[i]=number.get(i,0)+1
#     # number=sorted(number.values())
#     # print(sorted(number.keys()))
#     for i in ["n","t","i","e"]:
#         if i not in number.keys():
#             break
#
#     else:
#         num=number["i"]
#         min=num
#         other_Dict={"n":3,"i":1,"e":3,"t":1}
#         if(number["n"]%3==2):
#             number["n"]=number.get("n",0)+number["n"]//3
#
#         for i in number.keys():
#             if (number[i]//other_Dict[i]>=num):
#                 pass
#             elif(number[i]//other_Dict[i]<=num):
#
#                 if(min>number[i]//other_Dict[i]):
#                     min=number[i]//other_Dict[i]
#         else:
#             print(min)
#             return
#     print(0)
# main()
        # return False
    # for i,j in number:
    #     if i=="n" and i
#     # print(number)
# print(main())
# main()
# d={}
# d[10]=1
# d[10]+=2
# d[10].append(10)
# 2//3
# d.get(10,5)
# d.keys()
# main()
# d={}
# for i in "nineteen":
#    d[i]=d.get(i,0)+1
# d
# "i" not in d.keys()
# some="nineoindojaoidjoiajdoiaoidjiadjkajoidjoiajdljadjoiadlkjaadj"
# list(some.split("nineteen"))

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()

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())

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 = map(int, input().split())

s = ''
l = p - k
r = p + k
if l > 1:
    s += '<< '
else:
    l = 1
if r >= n:
    r = n
for i in range(l, r + 1):
    if i == p:
        s +='(' + str(p) + ') '
    else:
        s += str(i) + ' '
if p + k < n:
    s += '>>'
print(s)

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)

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))

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)

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)

# your code goes here
n,p,k=[int(x) for x in raw_input().split()]
if(p-k>1):print "<<",
if(p-k>=1):i=p-k
else:i=1
while(i<p):
    print "%d"%(i),
    i+=1
print ("%s%d%s")%("(",p,")"),
if(p+k<=n):j=p+k
else:j=n
i+=1
while(i<=j):
    print i,
    i+=1
if(j<n):
    print">>"

n,p,k = map(int,input().split())
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(i,end = ' ')
if n >p+k:
    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(">>")

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 = " "),

n, p, k = map(int, raw_input().split())
pages = range(max(p - k, 1), min(p + k + 1, n + 1))
if pages[0] > 1:
	print '<<',
for pg in pages:
	if pg == p:
		print ('(%d)' % pg),
	else:
		print pg,
if pages[-1] < n:
	print '>>'

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())
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)

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

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())
if((p-k)>1):
    print("<<",end=" ")
for i in range(p-k,p+k+1):
    if(i<1) or (i>n):
        continue
    elif(i==p):
        print("(" + str(i) + ")",end=" ")
    else:
        print(str(i),end=" ")
if((p+k)<n):
    print(">>")

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("(",p,")",end=" ",sep="")
for i in range(p+1,1+min(p+k,n)):
    print(i,end=" ")
if n>p+k:
    print(">>")

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])

N, P, K = [int(s) for s in raw_input().split()]

if P - K > 1:
	print "<<",
for i in range(max(P - K, 1), P):
	print i,
print ("(%d)" % P),
for i in range(P + 1, min(P + K, N) + 1):
	print i,
if P + K < N:
	print ">>"

# http://codeforces.com/problemset/problem/399/A

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))

if __name__ == '__main__':
    main()

vals = [int(x) for x in raw_input().split()]
n=vals[0]
p=vals[1]
k=vals[2]

output = []

if p-k>1:
    output.append("<<")
    for i in range(k):
        output.append(str(p-k+i))
else:
    for i in range(1,p):
        output.append(str(i))
output.append('('+str(p)+')')

if p+k<n:
    for i in range(k):
        output.append(str(p+i+1))
    output.append('>>')
else:
    for i in range(p,n):
        output.append(str(i+1))

print(' '.join(output))

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=' ')

#Codeforces Pages
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())

s = ''
l = p - k
r = p + k
if l > 1:
    s += '<< '
else:
    l = 1
if r >= n:
    r = n
for i in range(l, r + 1):
    if i == p:
        s +='(' + str(p) + ') '
    else:
        s += str(i) + ' '
if p + k < n:
    s += '>>'
print(s)

#! /usr/bin/env python
# -*- coding: utf-8 -*-
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)+' ')

_ = input().strip().split(' ')
n = int(_[0])
p = int(_[1])
k = int(_[2])
# print(n, p, k)
cnt = p - k
if cnt < 1:
    while 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('>>')

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('>>')

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)
# class Solution(object):
#     def countSquares(self, matrix):
#         """
#         :type matrix: List[List[int]]
#         :rtype: int
#         """
#         res = 0
#         row, col = len(matrix), len(matrix[0])
#         for i in range(1, row):
#             for j in range(1, col):
#                 if matrix[i][j] != 0:
#                     matrix[i][j] += min(matrix[i - 1][j - 1], matrix[i][j - 1], matrix[i - 1][j])
#                     # if matrix[i - 1][j - 1] and matrix[i][j - 1] and matrix[i - 1][j]:
#                     #     res += 1
#         for i in range(row):
#             for j in range(col):
#                 if matrix[i][j]:
#                     res += matrix[i][j]
#         print(matrix)
#         return res

# matrix = [
#   [0,1,1,1],
#   [1,1,1,1],
#   [0,1,1,1]
# ]

# a = Solution().countSquares(matrix)
# print(a)

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

if (p - k > 1) and (p + k < n):
    print("<< ", end="")
    for c in range(p - k, p + k + 1):
        if c == p:
            print('(' + str(p) + ')', end=" ")
        else:
            print(str(c) + " ", end="")
    print(">>")
elif (p - k <= 1) and (p + k >= n):
    for c in range(1, n + 1):
        if c == p:
            print('(' + str(p) + ')', end=" ")
        else:
            print(str(c) + " ", end="")
elif p + k >= n:
    print("<< ", end="")
    for c in range(p - k, n + 1):
        if c == p:
            print('(' + str(p) + ')', end=" ")
        else:
            print(str(c) + " ", end="")
else:
    for c in range(1, p + k + 1):
        if c == p:
            print('(' + str(p) + ')', end=" ")
        else:
            print(str(c) + " ", end="")
    print(">>")

'''
Created on May 20, 2014

@author: Ved

Codeforces 399A
'''

def main():
    n,p,k = map(int, raw_input().split())

    if p-k > 1:
        print "<<",

    i = max(1,p-k)
    while i <= n and i <= p+k:
        if i != p:
            print i,
        else:
            print "("+str(i)+")",
        i+=1

    if p+k < n:
        print ">>"

if __name__ == "__main__":
    main()

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=' ')

# A

def checkio(number, page, margin):
    str_ary = []

    left = page - margin
    if left < 1:
        left = 1
    # <<
    if left != 1:
        str_ary.append('<<')

    # left margin

    for i in range(left, page):
        str_ary.append(i)

    # (?)
    str_ary.append('(%d)'%page)

    #right margin
    right = page + margin
    if right > number:
        right = number
    for i in range(page+1, right+1):
        str_ary.append(i)

    # <<
    if right != number:
        str_ary.append('>>')

    return ' '.join(str(x) for x in str_ary)

n,p,k = raw_input().split(' ')

print checkio(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), min(p + k + 1, n + 1)):
    if i == p:
        print("(", i, ")", sep = '', end = ' ')
    else:
        print(i, end = ' ')
if p + k < n:
    print(">>")

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(">>")

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])

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)))

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
        else:
            if 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()

if __name__ == "__main__":
    n,p,k = map(int, input().split(' '))
    answer = calculateReq(n,p,k)
    print(answer)

# Author: peihong

def solve(n, p, k):
    return [x for x in range(max(1,p-k), min(p+k,n)+1)]

if __name__ == '__main__':
    n, p, k = map(int, raw_input().split())

    pages = solve(n, p, k)

    left = ''
    right = ''
    if not 1 in pages:
        print '<<',

    for x in pages:
        if x == p:
            print '(%d)' % x,
        else:
            print x,

    if not n in pages:
        print '>>'

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(">>")

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

l = [x for x in range(p-k,p+k+1) if x>0 and x<=n]
if l[0]>1: l.insert(0,'<<')
if l[-1] < n: l.append('>>')
l[l.index(p)] = '(' + str(p) + ')'

print ' '.join(map(str, l))

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, p, k = map(int, input().split())

ans = ""

if max(p-k, 1) > 1:
	ans = ans + "<< "

for i in range(max(p-k, 1), min(p+k, n) + 1):
	if i == p:
		ans = ans + "(" + str(i) + ") "
	else:
		ans = ans + str(i) + " "

if min(p+k, n) < n:
	ans = ans + ">> "

print(ans)

#8 5 4

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)

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

if p == 1:
    if p + k <= n:
        print('(1)', end=" ")
        for i in range(1, k + 1):
            if (i + 1 <= n):
                print(i + 1, end=" ")
        if (p + k < n):
            print('>>')
    else:
        print('(1)', end=" ")
        for i in range(1, n):
            if (i + 1 <= n):
                print(i + 1, end=" ")
elif p == n:
    if (p - k > 1):
        print('<<', end=" ")
    for i in range(p - k, p):
        if (i >= 1):
            print(i, end=" ")
    print('(', n, ')', sep="")
else:
    if (p - k > 1):
        print('<<', end=" ")
    for i in range(p - k, p):
        if (i >= 1):
            print(i, end=" ")
    print('(', p, ')', sep="", end=" ")
    for i in range(p, p + k):
        if (i + 1 <= n):
            print(i + 1, end=" ")
    if (p + k < n):
        print('>>')

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 = 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)

# -*- coding: utf-8 -*-
"""
Created on Tue Dec  3 11:21:28 2019

@author: CronuS
"""

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)

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:
    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

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 and n 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=' ')

def main():
    x: list = list(map(int, input().split()))
    n: int = x[0]
    p: int = x[1]
    k: int = x[2]
    tmp: list = list()
    if p is not 1:
        print('<<', end=' ')

    for i in range(k+1):
        x: int = p - i
        if x is p:
            tmp.append('(' + str(x) + ')')
        else:
            tmp.append(str(x))

    tmp.reverse()
    print(' '.join(tmp), end=' ')
    tmp.clear()

    for i in range(k+1):
        x: int = p + i
        if x is p:
            continue
        else:
            tmp.append(str(x))

    print(' '.join(tmp), end=' ')

    if p is not n:
        print('>>')

if __name__ == '__main__':
    main()

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 base):
    output+="<< "
for i in range(start, finish):
    if(i  == base):
        output+="("+str(base)+")"
    else:
        output+=" "+str(i)+" "
if(ran > (finish-1)):
    output+=" >>"
print(output)
#print(inputs, len(inputs))

a, b, c = map(int, input().split(" "))
# a → limit b→now c → range

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)]
print(right)
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)

n, p,  k = map(int, input().split())
z = 1
pages = ""
if(p != 1 and (p-k) != 0):
    pages += "<< "
if(k<=p):
    for x in range (k):
        if(p-k+x == 0):
            continue
        pages += str(p-k+x) + " "
pages += "(" + str(p) + ") "
while(z <= k and (p+z)<=n):
    pages += str(p+z) + " "
    z+=1

if((p+z-1) != n):
    pages += ">>"
print(pages)

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 output[0]!= '1':
    output = '<< ' + output
if output[-1] != n:
    output = output + '>>'
print(output)

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

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) + ') '
    elif i == n:
        output+= str(i) + ' '
        break
    else:
        output+= str(i) + ' '
if output[0:2]== '1 ' or output[0]== '(':
    pass
else:
    output = '<< ' + output
if output[-2] == str(n) or output[-2] == ')':
    pass
else:
    output = output + '>>'
print(output)

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(">>")
print(l1)
if '1' in l1:
    l1.remove('<<')
if str(n) in l1:
    l1.remove('>>')
for i in l1:
    if i!='n':
        print(i,end=" ")
    else:
        print(i)

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

#! /usr/bin/python

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 > p+k:
      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 = 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]) <= 2 and k > 1:
        pages.pop(0)
else:
    pages.pop(0)

if int(rightP[len(rightP)-1]) >= n:
    pages.pop()

print("".join(pages))

n, p, k = map(int, raw_input().split())
arr = list(set([p-k,p-k+1,p-1,p,p+1,p+k-1,p+k]))

for i in arr:
    if i < 1:
        arr.remove(i)
    if i > n:
        arr.remove(i)
s = '<< '+ ' '.join(str(i)for i in arr)+' >>'
if str(n) in s:
    s = s.replace(' >>','')
if '1' in s:
    s =  s.replace('<< ','')
s = s.replace(str(p),'('+str(p)+')')
print  s

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

'''
 using dictionary to print the count  of number of nineteen you can make form the given string
 what's the catch here : ninteenninteen =2
                         ninteeninteen = 2
def fun(s):
      bs = {'n': 3, 'i': 1, 'e': 3, 't': 1}
      d=dict()
      crr=100000
      for i in s:
            if i in d:
                  d[i]+=1
            else :
                  d[i]=1
      # print(bs, d)
      for i in bs :
            # print(i, d[i], bs[i])
            if i not in d:
                  return 0
            if i != 'n':
                  if d[i]==0 or d[i]/bs[i]==0 :
                        return 0
                  else :
                        crr=min(crr,d[i]//bs[i])
      if 'n' in d:
            crr=min(crr, (d['n']-1)//2)
      return crr

x=input()
print(fun(x))
'''

#n, p, k
def funny(n,p,k):
      if p-k>0 :
            front =list(range(p-k, p))
      else :
            front=list(range(1,p))
      #print("front : ", front)
      if p+k <= n :
            back=list(range(p+1,p+k+1))
      else :
            back=list(range(p+1,n+1))
     # print("back : ",back)
      #print(front+[p]+back)
      arr= front+[p]+back
      res=""
      l=len(arr)
      for i in range(l):
           # print(res)
            if arr[i] == 1:
                  if arr[i]==p:
                        res+=("("+str(arr[i])+")")
                  else :
                        res+=str(arr[i])
            elif arr[i]==n:
                  res+=str(arr[i])
                  return res
            else :
                  if i==0:
                        res+="<< "
                  if arr[i]==p:
                        if arr[i]!=n:
                              res+=("("+str(arr[i])+")")
                        else :
                              res+=str(arr[i])
                  else:
                        res+=str(arr[i])
                  if i==l-1:
                        res+=" >>"
            if i!=l-1:
                  res+=" "
      return res

x=list(map(int, input().split()))
print(funny(x[0],x[1],x[2]))

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 output[0] != '1':
	output = '<< ' + output

if output[-1] != n:
	output += ' >>'

k_index = output.index(k)
output = f'{output[:k_index]}({k}){output[k_index+len(k):]}'
print(output)

def pages(n,p,k):
    output = ""
    if p-k > 1 :
        output += "<< "
    for i in range(0, p):
        if p-k+i <= n:
            if p-k+i == p:
                output += "(" + str(p-k+i) + ") "
            else:
                output += str(p-k+i) + " "

    if p+k < n:
        output += ">>"

    return output

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

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('')
print(d)
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))

n,p,k = [int(i) for i in input().split()]
s = []
c = 0
s.append('<<')
if p-k>1:
    b = p-k
else:
    b = 1
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]))

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

n,p,k=map(int,input().split())
ch=""
if p+k<n and p-k>1:
    ch+="<< "
    for i in range(p-k,p):
        ch+=str(i)+" "
    ch+="("+str(p)+") "
    for i in range(p+1,p+k+1):
        ch+=str(i)+" "
    ch+=" >>"
elif p+k<n and p-k<=1:
    ch+="("+str(p)+")"
    for i in range(p+1,p+k+1):
        ch+=" "+str(i)
    ch+=" >>"
elif p+k>=n and p-k>1:
    ch+="<< "
    for i in range(p-k,p):
        ch+=str(i)+" "
    ch+="("+str(p)+") "
    for i in range(p+1,n+1):
        ch+=str(i)+" "

else:
    for i in range(1,p):
        ch+=str(i)+" "
    ch+="("+str(p)+") "
    for i in range(p+1,n+1):
        ch+=str(i)+" "
print(ch)

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)
ans= ans.replace(str(p), "("+str(p)+")")
if '1' not in ans:
    ans= '<<'+ans
if str(n) not in ans:
    ans= ans+" "+'>>'

print(ans.lstrip())

lineIn = map(int,raw_input().split())

#number of total pages
num = lineIn[0]
#current page displayed
curr = lineIn[1]
#number of pages displayed
amp = lineIn[2]
#create list of strings
numList = [str(i) for i in xrange(1,num+1)]
#find index of current
newCurr = numList.index(str(curr))
#add parenthesis to current
numList[newCurr] = '('+str(curr)+')'

#if current is centered in shown portion
if num/2  > amp and curr + amp < num and curr - amp > 1 :
    trimmedList = numList[(curr-(amp+1)):(curr+amp)]
    print "<<",(" ".join(x for x in trimmedList)) ,">>"

#right end case
elif num - curr <= amp and curr - amp > 1:
     trimmedList = numList[(curr-(amp+1)):]
     print "<<",(" ".join(x for x in trimmedList))

#left end case
elif curr - amp >= 1 and curr + amp < num :
    trimmedList = numList[:(curr + (amp))]
    print (" ".join(x for x in trimmedList)), '>>'

else:
    print (" ".join(x for x in numList))

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 len(leftP) <= k and int(leftP[0]) <= k:
        pages.pop(0)
else:
    pages.pop(0)

if int(rightP[len(rightP)-1]) >= n:
    pages.pop()

print("".join(pages))

def solve():
    n, p, k = map(int, input().split())
    pages = range(1, n + 1)
    result = []
    if p - 1 - k > 1:
        result.append('<<')
    left_side = p - 1 - k
    left_side = left_side if left_side > 0 else 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)))

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

'''
 using dictionary to print the count  of number of nineteen you can make form the given string
 what's the catch here : ninteenninteen =2
                         ninteeninteen = 2
def fun(s):
      bs = {'n': 3, 'i': 1, 'e': 3, 't': 1}
      d=dict()
      crr=100000
      for i in s:
            if i in d:
                  d[i]+=1
            else :
                  d[i]=1
      # print(bs, d)
      for i in bs :
            # print(i, d[i], bs[i])
            if i not in d:
                  return 0
            if i != 'n':
                  if d[i]==0 or d[i]/bs[i]==0 :
                        return 0
                  else :
                        crr=min(crr,d[i]//bs[i])
      if 'n' in d:
            crr=min(crr, (d['n']-1)//2)
      return crr

x=input()
print(fun(x))
'''

#n, p, k
def funny(n,p,k):
      if p-k>0 :
            front =list(range(p-k, p))
      else :
            front=list(range(1,p))
      #print("front : ", front)
      if p+k <= n :
            back=list(range(p+1,p+k+1))
      else :
            back=list(range(p+1,n+1))
     # print("back : ",back)
      #print(front+[p]+back)
      arr= front+[p]+back
      res=""
      l=len(arr)
      for i in range(l):
           # print(res)
            if arr[i] == 1:
                  if arr[i]==p:
                        res+=("("+str(arr[i])+")")
                  else :
                        res+=str(arr[i])
            elif arr[i]==n:
                  res+=str(arr[i])
                  return res
            else :
                  if i==0:
                        res+="<< "
                  res+=str(arr[i])
                  if i==l-1:
                        res+=" >>"
            if i!=l-1:
                  res+=" "
      return res

x=list(map(int, input().split()))
print(funny(x[0],x[1],x[2]))

n,p,k=map(int,input().split())
ans="({}) ".format(p)
for i in range(max(p-k,1),p):ans="{} ".format(i)+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)

def solve(n, c, off):
    ans = '({})'.format(c)

    # go right
    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 += ' >>'

    # go left
    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
    return ans.strip()

if __name__ == '__main__':
    n,k,off = map(int,input().split(" "))
    solve(n,k,off)

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 output[0]!= '1':
    output = '<< ' + output
if output[-1] != n:
    output = output + '>>'
print(output)

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('>> ')

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
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())

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)
ans= ans.replace(str(p), "("+str(p)+")")
if '1' not in ans:
    ans= '<<'+ans
print(str(n))
if str(n) not in ans:
    ans= ans+" "+'>>'

print(ans.lstrip())

def solution(n, p, k):
    arr = []
    for i in range(1, n+1):
        arr.append(i)
    string = "(" +str(p) + ") "

    #left side
    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) > 0 and left_arr[0] != arr[0]:
        string = "<< " + string

    #right side
    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) > 0 and right_arr[-1] != arr[-1]:
        string_right += ">>"
    string += string_right
    print(string)

arr = input().split(" ")
solution(int(arr[0]), int(arr[1]), int(arr[2]))

# A

def checkio(number, page, margin):
    str_ary = []

    # <<
    if page != 1:
        str_ary.append('<<')

    # left margin
    left = page - margin
    if left < 1:
        left = 1
    for i in range(left, page):
        str_ary.append(i)

    # (?)
    str_ary.append('(%d)'%page)

    #right margin
    right = page + margin
    if right > number:
        right = number
    for i in range(page+1, right+1):
        str_ary.append(i)

    # <<
    if page != number:
        str_ary.append('>>')

    return ' '.join(str(x) for x in str_ary)

n,p,k = raw_input().split(' ')

print checkio(int(n), int(p), int(k))

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+=str(i)
            ans+=" "
        ans += ">>"
    else:
        for i in range(p+1,n):
            ans+=str(i)
            ans+=" "
        ans += str(n)
    return ans

if __name__ == '__main__':
    n, p, k = map(int, input().split())
    print(task_399A(n,p,k))

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()

print("".join(pages))

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

if (p - k > 1) and (p + k < n):
    print("<< ", end="")
    for c in range(p - k, p + k + 1):
        if c == p:
            print('(' + str(p) + ')', end=" ")
        else:
            print(str(c) + " ", end="")
    print(">>")
elif p - k <= 1:
    for c in range(1, p + k + 1):
        if c == p:
            print('(' + str(p) + ')', end=" ")
        else:
            print(str(c) + " ", end="")
    print(">>")
elif p + k >= n:
    print("<< ", end="")
    for c in range(p - k, n + 1):
        if c == p:
            print('(' + str(p) + ')', end=" ")
        else:
            print(str(c) + " ", end="")
else:
    for c in range(1, n + 1):
        if c == p:
            print('(' + str(p) + ')', end=" ")
        else:
            print(str(c) + " ", end="")

def pages(n,p,k):
    output = ""
    if p-k > 1 :
        output += "<< "
    for i in range(0, p):
        if p-k+i <= n:
            if p-k+i == p:
                output += "(" + str(p-k+i) + ") "
            else:
                output += str(p-k+i) + " "

    if p+k < n:
        output += ">>"

    return output

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

def solution(n, p, k):
    arr = []
    for i in range(1, n+1):
        arr.append(i)
    string = "(" +str(p) + ") "

    #left side
    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
    if string[0] != str(arr[0]) and string[0] != '(':
        string = "<< " + string

    #right side
    rotation = p
    steps = k
    string_right = ""
    while rotation < n and steps > 0:
        string_right += str(arr[rotation]) + " "
        rotation += 1
        steps -= 1
    if string_right[0] != str(arr[n-1]) and string_right[-1] != ')':
        string_right += ">>"
    string += string_right
    print(string)

arr = input().split(" ")
solution(int(arr[0]), int(arr[1]), int(arr[2]))

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 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())
z = 1
pages = ""
if(p != 1 and (p-k) != 0):
    pages += "<< "
if(k<=p):
    for x in range (k):
        if(p-k+x == 0):
            continue
        pages += str(p-k+x) + " "
pages += "(" + str(p) + ") "
while(z <= k and (p+z)<=n):
    pages += str(p+z) + " "
    z+=1

if((p+z-1) != n):
    pages += ">>"
print(pages)

n, p, k = list(map(int, input().split()))
res = ""
if p-k > 1:
    res += "<< "
if p-k >= 1 and k > 1:
    res += str(p-k)+" "
if p-k+1 >= 1 and k > 2:
    res += str(p-k+1)+" "
if p-1 >= 1:
    res += str(p-1)+" "
if 1<=p and p<=n:
    res += "("+str(p)+")"
if p+1 <= n:
    res += " "+str(p+1)
if p+k-1 <= n and k > 2:
    res += " "+str(p+k-1)
if p+k <= n and k > 1:
    res += " "+str(p+k)
if p+k < n:
    res += " >>"
print(res)

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

lineIn = map(int,raw_input().split())

#number of total pages
num = lineIn[0]
#current page displayed
curr = lineIn[1]
#number of pages displayed
amp = lineIn[2]

numList = [i for i in xrange(1,num+1)]

if num/2  > amp and curr + amp < num and curr - amp > 1 :
    print "<<", numList[(curr-(amp+1)):(curr+amp)],">>"

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
        else:
            if int(string.split(' ')[-1]) == n:
                return string
            elif int(string.split(' ')[-1]) > n:
                return string[:-1].strip()
            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()

if __name__ == "__main__":
    n,p,k = map(int, input().split(' '))
    answer = calculateReq(n,p,k)
    print(answer)

n, p, k = map(int, raw_input().split())
arr = list(set([i for i in range(max(1,p-k),min(n,p+k)+1)]))

for i in arr:
    if i < 1:
        arr.remove(i)
    if i > n:
        arr.remove(i)
s = '<< '+ ' '.join(str(i)for i in arr)+' >>'
if n in arr:
    s = s.replace(' >>','')
if 1 in arr:
    s =  s.replace('<< ','')
s = s.replace(str(p),'('+str(p)+')')
print  s

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)

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) + ') '
    elif i == n:
        output+= str(i) + ' '
        break
    else:
        output+= str(i) + ' '
if output[0]== '1 ' or output[0]== '(':
    pass
else:
    output = '<< ' + output
if output[-2] == str(n) or output[-2] == ')':
    pass
else:
    output = output + '>>'
print(output)

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

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

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)

a, b, c = [int(x) for x in input().split()]
if b-c>=1 and b>=1:
    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:
	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=" ")
	else:
		if i==p+k:
			print(i,end=" ")
		else:
			print(i,end=" ")
if p+k<n:
		print(">>",end="")

x = raw_input()
x = x.split(' ')
pages = int(x[0])
page = int(x[1])
excess = int(x[2])
answer = ''
if page - excess > 1:
    answer += '<< '
    if page + excess <= pages:
        total = 2*excess + 1
        for count in range(total):
            answer += str(page-excess+count)
            answer += ' '
        if page + excess != pages:
            answer += '>>'
    else:
        for count in range(page-excess, pages+1):
            answer += str(count) + ' '
else:
    if page + excess <= pages:
        for count in range(page + excess):
            answer += str(count+1)
            answer += ' '
        if page + excess != pages:
            answer += '>>'
    else:
        for count in range(pages):
            answer += str(count+1) + ' '
index = answer.index(str(page))
answer = answer[:index] + '(' + answer[index] + ')' + answer[index+1:]
print answer

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])

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

(n, p, k), x = raw_input().split(), ''

for i in range(int(k)):
    if int(p) - i - 1 == 0:
        break
    x = str(int(p) - i - 1) + ' ' + x
    if int(p) - i - 1 == int(p) - int(k) or int(p) - i - 1 == 1:
        break

if int(p) - int(k) > 1:
    x = '<< ' + x

x = x + '(' + str(p) + ')'

for i in range(int(k)):
    x = x + ' ' + str(int(p) + i + 1)
    if int(p) + i + 1 == int(n):
        break

if int(p) + int(k) < int(n):
    x = x + ' >>'

print x

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
    l_end = False
else:
    stop = p + k
if (l_start):
    print('<<', end=' ')
for i in range(start, stop + 1, 1):
    if i == p:
        print('(' + str(i) + ')', end=' ')
    else:
        print(i, end=' ')
if (l_end):
    print('>>')

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:
	pages.append('>>')
print(str(' '.join(pages)))

x=list(map(int,input().split()))

n=x[0]
p=x[1]
k=x[2]

if(p-k>0):
    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=' ')

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 > 0:
        if i == b:
            print("("+str(i)+")",end=" ")
        else:
            print(i,end=" ")

    if i > a:
        break
if b+k < a:
    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(">> ")

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 output[0]!= '1':
    output = '<< ' + output
if output[-1] != n:
    output = output + '>>'
print(output)

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

print(" ".join(L))

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

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])

(n, p, k), x = raw_input().split(), ''

for i in range(int(k)):
    x = str(int(p) - i - 1) + ' ' + x
    if int(p) - i - 1 == int(p) - int(k) or int(p) - i - 1 == 1:
        break

if int(p) - int(k) > 1:
    x = '<< ' + x

x = x + '(' + str(p) + ')'

for i in range(int(k)):
    x = x + ' ' + str(int(p) + i + 1)
    if int(p) + i + 1 == int(n):
        break

if int(p) + int(k) < int(n):
    x = x + ' >>'

print x

x,y,z=map(int,input().split())
ok=1
ko=0
if 1>y-z :
    ok=0
if x>=y+z :
    ko=1
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(">>")

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
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())

# @Author: Justin Hershberger
# @Date:   23-03-2017
# @Filename: 399A.py
# @Last modified by:   Justin Hershberger
# @Last modified time: 23-03-2017

#Justin Hershberger
#Py3.5

import fileinput

def test():
	pass
if __name__ == '__main__':
	n,p,k = map(int, input().split())

	output = ""

	if p - k > 0:
		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)

def pages(n,p,k):
    output = ""
    if p-k > 1 :
        output += "<< "
    for i in range(0, p):
        if p-k+i <= n:
            if p-k+i == p:
                output += "(" + str(p-k+i) + ") "
            else:
                output += str(p-k+i) + " "

    if p+k < n:
        output += ">>"

    return output

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

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 output[0] != '1':
	output = '<< ' + output

if output[-1] != n:
	output += ' >>'

k_index = output.index(k)
output = f'{output[:k_index]}({k}){output[k_index+len(k):]}'
print(output)

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]) <= 2:
        pages.pop(0)
else:
    pages.pop(0)

if int(rightP[len(rightP)-1]) >= n:
    pages.pop()

print("".join(pages))

n_arry = [int(i) for i in input().split()][:3]
for i in n_arry:
    print(i, end=" ")
print('')
n=n_arry[0]
p=n_arry[1]
k=n_arry[2]
if (p-k)>0:
    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=map(int,input().split())
ans=" ){}( ".format(p)
for i in range(max(p-k,1),p):ans+="{} ".format(i)
ans=ans[::-1]
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)

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) + ') '
    elif i == n:
        output+= str(i) + ' '
        break
    else:
        output+= str(i) + ' '
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=[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[:]
#print(len(b),len(a))
for i in range(2*k,-1,-1):
    #print(len(a))
    #print(i)
    if a[i]<1 or a[i]>n:
        b.pop(i)
#print(b)
z='('+str(p)+')'
z2=b.index(p)
x=''
print(z2)
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)

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 > 0 and p + i < n + 1:
		pages.append(str(p+i))
if '1' not in pages:
	pages.insert(0, '<<')
if str(n) not in pages:
	pages.append('>>')
print(str(' '.join(pages)))

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


Hasan loves playing games and has recently discovered a game called TopScore. In this soccer-like game there are $$$p$$$ players doing penalty shoot-outs. Winner is the one who scores the most. In case of ties, one of the top-scorers will be declared as the winner randomly with equal probability.They have just finished the game and now are waiting for the result. But there's a tiny problem! The judges have lost the paper of scores! Fortunately they have calculated sum of the scores before they get lost and also for some of the players they have remembered a lower bound on how much they scored. However, the information about the bounds is private, so Hasan only got to know his bound.According to the available data, he knows that his score is at least $$$r$$$ and sum of the scores is $$$s$$$.Thus the final state of the game can be represented in form of sequence of $$$p$$$ integers $$$a_1, a_2, \dots, a_p$$$ ($$$0 \le a_i$$$) — player's scores. Hasan is player number $$$1$$$, so $$$a_1 \ge r$$$. Also $$$a_1 + a_2 + \dots + a_p = s$$$. Two states are considered different if there exists some position $$$i$$$ such that the value of $$$a_i$$$ differs in these states. Once again, Hasan doesn't know the exact scores (he doesn't know his exact score as well). So he considers each of the final states to be equally probable to achieve.Help Hasan find the probability of him winning.It can be shown that it is in the form of $$$\frac{P}{Q}$$$ where $$$P$$$ and $$$Q$$$ are non-negative integers and $$$Q \ne 0$$$, $$$P \le Q$$$. Report the value of $$$P \cdot Q^{-1} \pmod {998244353}$$$.

The only line contains three integers $$$p$$$, $$$s$$$ and $$$r$$$ ($$$1 \le p \le 100$$$, $$$0 \le r \le s \le 5000$$$) — the number of players, the sum of scores of all players and Hasan's score, respectively.

Print a single integer — the probability of Hasan winning. It can be shown that it is in the form of $$$\frac{P}{Q}$$$ where $$$P$$$ and $$$Q$$$ are non-negative integers and $$$Q \ne 0$$$, $$$P \le Q$$$. Report the value of $$$P \cdot Q^{-1} \pmod {998244353}$$$.

NoteIn the first example Hasan can score $$$3$$$, $$$4$$$, $$$5$$$ or $$$6$$$ goals. If he scores $$$4$$$ goals or more than he scores strictly more than his only opponent. If he scores $$$3$$$ then his opponent also scores $$$3$$$ and Hasan has a probability of $$$\frac 1 2$$$ to win the game. Thus, overall he has the probability of $$$\frac 7 8$$$ to win.In the second example even Hasan's lower bound on goal implies him scoring more than any of his opponents. Thus, the resulting probability is $$$1$$$.

c = [[0 for i in range(5205)] for j in range(5205)]
K = 998244353
inv = [0 for i in range(5205)]

def mu(a, n):
	if n == 0: return 1
	q = mu(a, n // 2)
	if n % 2 == 0:
		return q * q % K
	else: return q * q % K * a % K

def calc(m, d, S):
	res = 0
	if m == 0:
		if S == 0: return 1
		return 0

	for u in range(0, m + 1):
		if (u * d > S): break
		U = c[m][u] * c[S - u * d + m - 1][m - 1] % K
		if u % 2 == 0:
			res = (res + U) % K
		else: res = (res - U + K) % K
	return res

c[0][0] = 1
inv[0] = 1
for i in range(1, 5101):
	inv[i] = mu(i, K - 2)

for i in range(1, 5101):
	c[i][0] = 1
	for j in range (1, i):
		c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % K
	c[i][i] = 1

p, s, r = map(int, input().split())

res = 0
den = 0

for i in range(1, p + 1):
	A = 0
	for d in range(r, s // i + 1):
		if (i < p): A = (A + calc(p - i, d, s - d * i)) % K
		else:
			if (s - i * d == 0): A += 1
	A = A * inv[i] % K
	res = (res + A * c[p - 1][i - 1] % K) % K

den = c[s - r + p - 1][p - 1]
res = res * mu(den, K - 2) % K
print(res)

base=998244353;
def power(x, y):
    if(y==0):
        return 1
    t=power(x, y//2)
    t=(t*t)%base
    if(y%2):
        t=(t*x)%base
    return t;
def inverse(x):
    return power(x, base-2)
f=[1]
iv=[1]
for i in range(1, 5555):
    f.append((f[i-1]*i)%base)
    iv.append(inverse(f[i]))
def C(n, k):
    return (f[n]*iv[k]*iv[n-k])%base
def candy(n, k):
    # print(n, k)
    return C(n+k-1, k-1)
def count_game(k, n, x): #k players, n points total, no player can have x point or more
    if(k==0):
        if(n==0):
            return 1
        else:
            return 0
    ans=0
    for i in range(0, k+1):
        t=n-x*i
        # print(i, C(k, i))
        if(t<0):
            break
        if(i%2):
            ans=(ans-C(k, i)*candy(t, k))%base
        else:
            ans=(ans+C(k, i)*candy(t, k))%base
    return ans
p, s, r= list(map(int, input().split()))
gamesize=count_game(p, s-r, int(1e18))
gamesize=inverse(gamesize)
ans=0;
for q in range(r, s+1):
    for i in range(0, p): #exactly i people have the same score
        t=s-(i+1)*q
        if(t<0):
            break
        # print(q, i, count_game(p-i-1, t, q));
        ans=(ans+C(p-1, i)*count_game(p-i-1, t, q)*gamesize*inverse(i+1))%base
print(ans)