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.

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int p = in.nextInt();
        int k = in.nextInt();
        int lo = Math.max(p-k,1);
        int hi = Math.min(p+k,n);
        if(lo != 1){
            out.print("<<");
        }
        for(int i = lo; i <= hi; ++i){
            if(i != p){
                out.print(" " + i);
            } else {
                out.print(" (" + i + ")");
            }
        }
        if(hi != n){
            out.print(" >>");
        }
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt(){
        return Integer.parseInt(next());
    }

}

import java.util.Scanner;

public class ProblemA {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt(); 	//Total Pages
		int p = scanner.nextInt(); 	//Current Page
		int k = scanner.nextInt(); 	//Page Range
		int i; 						//Loop Counter

		if (p - k > 1) {System.out.print("<< ");}

		for(i = p - k; i <= p + k; i++) {
			if(i <= 0) {continue;}
			if(i == p) {
				System.out.print("(" + p + ") ");
				continue;
				}
			if(i > n) {break;}
			System.out.print(i + " ");
		}

		if(i < n+1) {System.out.print(">>");}
	}
}

import java.util.Scanner;

public class Practica_1 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int p = in.nextInt();
        int k = in.nextInt();
        String prin[] = {"1", "(1)", n + "", "(" + n + ")"};
        String cdn = "(" + p + "" + ")";
        int count = 1;
        while (count <= k) {
            int rest = p - count;
            if (rest >= 1) {
                cdn = rest + " " + cdn;
            }
            int suma = p + count;
            if (suma <= n) {
                cdn = cdn + " " + suma;
            }
            count++;
        }
        String array[] = cdn.split(" +");
        int a = 0, b = 0;
        for (int i = 0; i < prin.length; i++) {
            if (array[0].equals(prin[i])) {
                a = 1;
            } else if (array[array.length - 1].equals(prin[i])) {
                b = 1;
            }
        }
        if (a == 0) {
            cdn = "<<" + " " + cdn;
        }
        if (b == 0) {
            cdn = cdn + " " + ">>";
        }
        System.out.println(cdn);
    }
}

import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
public class da {
    public static void main(String args[]) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader sc = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        int n = sc.nextInt(), p = sc.nextInt(), k = sc.nextInt();
        if (p - k > 1) {
            out.print("<< ");
        }
        for (int pageNo = p-k; pageNo <= p+k; pageNo++) {
            if(pageNo>=1&&pageNo<=n)
            out.printf(pageNo == p ? "(%d) " : "%d ", pageNo);
        }
        if (p + k < n)
            out.print(">>");
        out.close();
    }

    public static void shuffle(long[] arr) {
        int n = arr.length;
        Random rnd = new Random();
        for (int i = 0; i < n; ++i) {
            long tmp = arr[i];
            int randomPos = i + rnd.nextInt(n - i);
            arr[i] = arr[randomPos];
            arr[randomPos] = tmp;
        }
    }

    public static void shuffle(int[] arr) {
        int n = arr.length;
        Random rnd = new Random();
        for (int i = 0; i < n; ++i) {
            int tmp = arr[i];
            int randomPos = i + rnd.nextInt(n - i);
            arr[i] = arr[randomPos];
            arr[randomPos] = tmp;
        }
    }
    public static int gcd(int x, int y) {
        if (y == 0)
            return x;
        return gcd(y, x % y);
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.valueOf(next());
        }

        public double nextDouble() {
            return Double.valueOf(next());
        }

        String nextLine() throws IOException {
            return reader.readLine();
        }

    }
}

import java.util.Scanner;

public class pages {

    public static void main(String[]args)
    {
        int n,p,k;

        Scanner in = new Scanner(System.in);

        n = in.nextInt();
        p = in.nextInt();
        k = in.nextInt();

        int first;

        if( p == 1)
            first = 1;
        else
            first = p - k;

        int last;

        if( p == n || (p + k > n))
            last = n;
        else
            last = p + k;

        if(first > 1)
            System.out.print("<<");

        for( int current = first ; current <= last; current++)
        {

            if(current < 1)
                continue;
            else
                if(current == p)
                    System.out.printf(" (%d)", current);
                else
                    System.out.printf(" %d", current);
        }

        if(last != n)
            System.out.print(" >>");
    }

}

import java.util.*;

public class Solution{

    public static void main(String args[]){
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt(),p=sc.nextInt(),k=sc.nextInt();

        int i=p-k;
        if(i>1)
        	System.out.print("<< ");
        int x=(n>p+k)?(p+k):n;
        if(i<=0)
        	i=1;
        for(;i<=x;i++){
        	if(i==p)
        		System.out.print("("+i+") ");
        	else
        	System.out.print(i+" ");

        }

        if(i<=n)
        	System.out.print(">> ");
    }
}

import java.util.Scanner;

public class Rd233_div2_q1
{
    public static void main(String...args) throws Exception
    {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int p = in.nextInt();
        int k = in.nextInt();
        if(p-k>1) System.out.print("<< ");
        int i=1;
        if(p-k>1) i = p-k;
        for(; i<=p+k && i<=n; ++i)
        {
            if(i==p) System.out.print("("+i+") ");
            else System.out.print(i+" ");
        }
        if(p+k<n) System.out.print(">>");
    }
}

import java.io.PrintWriter;
import java.util.Scanner;

public class A {

	static Scanner sc = new Scanner(System.in);
	static PrintWriter out = new PrintWriter(System.out);

    static void exit() {
    	sc.close();
    	out.close();
    	System.exit(0);
    }

    public static void main(String[] args) {
    	int n = sc.nextInt();
    	int p = sc.nextInt();
    	int k = sc.nextInt();
    	StringBuilder o = new StringBuilder("");
    	if(p-k > 1) o.append("<<");
    	for(int i = Math.max(p-k, 1); i < p; i++) {
    		o.append(" "+i);
    	}
    	o.append(" ("+p+")");
    	for(int i = p+1; i <= Math.min(n, p+k); i++) {
    		o.append(" "+i);
    	}
    	if(p+k < n) o.append(" >>");
    	out.println(o.toString().trim());
        exit();
    }
}

import java.util.*;
public class navigation{
    public static void main(String args[]){
        Scanner scan =new Scanner(System.in);
        int n;
        int p;
        int k;
        int i;
        n=scan.nextInt();
        p=scan.nextInt();
        k=scan.nextInt();
        scan.close();
        if(p<1||p>n) {
        	System.exit(0);
        }
          if(p-k>0){
            i=p-k;
        }
        else{
            i=1;
        }
   if(p-k>1){

            System.out.print("<<");
            System.out.print(" ");
            }

        for( ;i<p;i++){

                System.out.print(i);
                System.out.print(" ");
             }
               if(i==p){
                    System.out.print("("+i+")");
                    System.out.print(" ");

                }
            if(p+k>=n){

            for( i=p+1;i<=n;i++){

                System.out.print(i);
                System.out.print(" ");

            }
            }

            if(p+k<n){
            for(i=p+1;i<=p+k;i++){
                System.out.print(i);
                System.out.print(" ");
            }

            System.out.print(">>");
        }
    }
}

import java.io.IOException;
import java.util.Scanner;

public class Solutions {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n, p, k;
		n = sc.nextInt();
		p = sc.nextInt();
		k = sc.nextInt();

		String res = "("+ p +")";
		String beg = "";
		if(p - k > 1)
			beg = "<< ";
		for(int i = Math.max(p-k, 1); i < p; i++) {
			beg += i + " ";
		}
		String end = "";
		for(int i = p + 1; i <= Math.min(p + k, n); i++) {
			end += " " + i;
		}

		if(p + k < n)
			end += " >>";

		System.out.println((beg + res + end ).trim());

		sc.close();
	}

}

import java.util.*;
import java.io.*;

public class Solution{
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        StringTokenizer st = new StringTokenizer(br.readLine());

        int n = Integer.parseInt(st.nextToken());
        int p = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());

        int[] arr = new int[2*k+1];

        for(int i = p-k,index = 0;i<=p+k;i++,index++){
            arr[index] = i;
        }

        StringBuilder ans = new StringBuilder("");

        boolean hasOne = false;
        boolean hasN = false;

        for(int i : arr){
            if(i == 1)hasOne = true;
            if( i == n)hasN = true;

            if(i == p)ans.append("("+i+") ");
            else if(i > 0 && i <= n){
                ans.append(i+" ");
            }
        }
        if(!hasOne)ans.insert(0,"<< ");
        if(!hasN)ans.append(">>");

        System.out.println(ans.toString());

    }
}

import java.util.*;
public class MyClass {
    public static void main(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int p = s.nextInt();
        int k = s.nextInt();

        if(p-k > 1)
        {
            System.out.print("<< ");
        }
        int start = (p-k);
        if(start <= 0)
        {
            start = 1;
        }
        for(int i = start ; i >= 1 && i < p ; i++)
        {
            System.out.print(i + " ");
        }

        System.out.print("(" + p + ") ");

        for(int i = p+1 ; i <= n && i < p+k+1 ; i++)
        {
            System.out.print(i + " ");
        }

        if(p+k < n)
        {
            System.out.print(">>");
        }
    }
}

//package cf_399A;

import java.util.Scanner;

public class Main {
	static final String lft = "<<";
	static final String rgt = ">>";

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n, p, k;
		int end, strt;
		boolean placeLFT = true;
		boolean placeRGT = true;
		String result = "";
		n = s.nextInt();// # of pages
		p = s.nextInt();// current page
		k = s.nextInt();// # of pages in each side
		if (p - k <= 1) {
			strt = 1;
			placeLFT = false;
		} else {
			strt = p - k;
		}
		if (p + k >= n) {
			end = n;
			placeRGT = false;
		} else {
			end = p + k;
		}
		if (placeLFT) {
			result += lft + " ";
		}
		for (int i = strt; i <= end; i++) {
			if (i == p) {
				result += "(" + i + ")";
			} else {
				result += i;
			}
			if (i != end) {
				result += " ";
			}

		}
		if (placeRGT) {
			result += " " + rgt;
		}
		System.out.println(result);
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);

		String[] str = br.readLine().split(" ");
		int n = Integer.parseInt(str[0]);
		int p = Integer.parseInt(str[1]);
		int k = Integer.parseInt(str[2]);

		String answer = "";
		if (p-k > 1) answer += " <<";
		for (int i = Math.max(1,p-k); i < p; i++) answer += " "+i;
		answer += " ("+p+")";
		for (int i = p+1; i <= Math.min(n,p+k); i++) answer += " "+i;
		if (p+k < n) answer += " >>";

		pw.println(answer.trim());

		pw.close();
		br.close();
	}
}

import java.util.*;
import java.awt.Point;
import java.io.*;
import java.math.BigInteger;

public class A1
{
    FastScanner in;
    PrintWriter out;

    public void solve() throws IOException
    {
    	int n = in.nextInt();
    	int p = in.nextInt();
    	int k = in.nextInt();

    	boolean showLeft  = true;
    	boolean showRight = true;

    	if(p - k <= 1)
    		showLeft = false;

    	if(p + k >= n)
    		showRight = false;

    	if(showLeft)
    		out.print("<< ");

    	for(int i = Math.max(1, p - k); i <= Math.min(n, p + k); i++)
    	{
    		if(i == p)
    		{
    			out.print("(");
    			out.print(i);
    			out.print(")");
    		}
    		else
    			out.print(i);

    		out.print(" ");
    	}

    	if(showRight)
    		out.print(">>");
    }

    public void run() {
        try {
            //in  = new FastScanner(new File("sum.in"));
            //out = new PrintWriter(new File("sum.out"));

        	in  = new FastScanner();
        	out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner() {

            br = new BufferedReader(new InputStreamReader(System.in));

        }

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        int[] nextIntArray(int size)
        {
    		int[] array = new int[size];

    		for (int i = 0; i < size; i++){
    			array[i] = nextInt();
    		}

    		return array;
    	}

        long[] nextLongArray(int size)
        {
    		long[] array = new long[size];

    		for (int i = 0; i < size; i++){
    			array[i] = nextLong();
    		}

    		return array;
    	}

        BigInteger nextBigInteger()
        {
    		return new BigInteger(next());
    	}

    	Point nextIntPoint()
    	{
    		int x = nextInt();
    		int y = nextInt();
    		return new Point(x, y);
    	}

    	Point[] nextIntPointArray(int size)
    	{
    		Point[] array = new Point[size];

    		for (int index = 0; index < size; ++index){
    			array[index] = nextIntPoint();
    		}

    		return array;
    	}

    	List<Integer>[] readGraph(int vertexNumber, int edgeNumber, boolean undirected)
    	{
    		List<Integer>[] graph = new List[vertexNumber];

    		for (int index = 0; index < vertexNumber; ++index)
    		{
    			graph[index] = new ArrayList<Integer>();
    		}

    		while (edgeNumber-- > 0)
    		{
    			int from = nextInt() - 1;
    			int to   = nextInt() - 1;

    			graph[from].add(to);
    			if(undirected)
    				graph[to].add(from);
    		}

    		return graph;
    	}
    }

    public static void main(String[] arg)
    {
        new A1().run();
    }
}

import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(f.readLine());

        int n = Integer.parseInt(st.nextToken());
        int p = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());

        if (p - k <= 1) {

        } else {
        	System.out.print("<< ");
        }

        for (int i = Math.max(1, p - k); i < p; i++){
        	System.out.print(String.valueOf(i) + " ");
        }
        System.out.print("(" + String.valueOf(p) + ")");
        for (int i = p + 1; i < Math.min(n + 1, p + k + 1); i++) {
        	System.out.print(" " + String.valueOf(i));
        }

        if (p + k < n) {
        	System.out.print(" >>");
        }

        System.out.println();

	}
}

import java.io.*;    //PrintWriter
import java.math.*;  //BigInteger, BigDecimal
import java.util.*;  //StringTokenizer, ArrayList

public class R233_Div2_A //Name: Pages
{
	FastReader in;
	PrintWriter out;

	public static void main(String[] args)  {
		new R233_Div2_A().run();
	}

	void run()
	{
		in = new FastReader(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	void solve()
	{
		int n = in.nextInt();
		int p = in.nextInt();
		int k = in.nextInt();

		String s = "";
		if (p - k > 1) s += "<< ";
		for (int i = 1; i <= p + k && i <= n; i++)
			if (i >= p - k)
				if (i == p) s += "(" + i + ") ";
				else s += i + " ";
		if (p + k < n) s += ">> ";

		out.println(s.trim());
	}

	//-----------------------------------------------------
	void runWithFiles() {
		in = new FastReader(new File("input.txt"));
		try {
			out = new PrintWriter(new File("output.txt"));
		}
		catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		solve();
		out.close();
	}

	class FastReader
	{
	    BufferedReader br;
	    StringTokenizer tokenizer;

	    public FastReader(InputStream stream)
	    {
	        br = new BufferedReader(new InputStreamReader(stream));
	        tokenizer = null;
	    }
		public FastReader(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
				tokenizer = null;
			}
			catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

	    private String next() {
	        while (tokenizer == null || !tokenizer.hasMoreTokens())
	            try {
	            	tokenizer = new StringTokenizer(br.readLine());
	            }
	            catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        return tokenizer.nextToken();
	    }
		public String nextLine() {
			try	{
				return br.readLine();
			}
			catch(Exception e) {
				throw(new RuntimeException());
			}
		}

	    int nextInt() {
	        return Integer.parseInt(next());
	    }
	    long nextLong() {
	        return Long.parseLong(next());
	    }
	    double nextDouble() {
	        return Double.parseDouble(next());
	    }
	    BigInteger nextBigInteger() {
	        return new BigInteger(next());
	    }
	    BigDecimal nextBigDecimal() {
	        return new BigDecimal(next());
	    }
	}
}

import java.util.ArrayList;
import java.util.Scanner;

public class Pages {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int n=scn.nextInt();
        int p=scn.nextInt();
        int k=scn.nextInt();
        int len=2*k+1;
      //  int [] arr= new int[len];
        ArrayList<Integer> arr= new ArrayList<>();

        k=-1*k;
        for(int i=0;i<len;i++)
        {
            int x=p+k;
            if(x<1)
            {
                k++;
                continue;
            }
            if(x>n)
            {
                break;
            }
          arr.add(p+k);
            k++;

        }
//        System.out.println(arr);
//        for(int i:arr)
//        {
//            System.out.print(i);
//            System.out.print(" ");
        for(int i=0;i<arr.size();i++)
        {

             if(i==0 &&arr.get(i)!=1)
            {
              System.out.print("<<"+" ");
                System.out.print(arr.get(i)+" ");
                continue;

            }
            else if(arr.get(i)==1 &&p!=1)
            {
                System.out.print(1+" ");
                continue;
            }
            else if(arr.get(i)==p)
            {
                System.out.print("("+p+")"+" ");
            }
            else if(i==arr.size()-1 &&arr.get(i)!=n)
            {
                System.out.print(arr.get(i)+" ");
                System.out.print(">>");
                break;
            }
            else if(arr.get(i)==n)
            {
                System.out.print(n);
                break;
            }
            else
            {
                System.out.print(arr.get(i)+" ");
            }
        }

    }
}

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.TreeSet;

/**
 * 4 4
 * 1 5 3 4
 * 1 2
 * 1 3
 * 2 3
 * 3 3
 *
 * @author pttrung
 */
public class A {

    public static int Mod;

