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

Starter code:

Solutions:
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('(' + str(p) + ')', end = ' ')

for i in range(p + 1, p + k + 1):
	if (i < (n + 1)):
		print(i, end = ' ')

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


n, p, k = list(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 = map(int, input().split())
if p - k > 1:
    print('<<' , end = ' ')
for i in range(p - k, p) :
    if(i > 0) :
        print(i, end = ' ')
print('(' + str(p) + ')', end = ' ')
for i in range(p + 1, p + k + 1) :
    if(i <= n) :
        print(i, end = ' ');
if p + k < n:
    print('>>', end = ' ')


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


n, p, k = list(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)


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 )


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

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

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

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


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

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())
    #t = [(int(x)-1,i+1) for i,x in enumerate(input().split())]
    #l,r = list(range(n)), list(range(n))
    #for i in range(n):
    #    l[i],r[i] = map(int,input().split())
#    t = [map(int,input().split()) for x in range(n)]
    main(n,p,k)

def __starting_point():
    main_input()

__starting_point()

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 = [int(x) for x in input().split()]
s = ''
if p > k + 1:
    s += "<< "
for i in range(max(1, p-k), p):
    s += str(i) + ' '
s += '('+str(p)+') '
for i in range(p + 1, min(n, p+k)+1):
    s += str(i) + ' '
if p + k < n:
    s += '>>'
print(s)

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


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:
    print(">>",end=" ")


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


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 )


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

s = '({})'.format(p)
for i in range(1,k + 1):
    # if p - i == 0:
    #     s = '<< ' + s
    if p - i > 0:
        s = str(p - i) + ' ' + s
    # if p + i == n + 1:
    #     s = s + ' >>'
    if p + i <= n:
        s = s + ' ' + str(p + i)
if p - k > 1:
    s = '<< ' + s
if p + k < n:
    s = s + ' >>'
print(s)

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

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