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:

When someone clicks the button "&lt;&lt;" he is redirected to page 1, and when someone clicks the button "&gt;&gt;" 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 "&lt;&lt;" must not be printed. -  If page *n* is in the navigation, the button "&gt;&gt;" 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*)
'''
 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:
                        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]))