    public static void main(String[] args) throws FileNotFoundException {
        Scanner in = new Scanner();
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File("pulp.out")));
        PrintWriter out = new PrintWriter(System.out);
        // System.out.println(Long.MAX_VALUE);
        int n = in.nextInt();
        int p = in.nextInt();
        int k = in.nextInt();
        ArrayList<Integer> list = new ArrayList();
        for(int i = Math.max (1 , p - k); i <= Math.min(n , p + k); i++){
            list.add(i);
        }
        if(list.get(0) != 1){
            out.print("<<");
        }
        for(int i = 0; i < list.size(); i++){
            if(list.get(i) == p){
                out.print(" (" + list.get(i) + ")");
            }else{
                out.print(" " + list.get(i));
            }
        }
        if(list.get(list.size() - 1) != n){
            out.println(" >>");
        }
        out.close();

    }

    public static class Plot implements Comparable<Plot> {

        long day;
        long num;

        public Plot(int a, int b) {
            this.day = a;
            this.num = b;
        }

        @Override
        public int compareTo(Plot o) {
            if (num > o.num) {
                return 1;
            } else if (num < o.num) {
                return -1;
            }
            return 0;
        }
    }

    public static int[][] powSquareMatrix(int[][] A, long p) {
        int[][] unit = new int[A.length][A.length];
        for (int i = 0; i < unit.length; i++) {
            unit[i][i] = 1;
        }
        if (p == 0) {
            return unit;
        }
        int[][] val = powSquareMatrix(A, p / 2);
        if (p % 2 == 0) {
            return mulMatrix(val, val);
        } else {
            return mulMatrix(A, mulMatrix(val, val));
        }

    }

    public static int[][] mulMatrix(int[][] A, int[][] B) {
        int[][] result = new int[A.length][B[0].length];
        for (int i = 0; i < result.length; i++) {
            for (int j = 0; j < result[0].length; j++) {
                long temp = 0;
                for (int k = 0; k < A[0].length; k++) {

                    temp += ((long) A[i][k] * B[k][j] % Mod);
                    temp %= Mod;
                }
                temp %= Mod;
                result[i][j] = (int) temp;
            }
        }

        return result;
    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    static class FT {

        int[] data;

        FT(int n) {
            data = new int[n];
        }

        void update(int index, int val) {
            // System.out.println("UPDATE INDEX " + index);
            while (index < data.length) {
                data[index] += val;
                index += index & (-index);

                //    System.out.println("NEXT " +index);
            }
        }

        int get(int index) {
            //  System.out.println("GET INDEX " + index);
            int result = 0;
            while (index > 0) {
                result += data[index];
                index -= index & (-index);
                // System.out.println("BACK " + index);
            }
            return result;
        }
    }

    static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        } else {
            return gcd(b, a % b);
        }
    }

    static long pow(long a, int b) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2);
        if (b % 2 == 0) {

            return val * val % Mod;
        } else {
            return (val * val % Mod) * a % Mod;
        }
    }

//    static Point intersect(Point a, Point b, Point c) {
//        double D = cross(a, b);
//        if (D != 0) {
//            return new Point(cross(c, b) / D, cross(a, c) / D);
//        }
//        return null;
//    }
//
//    static Point convert(Point a, double angle) {
//        double x = a.x * cos(angle) - a.y * sin(angle);
//        double y = a.x * sin(angle) + a.y * cos(angle);
//        return new Point(x, y);
//    }
//    static Point minus(Point a, Point b) {
//        return new Point(a.x - b.x, a.y - b.y);
//    }
//
//    static Point add(Point a, Point b) {
//        return new Point(a.x + b.x, a.y + b.y);
//    }
//
    /**
     * Cross product ab*ac
     *
     * @param a
     * @param b
     * @param c
     * @return
     */
    static double cross(Point a, Point b, Point c) {
        Point ab = new Point(b.x - a.x, b.y - a.y);
        Point ac = new Point(c.x - a.x, c.y - a.y);
        return cross(ab, ac);
    }

    static double cross(Point a, Point b) {
        return a.x * b.y - a.y * b.x;
    }

    /**
     * Dot product ab*ac;
     *
     * @param a
     * @param b
     * @param c
     * @return
     */
    static long dot(Point a, Point b, Point c) {
        Point ab = new Point(b.x - a.x, b.y - a.y);
        Point ac = new Point(c.x - a.x, c.y - a.y);
        return dot(ab, ac);
    }

    static long dot(Point a, Point b) {
        long total = a.x * b.x;
        total += a.y * b.y;
        return total;
    }

    static double dist(Point a, Point b) {
        long total = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
        return Math.sqrt(total);
    }

    static long norm(Point a) {
        long result = a.x * a.x;
        result += a.y * a.y;
        return result;
    }

    static double dist(Point a, Point b, Point x, boolean isSegment) {
        double dist = cross(a, b, x) / dist(a, b);
        // System.out.println("DIST " + dist);

        if (isSegment) {
            Point ab = new Point(b.x - a.x, b.y - a.y);

            long dot1 = dot(a, b, x);
            long norm = norm(ab);
            double u = (double) dot1 / norm;
            if (u < 0) {
                return dist(a, x);
            }

            if (u > 1) {
                return dist(b, x);
            }
        }
        return Math.abs(dist);
    }

    static class Point {

        int x, y;

        Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public String toString() {
            return "Point: " + x + " " + y;
        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            //System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            // br = new BufferedReader(new FileReader(new File("pulp.in")));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}

import java.util.Scanner;

public class round399problema {
	static Scanner in = new Scanner(System.in);

	public static void main(String[] args) {
		int up=in.nextInt();
		int c=in.nextInt();
		int r=in.nextInt();

		String s="("+c+") ";

		if(c-r<=1){
			for(int i=c-1;i>=1;i--){
				s=i+" "+s;
			}
		}
		else{
			for(int i=c-1;i>=c-r;i--){
				s=i+" "+s;
			}
			s="<< "+s;

		}

		if(c+r>=up){
			for(int i=c+1;i<=up;i++){
				s=s+i+" ";
			}
		}
		else{
			for(int i=c+1;i<=c+r;i++){
				s=s+i+" ";
			}
			s=s+">>";
		}
		System.out.print(s);
	}
}

import java.util.*;

public class Easy
{
public static void main(String[] args)
{
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int p=sc.nextInt();
    int k=sc.nextInt();

    int st;
    if(p-k>1)
    {
    System.out.print("<< ");
    st=p-k;
    }
    else
    {
        st=1;
    }

    for(;st<=p+k&&st<=n;st++)
    {
        if(st==p)
        System.out.print("("+st+") ");
        else
         System.out.print(st+" ");
    }

    if(n!=st-1)
     System.out.print(">>");

}
}

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class CF {

	public static void main(String[] args) {
		FasterScanner sc = new FasterScanner();
		PrintWriter out = new PrintWriter(System.out);
		int N = sc.nextInt();
		int P = sc.nextInt();
		int K = sc.nextInt();
		int start = P-K;
		int end = P+K;
		if(start>1)out.print("<< ");
		for(int a=start;a<=end;a++){
			if(a<=0||a>N)continue;
			if(a==P)out.print("("+a+") ");
			else out.print(a+" ");
		}

		if(end<N)out.print(">> ");
		out.close();
	}

	static class FasterScanner{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public FasterScanner(){
			stream = System.in;
			//stream = new FileInputStream(new File("dec.in"));

		}
		int read(){
			if(numChars==-1)
				throw new InputMismatchException();
			if(curChar>=numChars){
				curChar = 0;
				try{
					numChars = stream.read(buf);
				} catch (IOException e){
					throw new InputMismatchException();
				}
				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c){
			return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
		}
		boolean isEndline(int c){
			return c=='\n'||c=='\r'||c==-1;
		}
		int nextInt(){
			return Integer.parseInt(next());
		}
		long nextLong(){
			return Long.parseLong(next());
		}
		double nextDouble(){
			return Double.parseDouble(next());
		}
		String next(){
			int c = read();
			while(isSpaceChar(c))
				c=read();
			StringBuilder res = new StringBuilder();
			do{
				res.appendCodePoint(c);
				c=read();
			} while(!isSpaceChar(c));
			return res.toString();
		}
		String nextLine(){
			int c = read();
			while(isEndline(c))
				c=read();
			StringBuilder res = new StringBuilder();
			do{
				res.appendCodePoint(c);
				c = read();
			}while(!isEndline(c));
			return res.toString();
		}

	}

}

import java.util.Scanner;
/*
http://codeforces.com/contest/399/problem/A
*/
public class Pages {

	public static void solve(int n, int p, int k) {
		StringBuffer buffer = new StringBuffer();
		if (p - k > 1) {
			buffer.append("<<").append(" ");
		}
		int i;
		for (i = Math.max(p - k, 1); i <= p + k; i++) {
			if (i > n) {
				break;
			}
			if (i == p) {
				buffer.append("(" + i + ")").append(" ");
			} else {
				buffer.append(i).append(" ");
			}
		}
		if (i <= n) {
			buffer.append(">>");
		}
		System.out.print(buffer.toString().trim());
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int p = in.nextInt();
		int k = in.nextInt();
		solve(n, p, k);
	}
}

import java.util.*;

public class Main {

    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int p = s.nextInt();
        int k = s.nextInt();
        int minPage = Math.max(1,p-k);
        int maxPage = Math.min(n, p+k);
        String index = "";
        if(p-k>1) index+="<< ";
        for(int i = minPage; i<=maxPage; i++){
            if(i==p) index+= "("+i+") ";
            else index+= i+" ";
        }
        if(p+k<n) index+=">>";
        System.out.println(index);
    }
}

import java.util.*;

public class Solution {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int n = scanner.nextInt();
    int p = scanner.nextInt();
    int k = scanner.nextInt();

    boolean print_1 = (p-k > 1);
    boolean print_n = (p+k < n);

    int first = Math.max(1,p-k);
    int last = Math.min(n, p+k);

    if(print_1) System.out.print("<< ");

    for(int i=first; i<=last; i++) {
      if(i==p) System.out.print("(");
      System.out.print(i);
      if(i==p) System.out.print(")");
      System.out.print(" ");
    }

    if(print_n) System.out.print(">>");
    System.out.println();
  }
}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class navi
{
    public static void main(String args[])
    {
        int flag=0;
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        int k=sc.nextInt();
        if(p-k>1)
        System.out.print("<< ");
        for(int i=p-k;i<=p+k;i++)
        {
            if(i<n)
            {
            if(i<=0) continue;

            if(i==p)
            System.out.print("("+i+") ");
            else
            System.out.print(i+" ");
        }
        else
            if(i==n)
            {
                if(n==p)
                System.out.print("("+i+")");
                else
                System.out.print((i));
                flag++;
                break;
            }

        }
         if(flag==0)
            System.out.print(" >>");

    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 * Created with IntelliJ IDEA.
 * User: AUtemuratov
 * Date: 02.04.14
 * Time: 9:44
 * To change this template use File | Settings | File Templates.
 */
public class Main {

    static int n,p,k;
    static int b[][] = new int[111][111];
    static int a[] = new int[111];
    public static void main (String [] args) throws Exception {

        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        String s = bf.readLine();
        StringTokenizer tk = new StringTokenizer(s," ");
        n = Integer.parseInt(tk.nextToken());
        p = Integer.parseInt(tk.nextToken());
        k = Integer.parseInt(tk.nextToken());

        if (p-k>1) {
            System.out.print("<< ");
        }

        for (int i=p-k; i<p; i++) {
            if (i<1) continue;
            System.out.print(i + " ");
        }

        System.out.print("(" + p + ") ");

        for (int i=p+1; i<=p+k; i++) {
            if (i>n) break;
            System.out.print(i + " ");
        }

        if (p+k<n) {
            System.out.print(">>");
        }

        pw.close();
    }
}

import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int p = scan.nextInt();
        int k = scan.nextInt();

        if(p-k == 1){
            for(int i = (p-k); i<=p-1; i++)
                System.out.print(i+" ");
        }
        else if(p-k <1){
            for(int i = 1; i<=p-1; i++)
                System.out.print(i+" ");
        }
        else if(p-k >1){
            System.out.print("<< ");
            for(int i = (p-k); i<=p-1; i++)
                System.out.print(i+" ");
        }
        System.out.print("("+p+") ");

        if(p+k == n){
            for(int i = (p+1); i<=n; i++ )
                System.out.print(i+" ");
        }
        else if(p+k < n){
            for(int i = (p+1); i<=p+k; i++ )
                System.out.print(i+" ");
            System.out.print(">>");
        }
        else{
            for(int i = (p+1); i<=n; i++ )
                System.out.print(i+" ");
        }

    }
}

import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), p = sc.nextInt(), k = sc.nextInt();
		int end, start;
		if(p + k < n){
			end = p + k;
		} else {
			end = n;
		}
		if(p - k < 1){
			start = 1;
		} else {
			start = p - k;
		}
		// System.out.println(start + " " + end);
		String s = "";
		for(int i = start; i <= end; i++){
			if(i == p){
				s += "(" + p + ") ";
			} else {
				s += i + " ";
			}
		}
		// System.out.println(s);
		StringBuffer ss = new StringBuffer("<< ");
		ss.append(s);
		ss.append(">>");

		if(start == 1){
			ss.replace(0, 3, "");
		}
		if(end == n){
			ss.replace(ss.length() - 3, ss.length(), "");
		}

		// s = ss.toString();
		System.out.println(ss.toString());

	}
}

//package round233;

import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		Scanner leer=new Scanner(System.in);
		int n=leer.nextInt();
		int p=leer.nextInt();
		int k=leer.nextInt();
		int a=0,b=0;
		String res="",fin="";
		if(p-k>1){
			a=p-k;
			res="<< ";
		}else{
			a=1;
		}
		if(p+k<n){
			b=p+k;
			fin=">>";
		}else{
			b=n;
		}
		for (int i = a; i <= b; i++) {
			if(i==p)
			res+="("+i+") ";else
				res+=i+" ";
		}
		System.out.println(res+fin);
	}

}

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int n = input.nextInt(), p = input.nextInt(), k = input.nextInt();
        List<String> res = new ArrayList<>();

        if (p - k <= 1) {
            for (int i = 1; i < p; i++) {
                res.add(String.valueOf(i));
            }
        } else {
            res.add("<<");
            for (int i = (p - k); i < p; i++) {
                res.add(String.valueOf(i));
            }
        }

        res.add("(" + p + ")");

        if (p + k >= n) {
            for (int i = p + 1; i <= n; i++) {
                res.add(String.valueOf(i));
            }
        } else {
            for (int i = p + 1; i <= (p + k); i++) {
                res.add(String.valueOf(i));
            }
            res.add(">>");
        }

        res.forEach((re) -> {
            System.out.print(re + " ");
        });

        input.close();
    }

}

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner leer = new Scanner(System.in);
		int n,p,k;
		n = leer.nextInt();
		p = leer.nextInt();
		k = leer.nextInt();
		String ans = "";
		for(int i = p - k; i <= p + k ; i++){
			if(i >= 1 && i <= n){
				if(i == p){
					ans += "("+p+") ";
				}else{
					ans += i + " ";
				}
			}
		}
		if(p - k > 1)
			ans = "<< " + ans;
		if(p + k < n)
			ans += ">>";
		System.out.println(ans);
	}

}

import java.io.*;
import java.util.*;

public class Main {
  public static void main(String args[]) throws IOException {
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    String line;
    String[] prms;

    line = stdin.readLine();
    prms = line.split(" ");
    int n = Integer.parseInt(prms[0]);
    int p = Integer.parseInt(prms[1]);
    int k = Integer.parseInt(prms[2]);

    boolean f = false;
    if (p-k > 1) {
      System.out.print("<<");
      f = true;
    }
    for (int i = -k; i <= k; i++) {
      int c = p + i;
      if (c < 1 || c > n) continue;
      if (f) System.out.print(" ");
      if (c == p) {
        System.out.print("("+c+")");
        f = true;
      } else if (c >= 1 && c <= n) {
        System.out.print(c);
        f = true;
      }
    }
    if (p+k < n) {
      System.out.print(" >>");
    }

    System.out.println();
  }
}

import java.util.*;
import java.io.*;

public class ndaidemf {
	public static void main(String[] args) {
		new ndaidemf();
	}

	ndaidemf() {
		Scanner s = new Scanner(System.in);
		System.err.println("");

		int n = s.nextInt();
		int p = s.nextInt();
		int k = s.nextInt();
		int start = p-k, end = p+k;

		if(start > 1) System.out.print("<< ");

		for(int i = Math.max(1, start); i <= Math.min(n, end); i++) {
			if(i == p) {
				System.out.print("("+p+") ");
			}
			else {
				System.out.print(i+ " ");
			}
		}

		if(end < n) System.out.println(">>");

	}
}

import java.util.Scanner;

public class CmdTest {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] input = sc.nextLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int p = Integer.parseInt(input[1]);
        int k = Integer.parseInt(input[2]);
        String answer = "";

        //Beginning
        if (p - k > 1) {
            answer += "<< ";
            for (int i= p-k; i<p; i++){
                answer += i +" ";
            }
        } else {
            for (int i=1 ; i<p; i++){
                answer += i +" ";
            }
        }
        //Current
        answer += "("+p+") ";

        //Ending
        if ( n-p > k){
            for (int i=p+1; i<=p+k; i++){
                answer += i +" ";
            }
            answer += ">>";

        } else {
            for (int i=p+1 ; i<=n; i++){
                answer += i +" ";
            }

        }
        System.out.println(answer);
    }
}

import java.util.Scanner;
import java.io.*;

public class Pages
{
	public static void main(String[] args) throws IOException
	{
		Scanner kb = new Scanner(System.in);
		int n = kb.nextInt();
		int p = kb.nextInt();
		int k = kb.nextInt();

		int a = p - k;
		int b = p + k;

		boolean left = true;
		boolean right = true;

		if (a<=1)
		{
			left = false;
		}
		if (b>=n)
		{
			right = false;
		}

		String s = "";
		if (left)
		{
			s += "<< ";
		}

		for (int i = a; i <= b; i++)
		{
			if (i < 1 || i > n)
			{
			}
			else if (i == p)
			{
				s += "(" + p + ") ";
			}
			else
			{
				s += i + " ";
			}
		}
		if (right)
		{
			s += ">>";
		}
		System.out.println(s);
	}
}

import java.util.Scanner;

public class Div233div2Task1 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n=scanner.nextInt();
        int k=scanner.nextInt();
        int p=scanner.nextInt();
        boolean flagBegin=(k-p<=1)?false:true;
        boolean flagEnd=(k+p>=n)?false:true;
        int begin=(flagBegin)?k-p:1;
        int end=(flagEnd)?k+p:n;
        if(flagBegin)
            System.out.print("<< ");
        for(int i=begin;i<=end;i++){
            if(i==k)
                System.out.print("("+i+") ");
            else
            System.out.print(i+" ");
        }
        if(flagEnd)
            System.out.print(">>");

    }

}

import java.io.PrintWriter;
import java.util.Scanner;

public class A {

	static Scanner sc = new Scanner(System.in);
	static PrintWriter out = new PrintWriter(System.out);

    static void exit() {
    	sc.close();
    	out.close();
    	System.exit(0);
    }

    public static void main(String[] args) {
    	int n = sc.nextInt();
    	int p = sc.nextInt();
    	int k = sc.nextInt();
    	StringBuilder o = new StringBuilder("");
    	if(p-k > 1) o.append("<<");
    	for(int i = Math.max(p-k, 1); i < p; i++) {
    		o.append(" "+i);
    	}
    	o.append(" ("+p+")");
    	for(int i = p+1; i <= Math.min(n, p+k); i++) {
    		o.append(" "+i);
    	}
    	if(p+k < n) o.append(" >>");
    	out.println(o.toString().trim());
        exit();
    }
}

import java.util.Scanner;

public class Pages {
    static private int n;
    static private int p;
    static private int k;
    static private int strIndex;
    static private int strEndIndex;
    static private StringBuilder navigationStr = new StringBuilder();
    static private Scanner scanner = new Scanner(System.in);

    public static void main(String[] args) {
        n = scanner.nextInt();
        p = scanner.nextInt();
        k = scanner.nextInt();

        if(p - k <= 1) {
            strIndex = 1;
        }
        else {
            strIndex = p - k;
            navigationStr.append("<< ");
        }
        for (; strIndex < p; strIndex++) {
            navigationStr.append(strIndex + " ");
        }
        // Now, strIndex = p
        navigationStr.append("(" + p + ")");
        strIndex++;

        if(p + k >= n) {
            strEndIndex = n;
        }
        else {
            strEndIndex = p + k;
        }
        for(; strIndex < strEndIndex + 1; strIndex++) {
            navigationStr.append(" " + strIndex);
        }
        if(strIndex != n + 1)
        {
            navigationStr.append(" >>");
        }

        System.out.println(navigationStr.toString());
    }
}

import java.util.Scanner;

public class Cf399a {
    public static void main(String[] args) {
        int n, p, k;
        String outputL = "";
        String outputR = "";
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        p = scanner.nextInt();
        k = scanner.nextInt();

        if ((n >= 3) && (n <= 100) && (p >= 1) && (p <= n) && (1 <= k && k <= n)) {
            if (p - k > 1) {
                outputL += "<< ";
                for (int i = p - k; i < p; i++) {
                    outputL = outputL + i + " ";
                }
            } else {
                for (int i = 1; i < p; i++) {
                    outputL = outputL + i + " ";
                }
            }
            if (p + k < n) {
                for (int i = p + 1; i <= p + k; i++) {
                    outputR = outputR + i + " ";
                }
                outputR += ">>";
            } else {
                for (int i = p + 1; i <= n; i++) {
                    outputR = outputR + i + " ";
                }
            }
            outputL = outputL + "(" + p + ") " + outputR;
        }
        if (!outputL.isEmpty()) System.out.println(outputL.trim());
    }
}

import java.util.Scanner;

public class Pages {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt(), p = scan.nextInt(), k = scan.nextInt();

        StringBuilder res = new StringBuilder();

        if (p - k > 1) res.append("<< ");
        for (int i = Math.max(1, p - k); i < p; i++)
            res.append(Integer.toString(i) + " ");
        res.append("(" + Integer.toString(p) + ")");
        for (int i = p + 1; i <= p + k && i <= n; i++)
            res.append(" " + Integer.toString(i));
        if (p + k + 1 <= n) res.append(" >>");

        System.out.println(res.toString());
        scan.close();

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String args[]) throws IOException{
        BufferedReader b= new BufferedReader(new InputStreamReader(System.in));
        String s=b.readLine();
        int n = 0,p=0,k=0;
        String t="";
        for(int i = 0 ; i < s.length();i++){
            if(s.charAt(i)!=' '){
                t+=s.charAt(i);
                            }
            else{
                if(n==0){
                    n=Integer.parseInt(t);
                t="";}
                else{
                    p=Integer.parseInt(t);t="";
                }
            }
        }
        k=Integer.parseInt(t);

        //System.out.printf(k+""+n+""+p);

        int x=Math.abs(p-k);
        if(x==0)x+=1;
        if(k>p)x=1;
        int x2=Math.abs(p+k)<=n?Math.abs(p+k):n;
        int i=x;
        t="";
        do
        {
    if(x>1 && i==x){
        t+="<< ";
    }if(i==p)
    t+="("+i+") ";
    else
        t+=""+i+" ";
    if(p+k<n && i==p+k){
        t+=">>";
    }
    i++;
        }while(i<=x2);
        System.out.printf(t);
    }
}

import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main {
    public static Scanner scanner = new Scanner(new BufferedInputStream(System.in));

    public static boolean check(int[] arr, int mid) {
        for (int starti = 0; starti < arr.length; starti += (1 << mid)) {
            for (int i = 1; i < (1 << mid); i++) {
                if (arr[starti + i - 1] > arr[starti + i]) {
                    break;
                }

                if (i == (1 << mid) - 1) {
                    return true;
                }
            }
        }
        return false;
    }

    public static void main(String args[]) {
        int n = scanner.nextInt();
        int p = scanner.nextInt();
        int k = scanner.nextInt();
        int l = p - k;
        if (l > 1) {
            System.out.print("<<");
        } else {
            l = 1;
        }

        while (l < p) {
            System.out.print(' ');
            System.out.print(l);
            l++;
        }
        System.out.print(' ');
        System.out.print('(');
        System.out.print(p);
        System.out.print(')');

        int r = p + 1;

        while (r <= p + k && r <= n) {
            System.out.print(' ');
            System.out.print(r);
            r++;
        }
        if (p + k < n) {
            System.out.println(" >>");
        } else {
            System.out.println();
        }
    }
}

import java.util.*;
public class test
{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        int k=sc.nextInt();
        int a=p-k;
        int b=p+k;
        String s="";
        if(a<1)
        a=1;
        if(b>n)
        b=n;
        if(a!=1)
        s=s.concat("<< ");
        for(int i=a;i<=b;i++)
        {
            if(i==p)
            s=s.concat("("+String.valueOf(i)+") ");
            else if(i==b)
            s=s.concat(String.valueOf(i));
            else
            s=s.concat(String.valueOf(i)+" ");

        }
        if(b!=n)
        s=s.concat(" >>");
        System.out.println(s);

    }
}

import java.util.Scanner;

public class Main {
	static int number;
	static int page;
	static int skip;
	static int lastPage = 0;

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		number = scanner.nextInt();
		page = scanner.nextInt();
		skip = scanner.nextInt();

		for (int i = 0; i <= number; i++) {
			if (i == page) {

				getPreviousPage();

				System.out.print("(" + page + ")");

				getNextPage();

			}

		}
	}

	private static void getNextPage() {

		if (number != page) {
			for (int j = 0; j < skip; j++) {
				if ((page + j + 1) <= number) {
					System.out.print(" " + (page + j + 1));

				}
				lastPage = page + j;
			}
			if ((lastPage + 1) < number) {
				System.out.print(" >>");
			}

		}

	}

	private static void getPreviousPage() {

		if ((page - skip) >= 2) {
			System.out.print("<< ");
		}
		for (int j = skip; j > 0; j--) {
			if ((page - j) > 0) {
				System.out.print(page - j + " ");
			}
		}

	}

}

//package com.company;
import java.math.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();
        int p = scn.nextInt();
        int k = scn.nextInt();
        for(int i=p-k;i<=p+k;i++) {
            if (i >= 1) {
                if (i == 1) {
                    break;
                } else {
                    System.out.printf("<< ");
                    break;
                }
            }
        }
        int i;
        int check = n;
        for(i = p-k;i<=p+k;i++){
            if(i <=0);
            else if(i == 1){
                if(i == p)
                    System.out.printf("(1) ");
                else
                    System.out.printf("1 ");
            }
            else if(i==p && i==n){
                System.out.printf("(%d) ",i);
                check = i;
                break;
            }
            else if(i==p)
                System.out.printf("(%d) ", i);
            else if(i<=n) {
                System.out.printf("%d ", i);
                if(i==n) {
                    check = i;
                    break;
                }
            }
            check = i;
        }
        if(check != n)
            System.out.printf(">> ");

    }
}

import java.util.Scanner;
public class Pages
{
    public static void main(String[] args)
    {
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    int p=s.nextInt();
    int k=s.nextInt();
     //prev
     if(p-k>1)
     {
         System.out.print("<<"+" ");
     }
     for(int i=k;i>0;i--)
     {
         if(p-i>0)
         System.out.print(p-i+" ");
     }
     System.out.print("("+p+")"+" ");
     //next
     for(int i=0;i<k&&(p<n);i++)
     {
        System.out.print(++p+" ");
     }
     if(p<n)
     {
         System.out.print(">>");
     }
    }
}

import java.util.Scanner;
/*
http://codeforces.com/contest/399/problem/A
*/
public class Pages {

	public static void solve(int n, int p, int k) {
		StringBuffer buffer = new StringBuffer();
		if (p - k > 1) {
			buffer.append("<<").append(" ");
		}
		int i;
		for (i = Math.max(p - k, 1); i <= p + k; i++) {
			if (i > n) {
				break;
			}
			if (i == p) {
				buffer.append("(" + i + ")").append(" ");
			} else {
				buffer.append(i).append(" ");
			}
		}
		if (i <= n) {
			buffer.append(">>");
		}
		System.out.print(buffer.toString().trim());
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int p = in.nextInt();
		int k = in.nextInt();
		solve(n, p, k);
	}
}

import java.util.Scanner;

public class First {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int total = scanner.nextInt();
		int current = scanner.nextInt();
		int lr = scanner.nextInt();
		if(current - lr > 1)
			System.out.print("<< ");
		for(int i = current - lr; i < current; i++){
			if(i < 1) continue;
			System.out.print(i + " ");
		}
		System.out.print("("+ current +") ");
		for(int i = current + 1; i < current + lr + 1; i++){
			if(i > total)break;
			System.out.print(i + " ");
		}
		if(current + lr < total)
			System.out.print(">>");
	}
}

import java.util.Scanner;

public class ProblemSet {
static int[]arr;

	public static void pages(int n , int p , int k) {
		//17  5   2
		if(p-k>1) {
			System.out.print("<<"+" ");
		}

		for(int i=p-k;i<=p+k;i++) {
			if(i>=1 && i<=n) {
				if(i==p) {
					System.out.print("("+i+")"+" ");
				}else {
					System.out.print(i+" ");
				}
			}
		}

		if(p+k<n) {
			System.out.print(">>");
		}

	}
	public static void main(String args[]) {
		Scanner scn = new Scanner(System.in);

		int n =scn.nextInt();
		int p= scn.nextInt();
		int k = scn.nextInt();
		pages(n,p,k);
	}

}

import java.util.Scanner;

/*
https://codeforces.com/problemset/problem/399/A
 */
public class Pages {
    public static void main(String[] args) {
        new Pages().run();
    }

    private void run() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p = sc.nextInt();
        int d = sc.nextInt();

        if(p-d >1){
            System.out.print("<< ");
            int i = p-d;
            while(i<p){
                System.out.print(i+" ");
                i++;
            }
        }else if(p-d <= 1){
            int i = 1;
            while(i<p) {
                System.out.print(i+" ");
                i++;
            }
        }
        System.out.print("("+p+") ");

        if(p+d < n){
            int i = p+1;
            while(i<=p+d) {
                System.out.print(i+" ");
                i++;
            }
            System.out.print(">>");
        }
        else if(p+d >= n){
            int i = p+1;
            while(i<=n){
                System.out.print(i+" ");
                i++;
            }
        }

    }
}

import java.util.*;
import java.io.*;

public class Main {

	BufferedReader in;
	StringTokenizer str = null;
	PrintWriter out;

	private String next() throws Exception{
		if (str == null || !str.hasMoreElements())
			str = new StringTokenizer(in.readLine());
		return str.nextToken();
	}

	private int nextInt() throws Exception{
		return Integer.parseInt(next());
	}

	private long nextLong() throws Exception{
		return Long.parseLong(next());
	}

	private double nextDouble() throws Exception{
		return Double.parseDouble(next());
	}

	public void run() throws Exception{
		in =  new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		int n = nextInt(), p = nextInt(), k = nextInt();
		if (p-k > 1)
		    out.print("<< ");
		for(int i=Math.max(1, p-k);i<p;i++)
		    out.print(i + " ");
		out.print("(" + p + ") ");
		for(int i=p+1;i<=Math.min(p+k, n);i++)
		    out.print(i + " ");
		if (p + k < n)
		    out.print(">>");
		out.println();
		out.close();
	}

	public static void main(String[] args) throws Exception{
		new Main().run();
	}
}

import java.util.Scanner;

public class Pages {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p = sc.nextInt();
        int k = sc.nextInt();

        if(p - k > 1){
            System.out.print("<< ");
        }
        for(int i = 0; i < k; i++){
            if(p - k + i < 1){
            continue;
            }
            System.out.print(p - k + i);
            System.out.print(" ");
        }
        System.out.print("(" + p + ") ");

        for(int i = 1; i <= k; i++){
            if(p + i > n){
                continue;
            }
                System.out.print(p + i + " ");
        }
        if(p + k < n){
            System.out.print(">>");
        }
    }
}

import java.io.*;
import java.util.*;

public class cf399a {
  static FastIO in = new FastIO(), out = in;

  public static void main(String[] args) {
    int n = in.nextInt();
    int p = in.nextInt();
    int k = in.nextInt();
    if(p-k-1 > 0) out.print("<< ");
    for(int i=p-k; i<p; i++)
      if(i > 0) out.print(i+" ");
    out.print("("+p+") ");
    for(int i=p+1; i<=p+k; i++)
      if(i <= n) out.print(i+" ");
    if(p+k+1 <= n) out.print(">>");
    out.println();
    out.close();
  }

  static class FastIO extends PrintWriter {
    BufferedReader br;
    StringTokenizer st;

    public FastIO() {
      this(System.in, System.out);
    }

    public FastIO(InputStream in, OutputStream out) {
      super(new BufferedWriter(new OutputStreamWriter(out)));
      br = new BufferedReader(new InputStreamReader(in));
      scanLine();
    }

    public void scanLine() {
      try {
        st = new StringTokenizer(br.readLine().trim());
      } catch (Exception e) {
        throw new RuntimeException(e.getMessage());
      }
    }

    public int numTokens() {
      if (!st.hasMoreTokens()) {
        scanLine();
        return numTokens();
      }
      return st.countTokens();
    }

    public String next() {
      if (!st.hasMoreTokens()) {
        scanLine();
        return next();
      }
      return st.nextToken();
    }

    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public long nextLong() {
      return Long.parseLong(next());
    }

    public int nextInt() {
      return Integer.parseInt(next());
    }
  }
}

import java.util.Scanner;

public class r233_a {
public static void main(String[] args) {
	Scanner sc=new Scanner(System.in);
	int n=sc.nextInt(),p=sc.nextInt(),k=sc.nextInt();
	String ans="("+p+")";
	for (int i = p+1; i <=p+k; i++)
		if(i<=n)
			ans+=" "+i;
	if(p+k<n)
		ans+=" >>";
	for (int i = p-1; i >=p-k; i--) {
		if(i>0)
		ans=i+" "+ans;
	}
	if(p-k>1)
		ans="<< "+ans;
	System.out.println(ans);
}
}

import java.util.ArrayList;
import java.util.Scanner;

public class Pages {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {

            int n = scanner.nextInt();
            int p = scanner.nextInt();
            int k = scanner.nextInt();

            String previous = "<<";
            String next = ">>";

            ArrayList<Integer> pages = new ArrayList<Integer>();

            boolean P = false;
            boolean N = false;
            boolean before = true;

            for (int i = k; i > 0; i--) {
                int x = p - i;
                if (x >= 1 && x <= n)
                    pages.add(x);
            }

            for (int i = 0; i <= k; i++) {
                int x = p + i;
                if (x >= 1 && x <= n)
                    pages.add(x);
            }

            if (pages.contains(1)) {
                P = true;
            }

            if (pages.contains(n)) {
                N = true;
            }

            if (!P) {
                System.out.print(previous + " ");
            }

            for (int i = 0; i < pages.size(); i++) {
                int y = pages.get(i);
                if (y == p) {
                    System.out.print("(" + y + ")" + " ");
                } else {
                    System.out.print(y + " ");
                }
            }

            if (!N) {
                System.out.print(next + " ");
            }
        }

    }
}

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 *
 * @author Adly
 */
public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        int x = in.nextInt();
        int k = in.nextInt();
        StringBuilder sb = new StringBuilder();
        if (x - k > 1) {
            sb.append("<<");
        }
        for (int i = k; i > 0; i--) {
            if (x-i> 0) {
                if (sb.length() > 0) {
                    sb.append(" " + (x - i));
                } else {
                    sb.append("" + (x - i));
                }
            }
        }
        if (sb.length() > 0) {
            sb.append(" (" + x + ")");
        } else {
            sb.append("(" + x + ")");
        }

        for (int i = 1; i <= k; i++) {
            if (x + i <= t) {
                sb.append(" " + (x + i));
            }
        }
        if (x + k < t) {
            sb.append(" >>");
        }
        System.out.println(sb);
    }
}

import java.util.*;
import java.io.*;
public class Pages
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String[] str=br.readLine().split(" ");
        int n=Integer.parseInt(str[0]);
        int p=Integer.parseInt(str[1]);
        int k=Integer.parseInt(str[2]);
        StringBuilder sb=new StringBuilder();
        if(p-k>1)
        sb.append("<< ");
        int max=Math.min(n,p+k);
        int min=Math.max(1,p-k);
        for(int i=min;i<=max;i++)
        {
            if(i==p)
            sb.append("("+i+")"+" ");
            else
            sb.append(i+" ");
        }
        if(p+k<n)
        sb.append(">>");
        System.out.println(sb);
    }
}

import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

import static java.lang.Math.*;

public class Cf182 implements Runnable
{
	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
	public static void main(String args[]) throws Exception
	{
		new Thread(null, new Cf182(),"Main",1<<27).start();
	}

	public static long gcd(long a, long b)
	{
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	public static long findGCD(long arr[], int n)
	{
		long result = arr[0];
		for (int i = 1; i < n; i++)
			result = gcd(arr[i], result);
		return result;
	}

	public void run()
	{
		InputReader in = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);

		int n=in.nextInt();
		int p=in.nextInt();
		int k=in.nextInt();
		if(p>1+k)
			w.print("<< ");
		for(int i=k;i>0;i--)
		{	if(p-i>=1)
				w.print(p-i + " ");

		}
		w.print("(" + p +") ");
		for(int i=1;i<=k;i++)
		{
			if(p+i<=n)
				w.print(p+i + " ");

		}
		if(n>p+k)
			w.print(">>");

		w.flush();
		w.close();
	}
}

import java.io.*;
import java.util.*;

public class p1
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p = sc.nextInt();
        int k = sc.nextInt();
        String str = "("+p+")";
        for(int i=p+1;i<=p+k;i++)
        {
            if(i<=n)
            {
                str += (" "+i);
            }
        }
        if(p+k<n) str += " >>";
        for (int i=p-1;i>=p-k;i--)
        {
            if(i>0)
            {
                str = i+" "+str;
            }
        }
        if(p-k>1) str = "<< "+str;
        System.out.println(str);
    }
}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{

	Scanner sc=new Scanner(System.in);
	int total=sc.nextInt();
	int red=sc.nextInt();
	int dis=sc.nextInt();

if((red-dis)>=2)
{
    System.out.print("<< ");
}

////
for(int i=red-dis;i<=red+dis;i++)
{
    if(i>0){
    if(i==red)
    {
        System.out.print("("+i+")");
    }
    else
    {
        if(i<=total)
        System.out.print(" "+i+" ");
    }
    }

}

////
if((red+dis)<total)
{
    System.out.print(">>");
}

	}
}

import java.util.Scanner;

public class Pages {

    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt(), p = scan.nextInt(), k = scan.nextInt();

        StringBuilder res = new StringBuilder();

        if (p - k > 1) res.append("<< ");
        for (int i = Math.max(1, p - k); i < p; i++)
            res.append(Integer.toString(i) + " ");
        res.append("(" + Integer.toString(p) + ")");
        for (int i = p + 1; i <= p + k && i <= n; i++)
            res.append(" " + Integer.toString(i));
        if (p + k + 1 <= n) res.append(" >>");

        System.out.println(res.toString());
        scan.close();

    }
}

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;

public class Main{
   public static ArrayList<Integer>list=new ArrayList<Integer>();

    public static Scanner input = new Scanner(System.in);
    public static void main(String[] args)
            throws IOException {

   //  BufferedReader buffer=new BufferedReader(new InputStreamReader(System.in));
   //  String str;
    //  while((str=buffer.readLine())!=null){
      int n=input.nextInt();
      int p=input.nextInt();
      int k=input.nextInt();
      int s=p;
      int k2=k;
     while(k2!=0){
         k2--;
         if(s==1)
             break;
         s--;
         list.add(s);

     }
     if(list.isEmpty()){
         if(p!=1)
             System.out.println("<< ");
         System.out.print("("+p+") ");
     }else{
        if(list.get(list.size()-1)!=1)
             System.out.print("<< ");
        for(int i=list.size()-1;i>=0;i--)
             System.out.print(list.get(i)+" ");
          System.out.print("("+p+") ");
     }

     list.removeAll(list);
     k2=k;
     s=p;
     while(k2!=0){
               k2--;
         if(s==n)
             break;
         s++;
         list.add(s);

     }

      for(int i=0;i<list.size();i++)
            System.out.print(list.get(i)+" ");
      if(list.isEmpty()){
           System.out.println();
           return;
      }
      if(list.get(list.size()-1)!=n)
            System.out.println(">>");
      else
            System.out.println();
    }}

import java.util.*;
import java.lang.*;
import java.io.*;
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int p = in.nextInt();
		int k = in.nextInt();
		if( p-k > 1){
			System.out.print("<< ");
		}
		for(int i=p-k;i<p;i++){
			if(i>0)System.out.print(i+" ");
		}
		System.out.print("("+p+")");
		for(int i=p+1;i<=p+k && i<=n;i++){
			System.out.print(" "+i);
		}
		if( p+k < n){
			System.out.println(" >>");
		}

	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws IOException {
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final StringTokenizer st = new StringTokenizer(br.readLine(), " ");
        final StringBuilder sb = new StringBuilder();

        int n = Integer.parseInt(st.nextToken());
        int p = Integer.parseInt(st.nextToken());
        int k = Integer.parseInt(st.nextToken());

        int start = p - k > 1 ? p-k : 1;
        int end = p + k > n ? n : p+k;
        // p - k, 1보다 작을때, 1일때, 1보다 클때
        if(start > 1) sb.append("<< ");
        for(int i = start; i <= end; i++)
            sb.append(i == p ? "(" + i + ")" : i).append(" ");
        if(end < n) sb.append(">>");

        System.out.println(sb.toString());
    }
}

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
import java.util.regex.*;

/*
  br = new BufferedReader(new FileReader("input.txt"));
  pw = new PrintWriter(new BufferedWriter(new FileWriter("output.txt")));
  br = new BufferedReader(new InputStreamReader(System.in));
  pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
 */

public class Main {
	private static BufferedReader br;
	private static StringTokenizer st;
	private static PrintWriter pw;

	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		//int qq = 1;
		int qq = Integer.MAX_VALUE;
		//int qq = readInt();
		for(int casenum = 1; casenum <= qq; casenum++) {
			int n = readInt();
			int p = readInt();
			int k = readInt();
			boolean[] add = new boolean[n+1];
			for(int i = p-k; i <= p+k; i++) {
				if(i >= 1 && i <= n) {
					add[i] = true;
				}
			}
			String ret = "";
			for(int i = 1; i <= n; i++) {
				if(!add[i]) continue;
				if(i == p) {
					ret += "(" + i + ")";
				}
				else {
					ret += i;
				}
				ret += " ";
			}
			ret = ret.trim();
			if(!add[1]) {
				ret = "<< " + ret;
			}
			if(!add[n]) {
				ret += " >>";
			}
			pw.println(ret);
		}
		exitImmediately();
	}

	private static void exitImmediately() {
		pw.close();
		System.exit(0);
	}

	private static long readLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	private static double readDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	private static int readInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	private static String nextLine() throws IOException  {
		if(!br.ready()) {
			exitImmediately();
		}
		st = null;
		return br.readLine();
	}

	private static String nextToken() throws IOException  {
		while(st == null || !st.hasMoreTokens())  {
			if(!br.ready()) {
				exitImmediately();
			}
			st = new StringTokenizer(br.readLine().trim());
		}
		return st.nextToken();
	}
}

import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author User
 */
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int p = in.nextInt();
        int k = in.nextInt();
        if(p - k > 1){
            System.out.print("<< ");
        }
        for (int i = Math.max(p-k, 1); i < p; i++) {
            System.out.print(i + " ");
        }
        System.out.print("(" + p + ") ");
        for (int i = 1; i <= Math.min(n-p, k); i++) {
            System.out.print((p+i));
            if(i != Math.min(n-p, k) || i == Math.min(n-p, k) && n-p > k){
                System.out.print(" ");
            }
        }
        if(p + k < n){
            System.out.println(">>");
        }
        else
            System.out.println("");
    }
}

import java.io.*;
import java.util.*;
public class Pages
{
    public static void main(String[] args) throws IOException
    {
        //Scanner in = new Scanner(new File("Sample Input.txt"));
        Scanner in = new Scanner(System.in);
        StringBuilder out = new StringBuilder();
        int n, p, k, limit;
        //while (in.hasNext())
        {
            n = in.nextInt();
            p = in.nextInt();
            k = in.nextInt();
            if ( p-k <= 1)
                limit = 1;
            else
            {
                out.append("<< ");
                limit = p-k;
            }

            for (int i = limit; i < p; i++)
                out.append(i+" ");
            out.append("("+p+")");
            if ( p+k < n)
                limit = p+k;
            else
                limit = n;
            for (int i = p+1; i <= limit; i++)
                out.append(" "+i);
            if ( limit < n)
                out.append(" >>");
            out.append("\n");

        }
        System.out.print(out);
    }

}

//'main' method must be in a class 'Rextester'.
//Compiler version 1.8.0_111

import java.util.*;
import java.lang.*;

public class Rextester
{
    public static void main(String args[])
    {
        Scanner ob=new Scanner(System.in);
        int n,p,k,i;
        n=ob.nextInt();
        p=ob.nextInt();
        k=ob.nextInt();
        int c=p-k;
        if(c<1)
            c=1;
        if(c!=1)
            System.out.print("<< ");
        for(i=c; i<p; i++)
        {
            System.out.print(i+" ");
        }
        System.out.print("("+p+") ");
        c=p+k;
        if(c>n)
            c=n;
        for(i=p+1; i<=c; i++)
            System.out.print(i+" ");
        if(c<n)
            System.out.print(">>");
    }
}

import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();
        int p = scan.nextInt();
        int k = scan.nextInt();

        if(p-k == 1){
            for(int i = (p-k); i<=p-1; i++)
                System.out.print(i+" ");
        }
        else if(p-k <1){
            for(int i = 1; i<=p-1; i++)
                System.out.print(i+" ");
        }
        else if(p-k >1){
            System.out.print("<< ");
            for(int i = (p-k); i<=p-1; i++)
                System.out.print(i+" ");
        }
        System.out.print("("+p+") ");

        if(p+k == n){
            for(int i = (p+1); i<=n; i++ )
                System.out.print(i+" ");
        }
        else if(p+k < n){
            for(int i = (p+1); i<=p+k; i++ )
                System.out.print(i+" ");
            System.out.print(">>");
        }
        else{
            for(int i = (p+1); i<=n; i++ )
                System.out.print(i+" ");
        }

    }
}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class navi
{
    public static void main(String args[])
    {
        int flag=0;
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        int k=sc.nextInt();
        if(p-k>1)
        System.out.print("<< ");
        for(int i=p-k;i<=p+k;i++)
        {
            if(i<n)
            {
            if(i<=0) continue;

            if(i==p)
            System.out.print("("+i+") ");
            else
            System.out.print(i+" ");
        }
        else
            if(i==n)
            {
                if(n==p)
                System.out.print("("+i+")");
                else
                System.out.print((i));
                flag++;
                break;
            }

        }
         if(flag==0)
            System.out.print(" >>");

    }
}

import java.util.Scanner;

public class Pages {
	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		int N = in.nextInt() , P = in.nextInt() , K = in.nextInt();

		frstHalf(P , K);
		lastHalf(N , P , K);

	}

	public static void frstHalf(int p , int k){

		if (p-k > 1)
		{
			System.out.print("<< ");

			for (int i = p-k; i < p; i++)
			{
				System.out.print(i + " ");
			}
		}
		else
		{
			for (int i = 1; i < p; i++)
			{
				System.out.print(i + " ");
			}
		}

	}
	public static void lastHalf(int n , int p , int k){

		if (p+k < n)
		{
			for (int i = p; i <= p+k; i++)
			{
				if(i == p)
					System.out.print("(" + i + ") ");
				else
					System.out.print(i + " ");
			}

			System.out.println(">>");
		}
		else
		{
			for (int i = p; i <= n; i++)
			{
				if(i == p)
					System.out.print("(" + i + ") ");
				else
					System.out.print(i + " ");
			}
			System.out.println();
		}

	}

}

import java.util.Scanner;

public class Pages {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), p = in.nextInt(), k = in.nextInt();
        int size = k * 2 + 1;
        int arr[] = new int[size];
        arr[k] = p;
        for (int i = k - 1, j = 1; i >= 0; i--, j++) {
            if (p - j <= 0) {
                break;
            }
            arr[i] = p - j;
        }
        for (int i = k + 1, j = 1; i < size; i++, j++) {
            if (p + j > n) {
                break;
            }
            arr[i] = p + j;
        }
        int i = 0, j = size - 1;
        while (i < size) {
            if (arr[i] != 0) {
                break;
            }
            i++;
        }
        while (j >= 0) {
            if (arr[j] != 0) {
                break;

            }
            j--;
        }
        StringBuilder sb = new StringBuilder("");
        if (arr[i] != 1) {
            sb.append("<<").append(" ");
        }
        for (; i <= j; i++) {
            if (i == k) {
                sb.append("(").append(arr[i]).append(")").append(" ");
                continue;
            }
            sb.append(arr[i]).append(" ");
        }
        if (arr[j] != n) {
            sb.append(">>").append(" ");
        }
        sb.deleteCharAt(sb.length() - 1);
        System.out.println(sb);

    }//psvm
}//class

/* IMPORTANT: class must not be public. */

/*
 * uncomment this if you want to read input.
import java.io.BufferedReader;
import java.io.InputStreamReader;
*/
import java.util.*;
public class TestClass {
    public static void main(String args[] ) throws Exception {
        /*
         * Read input from stdin and provide input before running

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int N = Integer.parseInt(line);
        for (int i = 0; i < N; i++) {
            System.out.println("hello world");
        }
            */
        Scanner s = new Scanner(System.in);
        int n=s.nextInt();
        int p=s.nextInt();
        int k=s.nextInt();

        if(p-k>1 && p+k<n)    {
            System.out.print("<<");
            for(int i=p-k;i<=p+k;i++)   {
                if(i==p)    {
                    System.out.print(" ("+i+")");
                }
                else    {
                    System.out.print(" "+i);
                }
            }
            System.out.print(" >>");
        }

        if(p-k>1 && p+k>=n)    {
            System.out.print("<<");
            for(int i=p-k;i<=n;i++)   {
                if(i==p)    {
                    System.out.print(" ("+i+")");
                }
                else    {
                    System.out.print(" "+i);
                }
            }
        }

        if(p-k<=1 && p+k<n)    {
            for(int i=1;i<=p+k;i++)   {
                if(i==p)    {
                    System.out.print(" ("+i+")");
                }
                else    {
                    System.out.print(" "+i);
                }
            }
            System.out.print(" >>");
        }

        if(p-k<=1 && p+k>=n)    {
            for(int i=1;i<=n;i++)   {
                if(i==p)    {
                    System.out.print(" ("+i+")");
                }
                else    {
                    System.out.print(" "+i);
                }
            }
        }

        //System.out.println("Hello World!");
    }
}

import java.util.Scanner;

public class First {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);
		int total = scanner.nextInt();
		int current = scanner.nextInt();
		int lr = scanner.nextInt();
		if(current - lr > 1)
			System.out.print("<< ");
		for(int i = current - lr; i < current; i++){
			if(i < 1) continue;
			System.out.print(i + " ");
		}
		System.out.print("("+ current +") ");
		for(int i = current + 1; i < current + lr + 1; i++){
			if(i > total)break;
			System.out.print(i + " ");
		}
		if(current + lr < total)
			System.out.print(">>");
	}
}

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{

	Scanner sc=new Scanner(System.in);
	int total=sc.nextInt();
	int red=sc.nextInt();
	int dis=sc.nextInt();

if((red-dis)>=2)
{
    System.out.print("<< ");
}

////
for(int i=red-dis;i<=red+dis;i++)
{
    if(i>0){
    if(i==red)
    {
        System.out.print("("+i+")");
    }
    else
    {
        if(i<=total)
        System.out.print(" "+i+" ");
    }
    }

}

////
if((red+dis)<total)
{
    System.out.print(">>");
}

	}
}

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class T399A {

	public void solve(int n, int p, int k) {
		StringBuffer ans = new StringBuffer("");
		for (int i = (p - k > 1 ? p - k : 1); i <= p + k && i <= n; i ++) {
			if (i == p - k) {
				if (i == 1)
					ans.append(i + " ");
				else
					ans.append("<< " + i + " ");
			} else if (i == p + k) {
				if (i == n)
					ans.append(i + " ");
				else
					ans.append(i + " >> ");
			} else if (i == p) {
				ans.append("(" + i + ") ");
			} else
				ans.append(i + " ");
		}

		System.out.println(ans.delete(ans.length() - 1, ans.length()));
	}

	public static void main(String[] args) {
		FastScanner in = new FastScanner();
		new T399A().solve(in.nextInt(), in.nextInt(), in.nextInt());
	}
	static class FastScanner {

		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(nextToken());
		}

		long nextLong() {
			return Long.parseLong(nextToken());
		}

		double nextDouble() {
			return Double.parseDouble(nextToken());
		}

	}

}

import java.util.Scanner;
public class pages_339A {
    // n =10 p=6 k=3
    // << 3 4 5 6 7 8 9 >>

    public static void main (String args[]){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int p = in.nextInt();
        int k = in.nextInt();

        if(p-k>1){
            System.out.print("<< ");
        }
        int i;
        for( i= Math.max(1,p-k);i<= Math.min(n,p+k);i++){
            if(i==p)
                System.out.print("("+p+") ");
            else{
                System.out.print(i+" ");
            }
        }
        if(p+k<n)System.out.print(">>");
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Dhruv
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        APages solver = new APages();
        solver.solve(1, in, out);
        out.close();
    }

    static class APages {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int p = in.nextInt();
            int k = in.nextInt();

            StringBuilder str = new StringBuilder();

            for (int i = Math.max(p - k, 1); i <= p + k && i <= n; i++) {
                if (i == p - k && i != 1)
                    str.append("<< ");
                if (i == p) {
                    str.append('(');
                    str.append(i);
                    str.append(')');
                } else
                    str.append(i);

                if (i == p + k && i != n)
                    str.append(" >>");

                str.append(' ');
            }

            out.println(str.toString());
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.io.*;
import java.util.*;

public class P399A
{
    public static StringTokenizer st;
    public static void nextLine(BufferedReader br) throws IOException
    {
        st = new StringTokenizer(br.readLine());
    }

    public static String next()
    {
        return st.nextToken();
    }

    public static int nextInt()
    {
        return Integer.parseInt(st.nextToken());
    }

    public static long nextLong()
    {
        return Long.parseLong(st.nextToken());
    }

    public static double nextDouble()
    {
        return Double.parseDouble(st.nextToken());
    }

    static int[] dp;

    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        nextLine(br);
        int n = nextInt();
        int p = nextInt();
        int k = nextInt();

        String s = "";
        for (int i = 1; i <= n; i++)
        {
            if (i == p)
            {
                s += "(" + String.valueOf(i) + ") ";
            }
            else if (Math.abs(p - i) <= k)
            {
                s += String.valueOf(i) + " ";
            }
        }
        s = s.trim();
        if (k + 1 < p)
        {
            System.out.print("<< ");
        }
        System.out.print(s);
        if (p + k < n)
        {
            System.out.print(" >>");
        }
        System.out.println();
    }
}

import java.util.Scanner;

public class Practica_1 {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int p = in.nextInt();
        int k = in.nextInt();
        String prin[] = {"1", "(1)", n + "", "(" + n + ")"};
        String cdn = "(" + p + "" + ")";
        int count = 1;
        while (count <= k) {
            int rest = p - count;
            if (rest >= 1) {
                cdn = rest + " " + cdn;
            }
            int suma = p + count;
            if (suma <= n) {
                cdn = cdn + " " + suma;
            }
            count++;
        }
        String array[] = cdn.split(" +");
        int a = 0, b = 0;
        for (int i = 0; i < prin.length; i++) {
            if (array[0].equals(prin[i])) {
                a = 1;
            } else if (array[array.length - 1].equals(prin[i])) {
                b = 1;
            }
        }
        if (a == 0) {
            cdn = "<<" + " " + cdn;
        }
        if (b == 0) {
            cdn = cdn + " " + ">>";
        }
        System.out.println(cdn);
    }
}

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

public class S {

    public static void main(String[] args) {
	// write your code here
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        int k=sc.nextInt();
        String res="";
        if(p-k>1)
        {
            res=res+"<< ";
            for(int i=p-k;i<p;i++)
            {
                res=res+i+" ";
            }
        }
        else
        {
            for(int i=1;i<p;i++)
            {
                res=res+i+" ";
            }
        }
        res=res+"("+p+") ";
        if(p+k<n)
        {
            for(int i=p+1;i<=p+k;i++)
            {
                res=res+i+" ";
            }
            res=res+">>";
        }
        else
        {
            for(int i=p+1;i<=n;i++)
            {
                res=res+i+" ";
            }
        }
        System.out.println(res);

    }
}

import java.util.Scanner;

public class A_233 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), p = sc.nextInt(), k = sc.nextInt();
		String s = "";
		if (p - k > 1) {
			s += "<< ";
		}
		if (p - k > 1)
			for (int i = p - k; i < p; i++) {
				s += i + " ";
			}
		else
			for (int i = 1; i < p; i++) {
				s += i + " ";
			}
		s += "(" + p + ")";
		if (p + k < n)
			for (int i = p + 1; i <= p + k; i++) {
				s += " " + i;
			}
		else
			for (int i = p + 1; i <= n; i++) {
				s += " " + i;
			}
		if (p + k < n) {
			s += " >>";
		}
		System.out.println(s);
	}
}

import java.util.Scanner;

public class bai399A {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n,p,k; // tổng trang - số trang hiện tại - số trang hiển thị
        n = scanner.nextInt();
        p = scanner.nextInt();
        k = scanner.nextInt();
        ketQua(n,p,k);
    }

    public static int kiemTra(int n, int p, int k){
        if(p-k < 2 && p+k >= n)
            return 0; //KHÔNG hiện thị l và r
        if(p-k < 2)
            return -1; //KHÔNG hiển thị l
        if(p+k >= n)
            return 1; //KHÔNG hiển thị r
        return 2; //hiển thị l và r
    }

    public static void ketQua(int n, int p, int k){
        String l = "<<", r = ">>";
        int vitri = 1;
        int check = kiemTra(n,p,k);
        if(check == 2 || check == 1){
            vitri = p-k;
            System.out.print(l + " ");
        }
        if(check == 2 || check == -1)
            n=p+k;

        while(vitri <= n) {
            if(vitri == p)
                System.out.print("(" + p + ") ");
            else
                System.out.print(vitri + " ");
            vitri++;
        }
        if(check == 2 || check == -1)
            System.out.print(r);
    }
}

import java.util.*;
public class aa {
public static void main(String[] args)
{
    Scanner input =new Scanner(System.in);
    int n = input.nextInt(), p = input.nextInt(), k = input.nextInt();
    int min = Math.max(1, p - k);
    if(min > 1) System.out.print("<< ");
    for(int i = min; i<p; i++) System.out.print(i+" ");
    System.out.print("("+p+") ");
    int max = Math.min(n, p+k);
    for(int i = p+1; i<= max; i++) System.out.print(i+" ");
    if(max < n) System.out.print(">>");
}
}

import java.util.*;
public class A
{
	public static void main(String ... ar)
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int p=scan.nextInt();
		int k=scan.nextInt();
		ArrayList<String> a=new ArrayList<>();
		for(int i=p-k;i<=p+k;)
		{
			if(i==p)
			{
				a.add("("+String.valueOf(i)+")");
				i++;
				continue;
			}
			else if(i>0 && i<=n)
			{
				a.add(String.valueOf(i));

			}
			i++;

		}
		a.add(0,"<<");
		a.add(">>");
		if(a.get(1).equals("1")||a.get(1).equals("(1)"))
		{
			a.remove(0);
		}
		if(a.get(a.size()-2).equals(String.valueOf(n))||a.get(a.size()-2).equals("("+String.valueOf(n)+")"))
		{
			a.remove(a.size()-1);
		}

		for(String i:a)
		{
			System.out.print(i+" ");
		}
	}
}

import java.util.*;
public class Main
{
	public static void main(String[] args) {
	    Scanner s=new Scanner(System.in);
	    int n=s.nextInt();
	    int p=s.nextInt();
	    int k=s.nextInt();
	    if(p-k>1)
	       System.out.print("<<"+" ");
	    for(int i=k;i>0;i--)
	    {
	        if(p-i>0)
	           System.out.print(p-i+" ");
	    }
	    String s2="(";
	    String s1=")";
	      System.out.print(s2+p+s1+" ");
	   for(int j=1;j<=k;j++)
	    {
	        System.out.print(p+j+" ");
	    }
	    if(p+k<n)
	       System.out.print(">>"+" ");
	}
}

/*Contest 399*/
import java.util.*;

public class c399{
	public static void main(String[] args){
	Scanner input = new Scanner(System.in);
	int n = input.nextInt();//Total pages
	int p = input.nextInt();//Current page
	int k = input.nextInt();//Pages listed

	if(!(p-k<=1)){
		System.out.print("<< ");
	}

	for(int i=k;i!=0;i--){
		System.out.print((p-i)+" ");
	}
	System.out.print("("+p+") ");
	for(int m=1;(m<=k)&&(p+m<=n);++m){

		System.out.print((p+m)+" ");
	}

	if(p+k<=n){
		System.out.print(">>");
	}

	}
}

import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;

import static java.lang.Math.*;

public class Cf182 implements Runnable
{
	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		private BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
	public static void main(String args[]) throws Exception
	{
		new Thread(null, new Cf182(),"Main",1<<27).start();
	}

	public static long gcd(long a, long b)
	{
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	public static long findGCD(long arr[], int n)
	{
		long result = arr[0];
		for (int i = 1; i < n; i++)
			result = gcd(arr[i], result);
		return result;
	}

	public void run()
	{
		InputReader in = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);

		int n=in.nextInt();
		int p=in.nextInt();
		int k=in.nextInt();
		if(p>1+k)
			w.print("<< ");
		for(int i=k;i>0;i--)
		{	if(p-i>=1)
				w.print(p-i + " ");
			else
				break;
		}
		w.print("(" + p +") ");
		for(int i=1;i<=k;i++)
		{
			if(p+i<=n)
				w.print(p+i + " ");
			else
				break;
		}
		if(n>p+k)
			w.print(">>");

		w.flush();
		w.close();
	}
}

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

public class S {

    public static void main(String[] args) {
	// write your code here
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        int k=sc.nextInt();
        String res="";
        if(p-k>1)
        {
            res=res+"<< ";
            for(int i=p-k;i<p;i++)
            {
                res=res+i+" ";
            }
        }
        else
        {
            for(int i=1;i<p;i++)
            {
                res=res+i+" ";
            }
        }
        res=res+"("+p+") ";
        if(p+k<n)
        {
            for(int i=p+1;i<=p+k;i++)
            {
                res=res+i+" ";
            }
            res=res+">>";
        }
        else
        {
            for(int i=p+1;i<=n;i++)
            {
                res=res+i+" ";
            }
        }

    }
}

import java.awt.Point;
import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;

public class Main {

    static StringBuilder a = new StringBuilder();

    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//(new FileReader("input.in"));
        StringBuilder out = new StringBuilder();
//        StringTokenizer tk;
//        tk = new StringTokenizer(in.readLine());
        //Scanner Reader = new Scanner(System.in);
        Reader.init(System.in);
        int n=Reader.nextInt(),p=Reader.nextInt(),k=Reader.nextInt(),c=p-k;
        if(p-k>1){
            out.append("<< ");

        }
        while(c<p){
            if(c<=0)
                c=1;
        out.append(c+++" ");
        }

        while (c<=p+k&&c<=n) {
            out.append(c+++" ");
        }
        if(p+k<n)
        out.append(">>");
        System.out.println(out.replace(out.indexOf(p+""), out.indexOf(p+"")+1, "("+p+")"));

    }
}

class Reader {

    static StringTokenizer tokenizer;
    static BufferedReader reader;

    public static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    public static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    public static String nextLine() throws IOException {
        return reader.readLine();
    }

    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}

import java.io.*;
public class Pages {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        try {
            String input[]=br.readLine().split("\\s");
            int n=Integer.parseInt(input[0]);
            int p=Integer.parseInt(input[1]);
            int k=Integer.parseInt(input[2]);
            int start=p-k;
            int end=p+k;
            if (start<1)
                 start=1;
            if(p==1){
                System.out.print("("+p+")");
            }
            else{
            if(start==1 ){
                System.out.print(1);
            }
            else
            {
                System.out.print("<< "+start);
            }

            start++;
            while(start!=p && start<p){
                System.out.print(" "+start);
                start++;
            }
            System.out.print(" ("+p+")");
            }
            start++;
            while(start!=end && start<n){
                System.out.print(" "+start);
                start++;
            }
            if(end==n){
                System.out.print(" "+n);
            }
            else
                if(end<n)
                 System.out.print(" "+end+" >> ");
                else
                    System.out.print(" "+n);

        } catch (Exception e) {
            // TODO: handle exception
        }

    }

}

import java.util.Scanner;

public class Main {
	static int number;
	static int page;
	static int skip;
	static int lastPage = 0;

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		number = scanner.nextInt();
		page = scanner.nextInt();
		skip = scanner.nextInt();

		for (int i = 0; i < number; i++) {
			if (i == page) {

				getPreviousPage();

				System.out.print("(" + page + ")");

				getNextPage();

			}

		}
	}

	private static void getNextPage() {

		if (number != page) {
			for (int j = 0; j < skip; j++) {
				if ((page + j + 1) <= number) {
					System.out.print(" " + (page + j + 1));

				}
				lastPage = page + j;
			}
			if ((lastPage + 1) < number) {
				System.out.print(" >>");
			}

		}

	}

	private static void getPreviousPage() {

		if ((page - skip) >= 2) {
			System.out.print("<< ");
		}
		for (int j = skip; j > 0; j--) {
			if ((page - j) > 0) {
				System.out.print(page - j + " ");
			}
		}

	}

}

import java.util.*;
import java.io.*;

public final class Solution {
	public static void main(String[] args) throws IOException  {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(), p=sc.nextInt(), k=sc.nextInt();
		String ans="";
		if(p==1) ans+="(1) ";
		else if(p-k<=1) {
			for(int i=1;i<p;i++) ans+=i+" ";
			ans+="("+p+") ";
		}
		else {
			ans+="<< ";
			for(int i=p-k;i<p;i++) ans+=i+" ";
			ans+="("+p+") ";
		}
		int i=0;
		for( i=1;i<=k;i++) {
			if(p+i<n) ans+=p+i+" ";
		}
		if(p+k>n) ans+=n;
		else ans+=">>";

		System.out.println(ans);
	}

	static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
}

import java.util.Scanner;

public class CmdTest {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] input = sc.nextLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int p = Integer.parseInt(input[1]);
        int k = Integer.parseInt(input[2]);
        String answer = "";

        //Beginning
        if (p > k) {
            answer += "<< ";
            for (int i= p-k; i<p; i++){
                answer += i +" ";
            }
        } else {
            for (int i=1 ; i<p; i++){
                answer += i +" ";
            }
        }
        //Current
        answer += "("+p+") ";

        //Ending
        if ( n-p >= k){
            for (int i=p+1; i<=p+k; i++){
                answer += i +" ";
            }
            answer += ">>";

        } else {
            for (int i=p+1 ; i<=n; i++){
                answer += i +" ";
            }

        }
        System.out.println(answer);
    }
}

import java.util.*;
import java.util.Scanner;
////// PAGES

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scan = new Scanner (System.in);
        int n = scan.nextInt();
        int p = scan.nextInt();
        int k = scan.nextInt();
        if (p-k > 0){
            System.out.print("<<");
        }

        /// izq

            for (int i =p-k ; i<=p ; i++){
                System.out.print(" "+ i);

        }

        System.out.print(" "+ "(" +p + ")");

            for (int i = p+1 ; i<=p+k ; i++){

                System.out.print(" "+ i);

            }

        if (p+k < n){
            System.out.print(" >>");
        }

    }
}

import java.util.Scanner;

/**
 * Main.注意考虑到边界情况与特殊情况
 * @author : cxc
 **/
public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in, "utf-8");
    int n = in.nextInt();
    int p = in.nextInt();
    int k = in.nextInt();
    if (p-k > 1) {
      System.out.printf("<< ");
    }
    for (int i = p-k; i <= p+k-1; i++) {
      if(1<=i&&i<=n) {
        if (i == p) {
          System.out.printf("(%d) ", p);
        } else {
          System.out.printf("%d ", i);
        }
      }
    }
    if (p+k < n) {
      System.out.println(">> ");
    }
  }
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package pages;

import java.util.Scanner;

/**
 *
 * @author 20111
 */
public class Pages {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int p=scan.nextInt();
        int k=scan.nextInt();

        if(p<n && p>1)
        {
            if(p-k>1)
            {
                System.out.print("<< ");
            }
            for(int i=0;i<k;i++)
            {
                if((p-k+i)<1)
                {
                    continue;
                }
                System.out.print(p-k+i + " ");
            }
            System.out.print("("+p+") ");
            for(int i=1;i<=k;i++)
            {
                if((p+i)<1)
                {
                    continue;
                }
                System.out.print(p+i + " ");
            }
             if(p+k<n)
            {
                System.out.print(">> ");
            }
        }

    }

}

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class P_399A {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			String[] tmp = br.readLine().split(" ");
			int n = Integer.parseInt(tmp[0]);
			int p = Integer.parseInt(tmp[1]);
			int k = Integer.parseInt(tmp[2]);

			String answer = "";
			int start_num, end_num;
			if(p - k <= 0) {
				start_num = 1;
			} else {
				start_num = p-k;
				answer += "<< ";
			}

			if(p + k >= n) {
				end_num = n;
			} else {
				end_num = p+k;
			}
			for(int i = start_num; i <= end_num; i++) {
				if(i != start_num) {
					answer += " ";
				}

				if(i == p) {
					answer += "(" + i + ")";
				} else {
					answer += i;
				}
			}

			if(end_num != n) {
				answer += " >>";
			}
			System.out.println(answer);
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class navi
{
    public static void main(String args[])
    {
        int flag=0;
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        int k=sc.nextInt();
        if(p-k>1)
        System.out.print("<< ");
        for(int i=p-k;i<p+k;i++)
        {
            if(i<n)
            {
            if(i<=0) continue;

            if(i==p)
            System.out.print("("+i+") ");
            else
            System.out.print(i+" ");
        }
            if(i==n)
            {
                System.out.print((i));
                flag++;
                break;
            }
        }

    }
}

import java.util.Scanner;
public class Pages{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int i;
		if(c == 1){
			System.out.print("(1) ");
			for(i = 2; i <=d+1;i++)
			System.out.print( i + " ");
			if(i-1 < s)
				System.out.print(">> ");
		}
		else if(c == s){
			if(c-d > 1)
				System.out.print("<< ");
			if(c - d> 1)
			for(i = c-d; i != s; i++)
				System.out.print(i + " ");
			System.out.print(" (" + c + ") ");
		}else{
			if(c - d> 1){
				System.out.print("<< ");
			}
			for(i = c-d; i != c; i++)
				if(i >= 1)
				System.out.print(i + " ");
			System.out.print("(" + c + ") ");
			for(i = 1; i <=d;i++)
				if(i+c<=s)
			System.out.print( i+c + " ");
			if((i+c)-1 < s)
				System.out.print(">>");

		}

	}
}

import java.util.Scanner;

public class pages {

    public static void main(String[]args)
    {
    	int n,p,k;

    	Scanner in = new Scanner(System.in);

    	n = in.nextInt();
    	p = in.nextInt();
    	k = in.nextInt();

    	int first;

    	if( p == 1)
    		first = 1;
    	else
    		first = p - k;

    	int last;

    	if( p == n)
    		last = n;
    	else
    		last = p + k;

    	if(first > 1)
    		System.out.print("<<");

    	for( int current = first ; current <= last; current++)
    	{

			if(current < 1)
				continue;
			else
	    		if(current == p)
	    			System.out.printf(" (%d)", current);
	    		else
	    			System.out.printf(" %d", current);
    	}

    	if(last != n)
    		System.out.print(" >>");
    }

}

import java.util.Scanner;
public class HelloWorld{

     public static void main(String []args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int p=sc.nextInt();
    int k=sc.nextInt();
    int a=p-k;
    if(a>1){
        System.out.print("<< ");
    }
    for (int i=a;i<=p+k;i++){
        if(i>=1){
            if(i==p){
    System.out.print("("+i+") ");
    continue;
    }
      System.out.print(i+" ");
    if(i==n){
        break;
    }

}

    }
    if(p+k<n){
        System.out.println(">>");
    }
     }

}

import java.util.*;

public class yahia {
	public static void main(String args[]) {
		Scanner sc =new Scanner(System.in);
		int n,p,k,l,m;
		n=sc.nextInt();
		p=sc.nextInt();
		k=sc.nextInt();
		l=p-k;
		m=p+k;
		if (l<=0&&m<n) {
			for (int c=1;c<=p+k;++c) {
				if (c==p) {
					System.out.print("("+p+")"+" ");
				}else {
					System.out.print(c+" ");
				}
			}
			System.out.print(">>");
		}else if (l>0&&m>=n) {
			if (l>1) {
				System.out.print("<<"+" ");
			}

			for (int b=l;b<=n;++b) {
				if (b==p) {
					System.out.print("("+p+")"+" ");
				}else {
					System.out.print(b+" ");
				}
			}
		}else if (l>0&&m<n) {
			if (l>1) {
				System.out.print("<<"+" ");
			}

			for (int r =l ;r<=m;++r) {
				if (r==p) {
					System.out.print("("+p+")"+" ");
				}else {
					System.out.print(r+" ");
				}
			}
			if (n-1>=m) {
			System.out.print(">>");
			}
		}else if (l<=0&&m>n) {
			for (int q=1;q<=n;++q) {
				if (q==p) {
					System.out.print("("+p+")"+" ");
				}
				System.out.print(q+" ");
			}
		}

	}
}

import java.util.Scanner;

public class Pages {
    public static void main(String args[]) {
        Scanner obj = new Scanner(System.in);
        int n = obj.nextInt();
        int p = obj.nextInt();
        int k = obj.nextInt();
        String previous = "<< ";
        String next = ">>";
        int min = p - k;
        int max = p + k;
        if (p + k > n) {
            max = n;
        }
        if (p - k < 1) {
            min = 1;
        }
        if (min > 1) {
            System.out.print(previous);
        }
        for (int i = 0; i < max - min + 1; i++) {
            if (p - k + i == p) {
                System.out.print("(" + p + ") ");
                continue;
            }
            System.out.print(p - k + i + " ");
        }
        if (max < n) {
            System.out.print(next);
        }
    }
}

import java.util.Scanner;

public class First {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int total = scanner.nextInt();
		int current = scanner.nextInt();
		int lr = scanner.nextInt();
		if(current - lr > 1)
			System.out.print("<< ");
		for(int i = current - lr; i < current; i++){
			System.out.print(i + " ");
		}
		System.out.print("("+ current +") ");
		for(int i = current + 1; i < current + lr + 1; i++){
			if(i > total)break;
			System.out.print(i + " ");
		}
		if(current + lr < total)
			System.out.print(">>");
	}
}

import java.util.*;
public class navigation{
    public static void main(String args[]){
        Scanner scan =new Scanner(System.in);
        int n;
        int p;
        int k;
        int i;
        n=scan.nextInt();
        p=scan.nextInt();
        k=scan.nextInt();
        scan.close();
        if(p<1||p>n) {
        	System.exit(0);
        }
          if(p-k>0){
            i=p-k;
        }
        else{
            i=1;
        }
   if(p-k>1){

            System.out.print("<<");
            System.out.print(" ");
            }

        for( ;i<p;i++){

                System.out.print(i);
                System.out.print(" ");
             }
               if(i==p){
                    System.out.print("("+i+")");
                    System.out.print(" ");

                }
            if(p+k>n){

            for( i=p+1;i<=n;i++){

                System.out.print(i);
                System.out.print(" ");

            }
            }

            if(p+k<=n){
            for(i=p+1;i<=p+k;i++){
                System.out.print(i);
                System.out.print(" ");
            }

            System.out.print(">>");
        }
    }
}

import java.io.*;
import java.util.StringTokenizer;

public class Pages {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt();
        int p = sc.nextInt();
        int k = sc.nextInt();

        if (p - k > 1) {
            out.append("<< ");
        }
        for (int i = Math.max(1, p - k); i < p; ++i) {
            out.append(String.format("%d ", i));
        }
        out.append(String.format("(%d) ", p));
        for (int i = p + 1; i < p + k && i < n; ++i) {
            out.append(String.format("%d ", i));
        }
        if (p + k < n) {
            out.append(String.format("%d ", p + k));
            out.append(">>");
        } else {
            out.append(String.format("%d", p + k));
        }

//        int result = 3*n;
//        out.println(result);                    // print via PrintWriter
        out.close();
    }

    public static class MyScanner {
        private final BufferedReader br;
        private StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}

import java.util.Scanner;

public class Cf399a {
    public static void main(String[] args) {
        int n, p, k;
        String outputL = "";
        String outputR = "";
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        p = scanner.nextInt();
        k = scanner.nextInt();

        if ((n >= 3) && (n <= 100) && (p >= 1) && (p <= n) && (1 <= k && k <= n)) {
            if (p - k >= k) {
                outputL += "<< ";
                for (int i = p - k; i < p; i++) {
                    outputL = outputL + i + " ";
                }
            } else {
                for (int i = 1; i < p; i++) {
                    outputL = outputL + i + " ";
                }
            }
            if (p + k < n) {
                for (int i = p + 1; i <= p + k; i++) {
                    outputR = outputR + i + " ";
                }
                outputR += ">>";
            } else {
                for (int i = p + 1; i <= n; i++) {
                    outputR = outputR + i + " ";
                }
            }
            outputL = outputL + "(" + p + ") " + outputR;
        }
        if (!outputL.isEmpty()) System.out.println(outputL.trim());
    }
}

import java.io.*;
import java.util.*;

public class CF233A {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);

		StringTokenizer stringTokenizer;

		String next() throws IOException{
			while(stringTokenizer == null || !stringTokenizer.hasMoreTokens()){
				stringTokenizer = new StringTokenizer(br.readLine());
			}
			return stringTokenizer.nextToken();
		 }
		CF233A() throws IOException{

		 }
		int nextInt() throws IOException{
			 return Integer.parseInt(next());
		 }
		long nextLong() throws IOException{
			 return Long.parseLong(next());
		 }
		void solve() throws IOException{
			//EnterCoder here...
			StringBuilder sb = new StringBuilder();

			int n = nextInt();
			int p = nextInt();
			int k = nextInt();

			int left = p-k;
			int right = p+k;
			String ans ="";
			for(int i=p-1;i>=left &&i>=1;i--){
				ans = i+" "+ans;
			}
			ans+= "("+p+")"+" ";
			for(int i=p+1;i<=right&&i<=n;i++){
				ans+=i+" ";
			}
			if(left>1){
				ans="<<"+ ans;
			}
			if(right<n){
				ans+=">>";
			}
			pw.println(ans.trim());
			pw.close();
		 }
		public static void main(String[] args) throws IOException{
			 new CF233A().solve();
		 }
}

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt(); //страницы все
		int p = scanner.nextInt(); //данная страница
		int k = scanner.nextInt();
		if ((p - k) > 1) {
			System.out.print("<< ");
		}
		int l = p - k;
		int m = p + k;
		for (int i = l; i < m + 1; i++) {
			if ((i == p) && (i > 0) && (i != n)) {
				System.out.print("(" + i + ") ");
			}
			if ((i != p) && (i > 0) && (i != n)) {
					System.out.print(i + " ");
			}
			if (i == n) {
					System.out.print(i + " ");
					break;
			}
		}
			if ((p + k) < n) {
				System.out.println(">>");
			}
		}
	}

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

public class S {

    public static void main(String[] args) {
	// write your code here
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        int k=sc.nextInt();
        String res="";
        if(p-k>1)
        {
            res=res+"<< ";
            for(int i=p-k;i<p;i++)
            {
                res=res+i+" ";
            }
        }
        else
        {
            for(int i=1;i<p;i++)
            {
                res=res+i+" ";
            }
        }
        res=res+"("+p+") ";
        if(p+k<n)
        {
            for(int i=p+1;i<=p+k;i++)
            {
                res=res+i+" ";
            }
            res=res+">>";
        }
        else
        {
            for(int i=p+1;i<=n;i++)
            {
                res=res+i+" ";
            }
        }

    }
}

import java.util.Scanner;

public class Cf399a {
    public static void main(String[] args) {
        int n, p, k;
        String outputL = "";
        String outputR = "";
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        p = scanner.nextInt();
        k = scanner.nextInt();

        if (n > 1) {
            if (p - k >= k) {
                outputL += "<< ";
                for (int i = p - k; i < p; i++) {
                    outputL = outputL + i + " ";
                }
            } else {
                for (int i = 1; i < p; i++) {
                    outputL = outputL + i + " ";
                }
            }
            if (p + k <= n) {
                for (int i = p + 1; i <= p + k; i++) {
                    outputR = outputR + i + " ";
                }
                outputR += ">>";
            } else {
                for (int i = p + 1; i <= n; i++) {
                    outputR = outputR + i + " ";
                }
            }
        }
        outputL = outputL + "(" + p + ") " + outputR;
        System.out.println(outputL.trim());
    }
}

//package yahia;
import java.util.*;

public class yahia {
	public static void main(String args[]) {
		Scanner sc =new Scanner(System.in);
		int n,p,k,l,m;
		n=sc.nextInt();
		p=sc.nextInt();
		k=sc.nextInt();
		l=p-k;
		m=p+k;
		if (l<=0&&m<n) {
			for (int c=1;c<=p+k;++c) {
				if (c==p) {
					System.out.print("("+p+")"+" ");
				}else {
					System.out.print(c+" ");
				}
			}
			System.out.print(">>");
		}else if (l>0&&m>=n) {
			if (l>1) {
				System.out.print("<<"+" ");
			}

			for (int b=l;b<=n;++b) {
				if (b==p) {
					System.out.print("("+p+")"+" ");
				}else {
					System.out.print(b+" ");
				}
			}
		}else if (l>0&&m<n) {
			System.out.print("<<"+" ");
			for (int r =l ;r<=m;++r) {
				if (r==p) {
					System.out.print("("+p+")"+" ");
				}else {
					System.out.print(r+" ");
				}
			}
			System.out.print(">>");
		}

	}
}

import java.util.Scanner;

public class Pages {
	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);

		int N = in.nextInt() , P = in.nextInt() , K = in.nextInt();

		frstHalf(P , K);
		lastHalf(N , P , K);

	}

	public static void frstHalf(int p , int k){

		if (p-k > 1)
		{
			System.out.print("<< ");

			for (int i = p-k; i < p; i++)
			{
				System.out.print(i + " ");
			}
		}
		else
		{
			for (int i = 1; i <= p; i++)
			{
				System.out.print(i + " ");
			}
		}

	}
	public static void lastHalf(int n , int p , int k){

		if (p+k < n)
		{
			for (int i = p; i <= p+k; i++)
			{
				if(i == p)
					System.out.print("(" + i + ") ");
				else
					System.out.print(i + " ");
			}

			System.out.println(">>");
		}
		else
		{
			for (int i = p; i <= n; i++)
			{
				if(i == p)
					System.out.print("(" + i + ") ");
				else
					System.out.print(i + " ");
			}
			System.out.println();
		}

	}

}

import java.io.*;
public class Pages {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub

        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        try {
            String input[]=br.readLine().split("\\s");
            int n=Integer.parseInt(input[0]);
            int p=Integer.parseInt(input[1]);
            int k=Integer.parseInt(input[2]);
            int start=p-k;
            int end=p+k;
            if (start<1)
                 start=1;
            if(p==1){
                System.out.print("("+p+")");
            }

            else{
            if(start==1 ){
                System.out.print(1);
            }
            else
            {
                System.out.print("<< "+start);
            }

            start++;
            while(start!=p && start<p){
                System.out.print(" "+start);
                start++;
            }

            }
            if(p==n){
                System.out.print(" ("+p+")");
            }
            else
            {
                System.out.print(" ("+p+")");
            start++;
            while(start!=end && start<n){
                System.out.print(" "+start);
                start++;
            }
            if(end==n){
                System.out.print(" "+n);
            }
            else
                if(end<n)
                 System.out.print(" "+end+" >> ");
                else
                    System.out.print(" "+n);
            }

        } catch (Exception e) {
            // TODO: handle exception
        }

    }

}

import java.util.*;
import java.util.Scanner;
////// PAGES

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scan = new Scanner (System.in);
        int n = scan.nextInt();
        int p = scan.nextInt();
        int k = scan.nextInt();
        if (p-k > 0){
            System.out.print("<<");
        }

        /// izq

            for (int i =p-k ; i<p ; i++){
                System.out.print(" "+ i);

        }

        System.out.print(" "+ "(" +p + ")");

            for (int i = p+1 ; i<=p+k ; i++){

                System.out.print(" "+ i);

            }

        if (p+k < n){
            System.out.print(" >>");
        }

    }
}

import java.io.FileNotFoundException;
import java.util.Scanner;

public class Pages {

	public static void main(String[] args) {
		//Scanner scan = new Scanner(new File("D:\\Binaries\\workspace\\CodeForce\\input\\input.txt"));
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int p = scan.nextInt();
		int k = scan.nextInt();
		System.out.println(sol(n, p, k));
	}

	public static String sol(int n, int p, int k) {
		StringBuffer sb = new StringBuffer();
		int d = p - k;
		int d1 = Math.abs(n - p);
		int i = (d <= 0) ? 1 : d;
		int j = (d1 - k > 0) ? (p + k) : n;
		if(i!=1) sb.append("<<");
		for(int l = i ; l<=j ; l++){
			if(l==p){
				sb.append("(").append(l).append(") ");
			}else{
				sb.append(l).append(" ");
			}

		}
		if(j!=n) sb.append(">>");
		return sb.toString();
	}

}

import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
public class da {
    public static void main(String args[]) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader sc = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        int n = sc.nextInt(), p = sc.nextInt(), k = sc.nextInt();
        if (p - k > 1) {
            out.print("<< ");
        }
        for (int i = 0; i < n; i++) {
            int pageNo = Math.abs(p - k) + i;
            if(pageNo>n)
                break;
            if(pageNo!=0)
            out.printf(pageNo == p ? "(%d) " : "%d ", pageNo);
            if(pageNo==p+k)
                break;
        }
        if (p + k < n)
            out.print(">>");
        out.close();
    }

    public static void shuffle(long[] arr) {
        int n = arr.length;
        Random rnd = new Random();
        for (int i = 0; i < n; ++i) {
            long tmp = arr[i];
            int randomPos = i + rnd.nextInt(n - i);
            arr[i] = arr[randomPos];
            arr[randomPos] = tmp;
        }
    }

    public static void shuffle(int[] arr) {
        int n = arr.length;
        Random rnd = new Random();
        for (int i = 0; i < n; ++i) {
            int tmp = arr[i];
            int randomPos = i + rnd.nextInt(n - i);
            arr[i] = arr[randomPos];
            arr[randomPos] = tmp;
        }
    }
    public static int gcd(int x, int y) {
        if (y == 0)
            return x;
        return gcd(y, x % y);
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.valueOf(next());
        }

        public double nextDouble() {
            return Double.valueOf(next());
        }

        String nextLine() throws IOException {
            return reader.readLine();
        }

    }
}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner S = new Scanner(System.in);
        int n = S.nextInt();
        int p = S.nextInt();
        int k = S.nextInt();
        if (p>0&&p>n+1&&n>2){
            if (p-k>1&&p>2){
                System.out.print("<<"+" ");
            }
        }
        if (p==1){
            System.out.print("("+p+")"+" ");
        }
        for(int i =p-k;i<p; i++ ){
            if(i>0){
                System.out.print(i+" ");
            }
        }
        if(p>1){
            System.out.print("("+p+")" + " ");
        }
        for(int i =p+1;i<=p+k; i++ ){
            if(i<=n){
                System.out.print(i+" ");
            }
        }
        if(p+k<n){
            System.out.print(">>");
        }
    }
    }

import java.util.Scanner;

/**
 * Main.注意考虑到边界情况与特殊情况
 * @author : cxc
 **/
public class Main {
  //忽略末尾为p的情况
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in, "utf-8");
    int n = in.nextInt();
    int p = in.nextInt();
    int k = in.nextInt();
    int left = p-k;
    int right = p+k;
    if (p-k > 1) {
      System.out.printf("<< ");
    }
    for (int i = left; i <= right-1; i++) {
      if(1<=i && i<n) {
        if (i == p) {
          System.out.printf("(%d) ", p);
        } else {
          System.out.printf("%d ", i);
        }
      }
    }
    if (p+k < n) {
      System.out.printf("%d ", right);
      System.out.println(">>");
    } else {
      System.out.println(n);
    }
  }
}

import java.util.Scanner;

public class CmdTest {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] input = sc.nextLine().split(" ");
        int n = Integer.parseInt(input[0]);
        int p = Integer.parseInt(input[1]);
        int k = Integer.parseInt(input[2]);
        String answer = "";

        //Beginning
        if (p > k) {
            answer += "<< ";
            for (int i= p-k; i<p; i++){
                answer += i +" ";
            }
        } else {
            for (int i=1 ; i<p; i++){
                answer += i +" ";
            }
        }
        //Current
        answer += "("+p+") ";

        //Ending
        if ( n-p > k){
            for (int i=p+1; i<=p+k; i++){
                answer += i +" ";
            }
            answer += ">>";

        } else {
            for (int i=p+1 ; i<=n; i++){
                answer += i +" ";
            }

        }
        System.out.println(answer);
    }
}

import java.util.Scanner;

public class Cf399a {
    public static void main(String[] args) {
        int n, p, k;
        String outputL = "";
        String outputR = "";
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        p = scanner.nextInt();
        k = scanner.nextInt();

        if (n > 1) {
            if (p - k >= k) {
                outputL += "<< ";
                for (int i = p - k; i < p; i++) {
                    outputL = outputL + i + " ";
                }
            } else {
                for (int i = 1; i < p; i++) {
                    outputL = outputL + i + " ";
                }
            }
            if (p + k < n) {
                for (int i = p + 1; i <= p + k; i++) {
                    outputR = outputR + i + " ";
                }
                outputR += ">>";
            } else {
                for (int i = p + 1; i <= n; i++) {
                    outputR = outputR + i + " ";
                }
            }
        }
        outputL = outputL + "(" + p + ") " + outputR;
        System.out.println(outputL.trim());
    }
}

import java.util.Scanner;

public class Main {
	static int number;
	static int page;
	static int skip;
	static int lastPage = 0;

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		number = scanner.nextInt();
		page = scanner.nextInt();
		skip = scanner.nextInt();

		for (int i = 0; i < number; i++) {
			if (i == page) {

				getPreviousPage();

				System.out.print("(" + page + ") ");

				getNextPage();

			}

		}
	}

	private static void getNextPage() {
		for (int j = 0; j < skip; j++) {
			if ((page + j + 1) <= number) {
				System.out.print((page + j + 1) + " ");

			}
			lastPage = page + j;
		}
		if ((lastPage+1) != number) {
			System.out.print(">>");
		}

	}

	private static void getPreviousPage() {

		if ((page - skip) >= 2) {
			System.out.print("<< ");
		}
		for (int j = skip; j > 0; j--) {
			if ((page - j) > 0) {
				System.out.print(page - j + " ");
			}
		}

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String args[]) throws IOException{
        BufferedReader b= new BufferedReader(new InputStreamReader(System.in));
        String s=b.readLine();
        int n = 0,p=0,k=0;
        String t="";
        for(int i = 0 ; i < s.length();i++){
            if(s.charAt(i)!=' '){
                t+=s.charAt(i);
                            }
            else{
                if(n==0){
                    n=Integer.parseInt(t);
                t="";}
                else{
                    p=Integer.parseInt(t);t="";
                }
            }
        }
        k=Integer.parseInt(t);

        //System.out.printf(k+""+n+""+p);

        int x= Math.abs(p-k);
        int i=x;
        t="";
        do
        {
    if(x>1 && i==x){
        t+="<< ";
    }if(i==p)
    t+="("+i+") ";
    else
        t+=""+i+" ";
    if(p+k<n && i==p+k){
        t+=">>";
    }
    i++;
        }while(i<=p+k);
        System.out.printf(t);
    }
}

import java.util.Scanner;

public class Pages {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int p = sc.nextInt();
        int k = sc.nextInt();

        if(p - k > 1 && p + k < n){
            System.out.print("<< ");
            System.out.print(p - k);
            System.out.print(" ");
            System.out.print(p - k + 1);
            System.out.print(" ");

            System.out.print("(" + p + ") " );

            System.out.print(p + k - 1);
            System.out.print(" ");
            System.out.print(p + k);
            System.out.print(" >>");
        } else if(p - k < 1 && p > 1){
            System.out.print("(" + p + ") " );
            System.out.print(p + k - 1);
            System.out.print(" ");
            System.out.print(p + k);
            System.out.print(" >>");
        } else if(p - k < 1 && p < 1){
            System.out.print(p - k + 1);
            System.out.print(" (" + p + ") " );
            System.out.print(p + k - 1);
            System.out.print(" ");
            System.out.print(p + k);
            System.out.print(" >>");
        }
         else if(p + k >= n){
            System.out.print("<< ");
            System.out.print(p - k);
            System.out.print(" ");
            System.out.print(p - k + 1);
            System.out.print(" (" + p + ") " );

            System.out.print(p + k - 1);
        } else if(p < 1 || p > n){
            System.out.print("<< ");
            System.out.print(p - k);
            System.out.print(" ");
            System.out.print(p - k + 1);
            System.out.print(" ");
            System.out.print(p - 1);
            System.out.print("(" + p + ") " );
            System.out.print(p + 1);
            System.out.print(" ");
            System.out.print(p + k - 1);
            System.out.print(" ");
            System.out.print(p + k);
            System.out.print(" >>");
        }
    }
}

//package com.company;
import java.math.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();
        int p = scn.nextInt();
        int k = scn.nextInt();
        for(int i=p-k;i<=p+k;i++) {
            if (i >= 1) {
                if (i == 1) {
                    break;
                } else {
                    System.out.printf("<< ");
                    break;
                }
            }
        }
        int i;
        for(i = p-k;i<=p+k;i++){
            if(i <=0);
            else if(i == 1){
                if(i == p)
                    System.out.printf("(1) ");
                else
                    System.out.printf("1 ");
            }

            else if(i==p)
                System.out.printf("(%d) ", i);
            else if(i<=n)
                System.out.printf("%d ", i);
            //else if(i==n)
                //System.out.printf("%d ", i);
        }
        if(i != n+1)
            System.out.printf(">> ");
    }
}

import java.util.Scanner;
public class HelloWorld{

     public static void main(String []args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int p=sc.nextInt();
    int k=sc.nextInt();
    int a=p-k;
    if(a>1){
        System.out.print("<< ");
    }
    for (int i=a;i<=p+k;i++){
        if(i>=1){
            if(i==p){
    System.out.print("("+i+") ");
    continue;
    }
      System.out.print(i+" ");
    if(i==n){
        break;
    }

}

    }
    if(p+k<n){
        System.out.println(">>");
    }
     }

}

import java.awt.Point;
import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;

public class Main {

    static StringBuilder a = new StringBuilder();

    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//(new FileReader("input.in"));
        StringBuilder out = new StringBuilder();
//        StringTokenizer tk;
//        tk = new StringTokenizer(in.readLine());
        //Scanner Reader = new Scanner(System.in);
        Reader.init(System.in);
        int n=Reader.nextInt(),p=Reader.nextInt(),k=Reader.nextInt(),c=p-k;
        if(p-k>1){
            out.append("<< ");

        }
        while(c<p){
            if(c<=0)
                c=1;
        out.append(c+++" ");
        }
        out.append("("+p+") ");
        c++;
        while (c<=p+k&&c<=n) {
            out.append(c+++" ");
        }
        if(p+k<n)
        out.append(">>");
        System.out.println(out);

    }
}

class Reader {

    static StringTokenizer tokenizer;
    static BufferedReader reader;

    public static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    public static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    public static String nextLine() throws IOException {
        return reader.readLine();
    }

    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}

import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
Scanner scan= new Scanner (System.in);
int n = scan.nextInt();
int p = scan.nextInt();
int k = scan.nextInt();

if ((p-k) != 1)
	System.out.print("<< ");
for (int i = (p-k) ;i < p ; i++){
	System.out.print(i + " ");
}
System.out.print("("+p+") " );
for (int i = (p+1) ; i < (p+k+1) ; i++){
 if (i <= n )
		System.out.print(i + " ");
}
if ((p+k)< n ){
	System.out.println(">>");
}
	}

}

import java.util.Scanner;

public class Pages {
    public static void main(String args[]) {
        Scanner obj = new Scanner(System.in);
        int n = obj.nextInt();
        int p = obj.nextInt();
        int k = obj.nextInt();
        String previous = "<< ";
        String next = ">>";
        int min = p - k;
        int max = p + k;
        if (p + k > n) {
            max = n;
        }
        if (p - k < 1) {
            min = 1;
        }
        if (min > 1) {
            System.out.print(previous);
        }
        for (int i = 0; i < max - min + 1; i++) {
            if (p - k + i == p) {
                System.out.print("(" + p + ") ");
                continue;
            }
            System.out.print(p - k + i + " ");
        }
        if (max < n) {
            System.out.print(next);
        }
    }
}

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt(); //страницы все
		int p = scanner.nextInt(); //данная страница
		int k = scanner.nextInt();
		if ((p - k) > 1) {
			System.out.print("<< ");
		}
		int l = p - k;
		int m = p + k;
		for (int i = l; i < m + 1; i++) {
			if ((i == p) && (i > 0) && (i != n)) {
				System.out.print("(" + i + ") ");
			}
			if ((i != p) && (i > 0) && (i != n)) {
					System.out.print(i + " ");
			}
			if (i == n) {
					System.out.print(i + " ");
					break;
			}
		}
			if ((p + k) < n) {
				System.out.println(">>");
			}
		}
	}

import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
Scanner scan= new Scanner (System.in);
int n = scan.nextInt();
int p = scan.nextInt();
int k = scan.nextInt();
switch (p) {
case 1 :
	System.out.print("(1) ");
	for (int i = (p+1) ; i < (k+p+1) && i<n ; i++){
		System.out.print(i + " ");
	}
	if ((k+p) != n)
	System.out.print(">>");
break;
default:
if ((p-k) != 1)
	System.out.print("<< ");
for (int i = (p-k) ;i < p ; i++){
	System.out.print(i + " ");
}
System.out.print("("+p+") " );
for (int i = (p+1) ; i < (p+k+1) ; i++){
 if (i <= n )
		System.out.print(i + " ");
}
if ((p+k)< n ){
	System.out.println(">>");
}
}
	}

}

/*Contest 399*/
import java.util.*;

public class c399{
	public static void main(String[] args){
	Scanner input = new Scanner(System.in);
	int n = input.nextInt();//Total pages
	int p = input.nextInt();//Current page
	int k = input.nextInt();//Pages listed

	if(!(p-k<=1)){
		System.out.print("<< ");
	}

	for(int i=k;(i!=0);i--){
		if(p-i>=1){
			System.out.print((p-i)+" ");
		}
	}
	System.out.print("("+p+") ");
	for(int m=1;(m<=k)&&(p+m<=n);++m){

		System.out.print((p+m)+" ");
	}

	if(p+k<=n){
		System.out.print(">>");
	}

	}
}

import java.util.Scanner;

public class Main {
	static int number;
	static int page;
	static int skip;
	static int lastPage = 0;

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		number = scanner.nextInt();
		page = scanner.nextInt();
		skip = scanner.nextInt();

		for (int i = 0; i < number; i++) {
			if (i == page) {

				getPreviousPage();

				System.out.print("(" + page + ")");

				getNextPage();

			}

		}
	}

	private static void getNextPage() {
		for (int j = 0; j < skip; j++) {
			if ((page + j + 1) <= number) {
				System.out.print(" "+(page + j + 1));

			}
			lastPage = page + j;
		}
		if ((lastPage+1) < number) {
			System.out.print(" >>");
		}

	}

	private static void getPreviousPage() {

		if ((page - skip) >= 2) {
			System.out.print("<< ");
		}
		for (int j = skip; j > 0; j--) {
			if ((page - j) > 0) {
				System.out.print(page - j + " ");
			}
		}

	}

}

import java.util.Scanner;
public class Pages{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int i;
		if(c == 1){
			System.out.print("(1) ");
			for(i = 2; i <=d+1 && i <= s;i++)
			System.out.print( i + " ");
			if(i-1 < s)
				System.out.print(">> ");
		}
		else if(c == s){
			if(c-d > 1)
				System.out.print("<< ");
			if(c - d> 1)
			for(i = c-d; i != s; i++)
				System.out.print(i + " ");
			System.out.print(" (" + c + ") ");
		}else{
			if(c - d> 1){
				System.out.print("<< ");
			}
			for(i = c-d; i != c; i++)
				if(i >= 1)
				System.out.print(i + " ");
			System.out.print("(" + c + ") ");
			for(i = 1; i <=d;i++)
				if(i+c<=s)
			System.out.print( i+c + " ");
			if((i+c)-1 < s)
				System.out.print(">>");

		}

	}
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;

/**
 * Created with IntelliJ IDEA.
 * User: AUtemuratov
 * Date: 02.04.14
 * Time: 9:44
 * To change this template use File | Settings | File Templates.
 */
public class Main {

    static int n,p,k;
    static int b[][] = new int[111][111];
    static int a[] = new int[111];
    public static void main (String [] args) throws Exception {

        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        String s = bf.readLine();
        StringTokenizer tk = new StringTokenizer(s," ");
        n = Integer.parseInt(tk.nextToken());
        p = Integer.parseInt(tk.nextToken());
        k = Integer.parseInt(tk.nextToken());

        if (p-k>1) {
            System.out.print("<< ");
        }

        for (int i=p-k; i<p; i++) {
            if (i<1) continue;
            System.out.print(i + " ");
        }

        System.out.print("(" + p + ") ");

        for (int i=p+1; i<=p+k; i++) {
            if (i>n) break;
            System.out.print(i + " ");
        }

        if (p+k<=n) {
            System.out.print(">>");
        }

        pw.close();
    }
}

import java.util.Scanner;

/**
 * Main.注意考虑到边界情况与特殊情况
 * @author : cxc
 **/
public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in, "utf-8");
    int n = in.nextInt();
    int p = in.nextInt();
    int k = in.nextInt();
    if (p-k > 1) {
      System.out.printf("<< ");
    }
    for (int i = p-k; i <= p+k-1; i++) {
      if(1<=i&&i<=n) {
        if (i == p) {
          System.out.printf("(%d) ", p);
        } else {
          System.out.printf("%d ", i);
        }
      }
    }
    if (p+k < n) {
      System.out.println(">> ");
    }
  }
}

//package com.company;
import java.math.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();
        int p = scn.nextInt();
        int k = scn.nextInt();
        for(int i=p-k;i<=p+k;i++) {
            if (i >= 1) {
                if (i == 1) {
                    break;
                } else {
                    System.out.printf("<< ");
                    break;
                }
            }
        }
        int i;
        int check = n;
        for(i = p-k;i<=p+k;i++){
            if(i <=0);
            else if(i == 1){
                if(i == p)
                    System.out.printf("(1) ");
                else
                    System.out.printf("1 ");
            }

            else if(i==p)
                System.out.printf("(%d) ", i);
            else if(i<=n) {
                System.out.printf("%d ", i);
                if(i==n) {
                    check = i;
                    break;
                }
            }
            check = i;
        }
        if(check != n)
            System.out.printf(">> ");

    }
}

import java.util.*;
import java.util.Scanner;
////// PAGES

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scan = new Scanner (System.in);
        int n = scan.nextInt();
        int p = scan.nextInt();
        int k = scan.nextInt();
        if (p-k > 0){
            System.out.print("<<");
        }

        /// izq

            for (int i =p-k ; i<p ; i++){
                if( i>0){
                System.out.print(" "+ i);
                }

        }

        System.out.print(" "+ "(" +p + ")");

            for (int i = p+1 ; i<=p+k ; i++){
                if (i <= n){
                System.out.print(" "+ i);
            }
            }

        if (p+k < n){
            System.out.print(" >>");
        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

    public static void main(String args[]) throws IOException{
        BufferedReader b= new BufferedReader(new InputStreamReader(System.in));
        String s=b.readLine();
        int n = 0,p=0,k=0;
        String t="";
        for(int i = 0 ; i < s.length();i++){
            if(s.charAt(i)!=' '){
                t+=s.charAt(i);
                            }
            else{
                if(n==0){
                    n=Integer.parseInt(t);
                t="";}
                else{
                    p=Integer.parseInt(t);t="";
                }
            }
        }
        k=Integer.parseInt(t);

        //System.out.printf(k+""+n+""+p);

        int x=Math.abs(p-k);
        if(x==0)x+=1;
        int x2=Math.abs(p+k)<=n?Math.abs(p+k):n;
        int i=x;
        t="";
        do
        {
    if(x>1 && i==x){
        t+="<< ";
    }if(i==p)
    t+="("+i+") ";
    else
        t+=""+i+" ";
    if(p+k<n && i==p+k){
        t+=">>";
    }
    i++;
        }while(i<=x2);
        System.out.printf(t);
    }
}

import java.util.*;

public class Pages {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int p = s.nextInt();
		int k = s.nextInt();

		boolean lf= true;
		boolean rf = true;

		String out = "(" + p + ")";
		for(int i = 1; i <= k; i++) {
			if(p - i >= 1)
				out = (p - i) + " " + out;
			else
				lf = false;
			if( p + i <= n)
				out = out + " " + (p + i);
			else
				rf = false;
		}
		if(rf)
			out = out + " >>";
		if(lf)
			out = "<< " + out;

		System.out.println(out);
	}

}

/*package whatever //do not write package name here */

import java.util.*;

public class GFG {
	public static void main (String[] args) {
	  Scanner sc=new Scanner(System.in);

	  int n=sc.nextInt();
	  int p=sc.nextInt();
	  int k=sc.nextInt();
	  if(p-k>1){
	      System.out.print("<<");
	  }
	  for(int i=p-k;i<=p+k;i++){
	      if(i>=1&&i<=n){
	         if(i==p){
	             System.out.print("("+i+")"+" ");
	         }else{
	          System.out.print(i+" ");
	         }
	      }

	  }
	  if(p+k<n){
	      System.out.print(">>");
	  }
	}
}

import java.util.*;
import java.io.*;
public class Main {
	static BufferedReader br;
	static FileInputStream fis;
	static InputStreamReader isr;
	static FileWriter fw;

	public static void main(String[] args) throws IOException{
		//fis = new FileInputStream("input.txt");
		//isr = new InputStreamReader(fis);
		isr = new InputStreamReader(System.in);
		br = new BufferedReader(isr);
		//File file = new File("output.txt");
		//fw = new FileWriter(file);
		solve();
		//fis.close();
		isr.close();
		br.close();
		//fw.close();
		return;
	}

	// the followings are methods to take care of inputs.
	static int nextInt(){
		return Integer.parseInt(nextLine());
	}
	static long nextLong(){
		return Long.parseLong(nextLine());
	}
	static int[] nextIntArray(){
		String[] inp = nextLine().split("\\s+");
		int[] ary = new int[inp.length];
		for (int i = 0; i < ary.length; i++){
			ary[i] = Integer.parseInt(inp[i]);
		}
		return ary;
	}
	static int[] nextIntArrayFrom1(){
		String[] inp = nextLine().split("\\s+");
		int[] ary = new int[inp.length + 1];
		for (int i = 0; i < inp.length; i++){
			ary[i+1] = Integer.parseInt(inp[i]);
		}
		return ary;
	}
	static long[] nextLongArray(){
		String[] inp = nextLine().split("\\s+");
		long[] ary = new long[inp.length];
		for (int i = 0; i < inp.length; i++){
			ary[i] = Long.parseLong(inp[i]);
		}
		return ary;
	}
	static long[] nextLongArrayFrom1(){
		String[] inp = nextLine().split("\\s+");
		long[] ary = new long[inp.length + 1];
		for (int i = 0; i < inp.length; i++){
			ary[i+1] = Long.parseLong(inp[i]);
		}
		return ary;
	}
	static String nextLine(){
		try {
			return br.readLine().trim();
		} catch (Exception e){}
		return null;
	}
	static void write(String str){
		try{
			fw.write(str);
		}catch (Exception e){
			System.out.println(e);
		}
		return;
	}
	static void solve(){
		int[] tmp = nextIntArray();
		int n = tmp[0];
		int p = tmp[1];
		int k = tmp[2];
		String ret="";
		if(p != 1 && 1 < p-k){
				ret += "<< ";
		}
		for(int i=p-k;i<=p+k && i<=n;i++){
			if(i<=0){
				i = 1;
			}
			if(p == i){
				ret += "(" + p + ") ";
			}else{
				ret += i + " ";
			}
		}
		if(p + k < n){
			ret += "<<";
		}
		System.out.println(ret);
		return;
	}
}

import java.util.Scanner;
public class HelloWorld{

     public static void main(String []args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int p=sc.nextInt();
    int k=sc.nextInt();
    int a=p-k;
    if(a>1){
        System.out.print("<< ");
    }
    for (int i=a;i<p+k;i++){
            if(i==p){
    System.out.print("("+i+") ");
    continue;
    }
        System.out.print(i+" ");

    }
    if(p+k<n){
        System.out.println(">>");
    }
     }

}

import java.util.*;
public class A
{
	public static void main(String ... ar)
	{
		Scanner scan=new Scanner(System.in);
		int n=scan.nextInt();
		int p=scan.nextInt();
		int k=scan.nextInt();
		ArrayList<String> a=new ArrayList<>();
		for(int i=p-k;i<=p+k;)
		{
			if(i==p)
			{
				a.add("("+String.valueOf(i)+")");
				i++;
				continue;
			}
			else if(i>0 && i<=n)
			{
				a.add(String.valueOf(i));

			}
			i++;

		}
		if(p-k>1)
		{
			a.add(0,"<<");
		}
		if(p==1)
		{
			a.remove(0);
		}
		if(p+k<n)
		{
			a.add(a.size(),">>");
		}
		if(p==n)
		{
			a.remove(a.size()-1);
		}
		for(String i:a)
		{
			System.out.print(i+" ");
		}

	}
}

import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main {
    public static Scanner scanner = new Scanner(new BufferedInputStream(System.in));

    public static boolean check(int[] arr, int mid) {
        for (int starti = 0; starti < arr.length; starti += (1 << mid)) {
            for (int i = 1; i < (1 << mid); i++) {
                if (arr[starti + i - 1] > arr[starti + i]) {
                    break;
                }

                if (i == (1 << mid) - 1) {
                    return true;
                }
            }
        }
        return false;
    }

    public static void main(String args[]) {
        int n = scanner.nextInt();
        int p = scanner.nextInt();
        int k = scanner.nextInt();
        int l = p - k;
        if (l > 0) {
            System.out.print("<<");
        } else {
            l = 1;
            if (p == l) {

            } else {
                System.out.print("<<");
            }
        }

        while (l < p) {
            System.out.print(' ');
            System.out.print(l);
            l++;
        }
        System.out.print(' ');
        System.out.print('(');
        System.out.print(p);
        System.out.print(')');

        int r = p + 1;

        while (r <= p + k && r <= n) {
            System.out.print(' ');
            System.out.print(r);
            r++;
        }
        if (p + k < n) {
            System.out.println(" >>");
        } else {
            System.out.println();
        }
    }
}

//package com.company;
import java.math.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int n = scn.nextInt();
        int p = scn.nextInt();
        int k = scn.nextInt();
        for(int i=p-k;i<=p+k;i++) {
            if (i >= 1) {
                if (i == 1) {
                    break;
                } else {
                    System.out.printf("<< ");
                    break;
                }
            }
        }
        int i;
        for(i = p-k;i<=p+k;i++){
            if(i <=0);
            else if(i == 1){
                if(i == p)
                    System.out.printf("(1) ");
                else
                    System.out.printf("1 ");
            }

            else if(i==p)
                System.out.printf("(%d) ", i);
            else if(i<=n)
                System.out.printf("%d ", i);
            //else if(i==n)
                //System.out.printf("%d ", i);
        }
        if(i != n+1)
            System.out.printf(">> ");
    }
}

import java.util.Scanner;

/**
 * Main.注意考虑到边界情况与特殊情况
 * @author : cxc
 **/
public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in, "utf-8");
    int n = in.nextInt();
    int p = in.nextInt();
    int k = in.nextInt();
    int left = p-k > 1?p-k:1;
    int right = p+k < n?p+k:n;
    if (left > 1) {
      System.out.printf("<< ");
    }
    for (int i = left; i <= right-1; i++) {
      System.out.printf("%d ", i);
      if(i==p){
        System.out.printf("(%d) ", p);
      }
    }
    if (right < n) {
      System.out.printf("%d ", right);
      System.out.println(">>");
    } else {
      System.out.println(right);
    }
  }
}

import java.util.Scanner;

public class A_Pages {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int p = scan.nextInt();
		int k = scan.nextInt();
		if (p < 1 || p > n)
			return;
		int head = p - k < 1 ? 1 : p - k;
		int tail = p + k > n ? n : p + k;

		if (p - k > 0)
			System.out.printf("<<");
		for (int i = head; i <= tail; i++) {
			if (i == p) {
				System.out.printf(" (%d) ", i);
			} else {
				System.out.print(" " + i + " ");
			}
		}
		if (p + k < n)
			System.out.printf(">>");
		scan.close();
	}

}

import java.util.Scanner;

public class Main {
	static int number;
	static int page;
	static int skip;
	static int lastPage = 0;

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		number = scanner.nextInt();
		page = scanner.nextInt();
		skip = scanner.nextInt();

		for (int i = 0; i < number; i++) {
			if (i == page) {

				getPreviousPage();

				System.out.print("(" + page + ") ");

				getNextPage();

			}

		}
	}

	private static void getNextPage() {
		for (int j = 0; j < skip; j++) {
			if ((page + j + 1) <= number) {
				System.out.print((page + j + 1) + " ");

			}
			lastPage = page + j;
		}
		if (lastPage != number) {
			System.out.print(">>");
		}

	}

	private static void getPreviousPage() {

		if ((page - skip) >= 2) {
			System.out.print("<< ");
		}
		for (int j = skip; j > 0; j--) {
			if ((page - j) > 0) {
				System.out.print(page - j + " ");
			}
		}

	}

}

//package yahia;
import java.util.*;

public class yahia {
	public static void main(String args[]) {
		Scanner sc =new Scanner(System.in);
		int n,p,k,l,m;
		n=sc.nextInt();
		p=sc.nextInt();
		k=sc.nextInt();
		l=p-k;
		m=p+k;
		if (l<=0&&m<n) {
			for (int c=1;c<=p+k;++c) {
				if (c==p) {
					System.out.print("("+p+")"+" ");
				}else {
					System.out.print(c+" ");
				}
			}
			System.out.print(">>");
		}else if (l>0&&m>=n) {
			if (l>1) {
				System.out.print("<<"+" ");
			}

			for (int b=l;b<=n;++b) {
				if (b==p) {
					System.out.print("("+p+")"+" ");
				}else {
					System.out.print(b+" ");
				}
			}
		}else if (l>0&&m<n) {
			System.out.print("<<"+" ");
			for (int r =l ;r<=m;++r) {
				if (r==p) {
					System.out.print("("+p+")"+" ");
				}else {
					System.out.print(r+" ");
				}
			}
			System.out.print(">>");
		}

	}
}

/*
 * Remember a 7.0 student can know more than a 10.0 student.
 * Grades don't determine intelligence, they test obedience.
 * I Never Give Up.
 */
import java.util.*;
import java.io.*;

import static java.lang.System.out;
import static java.util.Arrays.*;
import static java.lang.Math.*;
public class ContestMain {
	private static Reader in=new Reader();
	private static StringBuilder ans=new StringBuilder();
	private static long MOD=1000000007;//10^9+7
	private static final int N=10000000;
//	private static final double PI=3.1415;
//	private static ArrayList<Integer> v[]=new ArrayList[N];
//	private static int color[]=new int[N]; //For Graph Coloring
//	private static boolean mark[]=new boolean[N];
//	private static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
//	private static void dfs(int node){mark[node]=true;for(int x:v[node]){if(!mark[x]){dfs(x);}}}
	private static long powmod(long x,long n,long m){
		if(n==0)return 1;
		else if(n%2==0)return(powmod((x*x)%m,n/2,m));
		else return (x*(powmod((x*x)%m,(n-1)/2,m)))%m;
	}
	public static void solve(String s){
	}
	public static void main(String[] args) throws IOException{
		int n=in.nextInt();
		int p=in.nextInt();
		int k=in.nextInt();
		LinkedList<String> ll=new LinkedList();
		int i=p;
		for(i=p;i>=p-k&&i>=1;i--){
			if(i==p)ll.addFirst("("+i+")");
			else ll.addFirst(""+i);
		}
		if(i>1)ll.addFirst("<<");
		for(i=p+1;i<=p+k&&i<=n;i++){
			ll.add(""+i);
		}
		i--;
		if(i<n)ll.add(">>");
		String res="";
		while(!ll.isEmpty()){
			res+=ll.pop()+" ";
		}
		out.println(res);
	}
	static class Reader{
        BufferedReader br;
        StringTokenizer st;

        public Reader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.util.Scanner;
public class pages_339A {
    // n =6 p=3 k=2
    // 1 2 (3) 4 5

    public static void main (String args[]){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int p = in.nextInt();
        int k = in.nextInt();

        if(p-k>1){
            System.out.print("<< ");
        }
        int i;
        for( i= Math.max(1,p-k);i<= Math.min(n,p+k);i++){
            if(i==p)
                System.out.print("("+p+") ");
            else{
                System.out.print(i+" ");
            }
        }
        if(i<n)System.out.print(">>");
    }
}

import java.util.Scanner;

public class pages {

    public static void main(String[]args)
    {
    	int n,p,k;

    	Scanner in = new Scanner(System.in);

    	n = in.nextInt();
    	p = in.nextInt();
    	k = in.nextInt();

    	int first;

    	if( p == 1)
    		first = 1;
    	else
    		first = p - k;

    	int last;

    	if( p == n)
    		last = n;
    	else
    		last = p + k;

    	if(first > 1)
    		System.out.print("<<");

    	for( int current = first ; current <= last; current++)
    	{

			if(current < 1)
				continue;
			else
	    		if(current == p)
	    			System.out.printf(" (%d)", current);
	    		else
	    			System.out.printf(" %d", current);
    	}

    	if(last != n)
    		System.out.print(" >>");
    }

}

import java.util.Scanner;
public class Pages{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int i;
		if(c == 1){
			System.out.print("(1) ");
			for(i = 2; i <=d+1;i++)
			System.out.print( i + " ");
			if(i < s)
				System.out.print(">> ");
		}
		else if(c == s){
			if(c-d > 1)
				System.out.print("<< ");
			if(c - d> 1)
			for(i = c-d; i != s; i++)
				System.out.print(i + " ");
			System.out.print(" (" + c + ") ");
		}else{
			if(c - d> 1){
				System.out.print("<< ");
			}
			for(i = c-d; i != c; i++)
				if(i >= 1)
				System.out.print(i + " ");
			System.out.print("(" + c + ") ");
			for(i = 1; i <=d;i++)
				if(i+c<=s)
			System.out.print( i+c + " ");
			if((i+c)-1 < s)
				System.out.print(">>");

		}

	}
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
//package pages;

import java.util.Scanner;

/**
 *
 * @author 20111
 */
public class Pages {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here

        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int p=scan.nextInt();
        int k=scan.nextInt();

        if(p<n && p>1)
        {
            if(p-k>1)
            {
                System.out.print("<< ");
            }
            for(int i=0;i<k;i++)
            {
                if((p-k+i)<1)
                {
                    continue;
                }
                System.out.print(p-k+i + " ");
            }
            System.out.print("("+p+") ");
            for(int i=1;i<=k;i++)
            {
                if((p+i)>n)
                {
                    continue;
                }
                System.out.print(p+i + " ");
            }
             if(p+k<n)
            {
                System.out.print(">> ");
            }
        }

    }

}

import java.util.*;
import java.io.*;

public final class Solution {
	public static void main(String[] args) throws IOException  {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(), p=sc.nextInt(), k=sc.nextInt();
		String ans="";
		if(p==1) ans+="(1) ";
		else if(p-k<=1) {
			for(int i=1;i<p;i++) ans+=i+" ";
			ans+="("+p+") ";
		}
		else {
			ans+="<< ";
			for(int i=p-k;i<p;i++) ans+=i+" ";
			ans+="("+p+") ";
		}
		int i=0;
		for( i=1;i<=k;i++) {
			if(p+i<n) ans+=p+i+" ";
		}
		if(p+k>=n && p!=n) ans+=n;
		else ans+=">>";

		System.out.println(ans);
	}

	static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class navi
{
    public static void main(String args[])
    {
        int flag=0;
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int p=sc.nextInt();
        int k=sc.nextInt();
        if(p-k>1)
        System.out.print("<< ");
        for(int i=p-k;i<p+k;i++)
        {
            if(i<n)
            {
            if(i<=0) continue;

            if(i==p)
            System.out.print("("+i+") ");
            else
            System.out.print(i+" ");
        }
            if(i==n)
            {
                System.out.print((i));
                flag++;
                break;
            }
        }

    }
}

import java.awt.Point;
import java.io.*;
import java.util.*;
import java.math.*;
import static java.lang.Math.*;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Double.parseDouble;
import static java.lang.String.*;

public class Main {

    static StringBuilder a = new StringBuilder();

    public static void main(String[] args) throws IOException {
//        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//(new FileReader("input.in"));
        StringBuilder out = new StringBuilder();
//        StringTokenizer tk;
//        tk = new StringTokenizer(in.readLine());
        //Scanner Reader = new Scanner(System.in);
        Reader.init(System.in);
        int n=Reader.nextInt(),p=Reader.nextInt(),k=Reader.nextInt(),c=abs(p-k);
        if(p-k>1){
            out.append("<< ");

        }
        while(c<p){
        out.append(c+++" ");
        }
        out.append("("+p+") ");
        c++;
        while (c<=p+k&&c<=n) {
            out.append(c+++" ");
        }
        if(p+k<n)
        out.append(">>");
        System.out.println(out);

    }
}

class Reader {

    static StringTokenizer tokenizer;
    static BufferedReader reader;

    public static void init(InputStream input) throws UnsupportedEncodingException {
        reader = new BufferedReader(new InputStreamReader(input, "UTF-8"));
        tokenizer = new StringTokenizer("");
    }

    public static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    public static String nextLine() throws IOException {
        return reader.readLine();
    }

    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }
}

import java.util.*;
import java.util.Scanner;
////// PAGES

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scan = new Scanner (System.in);
        int n = scan.nextInt();
        int p = scan.nextInt();
        int k = scan.nextInt();
        if (p-k > 0){
            System.out.print("<<");
        }

        /// izq

            for (int i =p-k ; i<p ; i++){
                System.out.print(" "+ i);

        }

        System.out.print(" "+ "(" +p + ")");

            for (int i = p+1 ; i<=p+k ; i++){

                System.out.print(" "+ i);

            }

        if (p+k < n){
            System.out.print(" >>");
        }

    }
}

import java.util.Scanner;
public class Pages{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int c = sc.nextInt();
		int d = sc.nextInt();
		int i;
		if(c == 1){
			System.out.print("(1) ");
			for(i = 2; i <=d+1;i++)
			System.out.print( i + " ");
			if(i < s)
				System.out.print(">> ");
		}
		else if(c == s){
			if(c-d > 1)
				System.out.print("<< ");
			if(c - d> 1)
			for(i = c-d; i != s; i++)
				System.out.print(i);
			System.out.print(" (" + c + ") ");
		}else{
			if(c - d> 1){
				System.out.print("<< ");
			}
			for(i = c-d; i != c; i++)
				if(i >= 1)
				System.out.print(i + " ");
			System.out.print("(" + c + ") ");
			for(i = 1; i <=d;i++)
				if(i+c<=s)
			System.out.print( i+c + " ");
			if((i+c)-1 < s)
				System.out.print(">>");

		}

	}
}

import java.io.BufferedInputStream;
import java.util.Scanner;

public class Main {
    public static Scanner scanner = new Scanner(new BufferedInputStream(System.in));

    public static boolean check(int[] arr, int mid) {
        for (int starti = 0; starti < arr.length; starti += (1 << mid)) {
            for (int i = 1; i < (1 << mid); i++) {
                if (arr[starti + i - 1] > arr[starti + i]) {
                    break;
                }

                if (i == (1 << mid) - 1) {
                    return true;
                }
            }
        }
        return false;
    }

    public static void main(String args[]) {
        int n = scanner.nextInt();
        int p = scanner.nextInt();
        int k = scanner.nextInt();
        int l = p - k;
        if (l > 0) {
            System.out.print("<<");
        } else {
            l = 1;
            if (p == l) {

            } else {
                System.out.print("<<");
            }
        }

        while (l < p) {
            System.out.print(' ');
            System.out.print(l);
            l++;
        }
        System.out.print(' ');
        System.out.print('(');
        System.out.print(p);
        System.out.print(')');

        int r = p + 1;

        while (r <= p + k && p <= n) {
            System.out.print(' ');
            System.out.print(r);
            r++;
        }
        if (p + k < n) {
            System.out.println(" >>");
        } else {
            System.out.println();
        }
    }
}

import java.util.Scanner;

public class Pages {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int p = scn.nextInt();
		int k = scn.nextInt();
		StringBuilder sb = new StringBuilder();
		if (p - k <= 1) {
			for (int i = p - k; i <= p + k; i++) {
				if (p == i) {
					sb.append("(" + p + ") ");
				} else {
					sb.append(i + " ");
				}
			}
			sb.append(">>");

		} else if (p + k >= n) {
			sb.append("<< ");
			for (int i = p - k; i <= p + k; i++) {
				if (p == i) {
					sb.append("(" + p + ") ");
				} else {
					sb.append(i + " ");
				}
			}
		} else {
			sb.append("<< ");
			for (int i = p - k; i <= p + k; i++) {
				if (p == i) {
					sb.append("(" + p + ") ");
				} else {
					sb.append(i + " ");
				}
			}
			sb.append(">>");
		}
		System.out.println(sb);
	}

}

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class P_399A {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			String[] tmp = br.readLine().split(" ");
			int n = Integer.parseInt(tmp[0]);
			int p = Integer.parseInt(tmp[1]);
			int k = Integer.parseInt(tmp[2]);

			String answer = "";
			int start_num, end_num;
			if(p - k <= 0) {
				start_num = 1;
			} else {
				start_num = p-k;
				answer += "<< ";
			}

			if(p + k >= n) {
				end_num = n;
			} else {
				end_num = p+k;
			}
			for(int i = start_num; i <= end_num; i++) {
				if(i != start_num) {
					answer += " ";
				}

				if(i == p) {
					answer += "(" + i + ")";
				} else {
					answer += i;
				}
			}

			if(end_num != n) {
				answer += " >>";
			}
			System.out.println(answer);
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
}

import java.util.*;
import java.util.Scanner;
////// PAGES

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scan = new Scanner (System.in);
        int n = scan.nextInt();
        int p = scan.nextInt();
        int k = scan.nextInt();
        if (p-k > 0){
            System.out.print("<<");
        }

        /// izq

            for (int i =p-k ; i<p ; i++){
                if( i>0){
                System.out.print(" "+ i);
                }

        }

        System.out.print(" "+ "(" +p + ")");

            for (int i = p+1 ; i<=p+k ; i++){
                if (i <= n){
                System.out.print(" "+ i);
            }
            }

        if (p+k < n){
            System.out.print(" >>");
        }

    }
}

/* IMPORTANT: class must not be public. */

/*
 * uncomment this if you want to read input.
import java.io.BufferedReader;
import java.io.InputStreamReader;
*/
import java.util.*;
public class TestClass {
    public static void main(String args[] ) throws Exception {
        /*
         * Read input from stdin and provide input before running

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        int N = Integer.parseInt(line);
        for (int i = 0; i < N; i++) {
            System.out.println("hello world");
        }
            */
        Scanner s = new Scanner(System.in);
        int n=s.nextInt();
        int p=s.nextInt();
        int k=s.nextInt();

        if(p-k>1 && p+k<n)    {
            System.out.print("<<");
            for(int i=p-k;i<=p+k;i++)   {
                if(i==p)    {
                    System.out.print(" ("+i+")");
                }
                else    {
                    System.out.print(" "+i);
                }
            }
            System.out.print(" >>");
        }

        if(p-k>1 && p+k>n)    {
            System.out.print("<<");
            for(int i=p-k;i<=n;i++)   {
                if(i==p)    {
                    System.out.print(" ("+i+")");
                }
                else    {
                    System.out.print(" "+i);
                }
            }
        }

        if(p-k<=1 && p+k<n)    {
            for(int i=1;i<=p+k;i++)   {
                if(i==p)    {
                    System.out.print(" ("+i+")");
                }
                else    {
                    System.out.print(" "+i);
                }
            }
            System.out.print(" >>");
        }

        if(p-k<=1 && p+k>=n)    {
            for(int i=1;i<=n;i++)   {
                if(i==p)    {
                    System.out.print(" ("+i+")");
                }
                else    {
                    System.out.print(" "+i);
                }
            }
        }

        //System.out.println("Hello World!");
    }
}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner S = new Scanner(System.in);
        int n = S.nextInt();
        int p = S.nextInt();
        int k = S.nextInt();
        if (p>0&&p>n+1&&n>2){
            if (p-k>1&&p>2){
                System.out.print("<<"+" ");
            }
        }
        if (p==1){
            System.out.print("("+p+")"+" ");
        }
        for(int i =p-k;i<p; i++ ){
            if(i>0){
                System.out.print(i+" ");
            }
        }
        if(p>1){
            System.out.print("("+p+")" + " ");
        }
        for(int i =p+1;i<=p+k; i++ ){
            if(i<=n){
                System.out.print(i+" ");
            }
        }
        if(p+k<n){
            System.out.print(">>");
        }
    }
    }

import java.util.*;
import java.io.*;

public class codeforce {
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int n = sc.nextInt();
		int p = sc.nextInt();
		int k = sc.nextInt();

		if(p - k > 1){
			System.out.printf("<< ");
		}
		for(int i = p - k; i <= p + k; i++){
			if(1 <= i && i <= n){
				System.out.printf((i == p) ? "(%d) " : "%d ", i);
			}
		}
		if(p+k>n){
			System.out.println(" >>");
		}
	}
}