Problem: It's time polar bears Menshykov and Uslada from the zoo of St. Petersburg and elephant Horace from the zoo of Kiev got down to business. In total, there are n tasks for the day and each animal should do each of these tasks. For each task, they have evaluated its difficulty. Also animals decided to do the tasks in order of their difficulty. Unfortunately, some tasks can have the same difficulty, so the order in which one can perform the tasks may vary.

Menshykov, Uslada and Horace ask you to deal with this nuisance and come up with individual plans for each of them. The plan is a sequence describing the order in which an animal should do all the n tasks. Besides, each of them wants to have its own unique plan. Therefore three plans must form three different sequences. You are to find the required plans, or otherwise deliver the sad news to them by stating that it is impossible to come up with three distinct plans for the given tasks.

Input

The first line contains integer n (1 ≤ n ≤ 2000) — the number of tasks. The second line contains n integers h1, h2, ..., hn (1 ≤ hi ≤ 2000), where hi is the difficulty of the i-th task. The larger number hi is, the more difficult the i-th task is.

Output

In the first line print "YES" (without the quotes), if it is possible to come up with three distinct plans of doing the tasks. Otherwise print in the first line "NO" (without the quotes). If three desired plans do exist, print in the second line n distinct integers that represent the numbers of the tasks in the order they are done according to the first plan. In the third and fourth line print two remaining plans in the same form.

If there are multiple possible answers, you can print any of them.

Examples

Input

4
1 3 3 1


Output

YES
1 4 2 3 
4 1 2 3 
4 1 3 2 


Input

5
2 4 1 4 8


Output

NO

Note

In the first sample the difficulty of the tasks sets one limit: tasks 1 and 4 must be done before tasks 2 and 3. That gives the total of four possible sequences of doing tasks : [1, 4, 2, 3], [4, 1, 2, 3], [1, 4, 3, 2], [4, 1, 3, 2]. You can print any three of them in the answer.

In the second sample there are only two sequences of tasks that meet the conditions — [3, 1, 2, 4, 5] and [3, 1, 4, 2, 5]. Consequently, it is impossible to make three distinct sequences of tasks.

Solution (in JAVA):

Solution:
//package c;

import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

public class Main {
	
	public static class Node implements Comparable<Node>{
		int val;
		int index;
		Node(int val, int index) {
			this.val = val;
			this.index = index;
		}
		@Override
		public int compareTo(Node o) {
			// TODO Auto-generated method stub
			return this.val - o.val;
		}
	}
	
	public static void swap(Node a, Node b) {
		int temp = a.index;
		a.index = b.index;
		b.index = temp;
	}
	
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		InputReader fi = new InputReader();
		int n = fi.nextInt();
		Node[] arr = new Node[n];
		Set<Integer> set = new HashSet<>();
		for(int i = 0; i< n; i++) {
			int val = fi.nextInt();
			arr[i] = new Node(val, i+1);
			set.add(val);
		}
		/*
		 * Guarantee there is a group with size >= 3 or
		 * At least 2 groups with size >=2
		 */
		if(set.size() > n-2) System.out.print("NO");
		else {
			Arrays.sort(arr);
			System.out.print("YES\n");
			for(int i = 0; i < n; i++) System.out.print(arr[i].index + " ");
			System.out.print("\n");
			for(int i = 1; i < n; i++) {
				if(arr[i].val == arr[i-1].val) {
					swap(arr[i], arr[i-1]);
					break;
				}
			}
			for(int i = 0; i < n; i++) System.out.print(arr[i].index + " ");
			System.out.print("\n");
			
			boolean isSwapFirst = false;
			for(int i = 1; i < n; i++) {
				if(arr[i].val == arr[i-1].val) {
					if(!isSwapFirst) {
						isSwapFirst = true;
						continue;
					}
					swap(arr[i], arr[i-1]);
					break;
				}
			}
			for(int i = 0; i < n; i++) System.out.print(arr[i].index + " ");
		}
		
		
	}
	
	
	 private static class InputReader {
    	 
	        private int c, bufferSize, bufIndex, numBytesRead;
	 
	        private final byte[] buf;
	        private final java.io.InputStream stream;
	 
	        private static final int DEFAULT_BUFFER_SIZE = 1 << 16;
	        private static final java.io.InputStream DEFAULT_STREAM = System.in;
	 
	        private static final byte EOF = -1; // End Of File (EOF) character
	        private static final byte NL = 10; // '\n' - New Line (NL)
	        private static final byte SP = 32; // ' '  - Space character (SP)
	        private static final byte DASH = 45; // '-'  - Dash character (DASH)
	        private static final byte DOT = 46; // '.'  - Dot character (DOT)
	 
	        // The maximum number of accurate decimal digits .nextDoubleFast can read
	        private static final int MAX_DECIMAL_PRECISION = 21;
	 
	        // A character buffer I reuse when reading string data.
	        private static char[] charBuffer = new char[128];
	 
	        // Lookup tables used for optimizations
	        private static byte[] bytes = new byte[58];
	        private static int[] ints = new int[58];
	        private static char[] chars = new char[128];
	 
	        static {
	            char ch = ' ';
	            int value = 0;
	            byte _byte = 0;
	            for (int i = 48; i < 58; i++) bytes[i] = _byte++;
	            for (int i = 48; i < 58; i++) ints[i] = value++;
	            for (int i = 32; i < 128; i++) chars[i] = ch++;
	        }
	 
	        // double lookup table, used for optimizations.
	        private static final double[][] doubles = {
	                {0.0d, 0.00d, 0.000d, 0.0000d, 0.00000d, 0.000000d, 0.0000000d, 0.00000000d, 0.000000000d, 0.0000000000d, 0.00000000000d, 0.000000000000d, 0.0000000000000d, 0.00000000000000d, 0.000000000000000d, 0.0000000000000000d, 0.00000000000000000d, 0.000000000000000000d, 0.0000000000000000000d, 0.00000000000000000000d, 0.000000000000000000000d},
	                {0.1d, 0.01d, 0.001d, 0.0001d, 0.00001d, 0.000001d, 0.0000001d, 0.00000001d, 0.000000001d, 0.0000000001d, 0.00000000001d, 0.000000000001d, 0.0000000000001d, 0.00000000000001d, 0.000000000000001d, 0.0000000000000001d, 0.00000000000000001d, 0.000000000000000001d, 0.0000000000000000001d, 0.00000000000000000001d, 0.000000000000000000001d},
	                {0.2d, 0.02d, 0.002d, 0.0002d, 0.00002d, 0.000002d, 0.0000002d, 0.00000002d, 0.000000002d, 0.0000000002d, 0.00000000002d, 0.000000000002d, 0.0000000000002d, 0.00000000000002d, 0.000000000000002d, 0.0000000000000002d, 0.00000000000000002d, 0.000000000000000002d, 0.0000000000000000002d, 0.00000000000000000002d, 0.000000000000000000002d},
	                {0.3d, 0.03d, 0.003d, 0.0003d, 0.00003d, 0.000003d, 0.0000003d, 0.00000003d, 0.000000003d, 0.0000000003d, 0.00000000003d, 0.000000000003d, 0.0000000000003d, 0.00000000000003d, 0.000000000000003d, 0.0000000000000003d, 0.00000000000000003d, 0.000000000000000003d, 0.0000000000000000003d, 0.00000000000000000003d, 0.000000000000000000003d},
	                {0.4d, 0.04d, 0.004d, 0.0004d, 0.00004d, 0.000004d, 0.0000004d, 0.00000004d, 0.000000004d, 0.0000000004d, 0.00000000004d, 0.000000000004d, 0.0000000000004d, 0.00000000000004d, 0.000000000000004d, 0.0000000000000004d, 0.00000000000000004d, 0.000000000000000004d, 0.0000000000000000004d, 0.00000000000000000004d, 0.000000000000000000004d},
	                {0.5d, 0.05d, 0.005d, 0.0005d, 0.00005d, 0.000005d, 0.0000005d, 0.00000005d, 0.000000005d, 0.0000000005d, 0.00000000005d, 0.000000000005d, 0.0000000000005d, 0.00000000000005d, 0.000000000000005d, 0.0000000000000005d, 0.00000000000000005d, 0.000000000000000005d, 0.0000000000000000005d, 0.00000000000000000005d, 0.000000000000000000005d},
	                {0.6d, 0.06d, 0.006d, 0.0006d, 0.00006d, 0.000006d, 0.0000006d, 0.00000006d, 0.000000006d, 0.0000000006d, 0.00000000006d, 0.000000000006d, 0.0000000000006d, 0.00000000000006d, 0.000000000000006d, 0.0000000000000006d, 0.00000000000000006d, 0.000000000000000006d, 0.0000000000000000006d, 0.00000000000000000006d, 0.000000000000000000006d},
	                {0.7d, 0.07d, 0.007d, 0.0007d, 0.00007d, 0.000007d, 0.0000007d, 0.00000007d, 0.000000007d, 0.0000000007d, 0.00000000007d, 0.000000000007d, 0.0000000000007d, 0.00000000000007d, 0.000000000000007d, 0.0000000000000007d, 0.00000000000000007d, 0.000000000000000007d, 0.0000000000000000007d, 0.00000000000000000007d, 0.000000000000000000007d},
	                {0.8d, 0.08d, 0.008d, 0.0008d, 0.00008d, 0.000008d, 0.0000008d, 0.00000008d, 0.000000008d, 0.0000000008d, 0.00000000008d, 0.000000000008d, 0.0000000000008d, 0.00000000000008d, 0.000000000000008d, 0.0000000000000008d, 0.00000000000000008d, 0.000000000000000008d, 0.0000000000000000008d, 0.00000000000000000008d, 0.000000000000000000008d},
	                {0.9d, 0.09d, 0.009d, 0.0009d, 0.00009d, 0.000009d, 0.0000009d, 0.00000009d, 0.000000009d, 0.0000000009d, 0.00000000009d, 0.000000000009d, 0.0000000000009d, 0.00000000000009d, 0.000000000000009d, 0.0000000000000009d, 0.00000000000000009d, 0.000000000000000009d, 0.0000000000000000009d, 0.00000000000000000009d, 0.000000000000000000009d}
	        };
	 
	        public InputReader() {
	            this(DEFAULT_STREAM, DEFAULT_BUFFER_SIZE);
	        }
	 
	        public InputReader(int bufferSize) {
	            this(DEFAULT_STREAM, bufferSize);
	        }
	 
	        public InputReader(java.io.InputStream stream) {
	            this(stream, DEFAULT_BUFFER_SIZE);
	        }
	 
	        // Designated constructor
	        public InputReader(java.io.InputStream stream, int bufferSize) {
	            if (stream == null || bufferSize <= 0)
	                throw new IllegalArgumentException();
	            buf = new byte[bufferSize];
	            this.bufferSize = bufferSize;
	            this.stream = stream;
	        }
	 
	        private byte read() throws java.io.IOException {
	 
	            if (numBytesRead == EOF) throw new java.io.IOException();
	 
	            if (bufIndex >= numBytesRead) {
	                bufIndex = 0;
	                numBytesRead = stream.read(buf);
	                if (numBytesRead == EOF)
	                    return EOF;
	            }
	 
	            return buf[bufIndex++];
	 
	        }
	 
	        private int readJunk(int token) throws java.io.IOException {
	 
	            if (numBytesRead == EOF) return EOF;
	 
	            // Seek to the first valid position index
	            do {
	 
	                while (bufIndex < numBytesRead) {
	                    if (buf[bufIndex] > token) return 0;
	                    bufIndex++;
	                }
	 
	                // reload buffer
	                numBytesRead = stream.read(buf);
	                if (numBytesRead == EOF) return EOF;
	                bufIndex = 0;
	 
	            } while (true);
	 
	        }
	 
	        // Reads a 32bit signed integer from input stream
	        public int nextInt() throws java.io.IOException {
	 
	            if (readJunk(DASH - 1) == EOF) throw new java.io.IOException();
	            int sgn = 1, res = 0;
	 
	            c = buf[bufIndex];
	            if (c == DASH) {
	                sgn = -1;
	                bufIndex++;
	            }
	 
	            do {
	 
	                while (bufIndex < numBytesRead) {
	                    if (buf[bufIndex] > SP) {
	                        res = (res << 3) + (res << 1);
	                        res += ints[buf[bufIndex++]];
	                    } else {
	                        bufIndex++;
	                        return res * sgn;
	                    }
	                }
	 
	                // Reload buffer
	                numBytesRead = stream.read(buf);
	                if (numBytesRead == EOF) return res * sgn;
	                bufIndex = 0;
	 
	            } while (true);
	 
	        }
	 
	        // Reads a 64bit signed integer from input stream
	        public long nextLong() throws java.io.IOException {
	 
	            if (readJunk(DASH - 1) == EOF) throw new java.io.IOException();
	            int sgn = 1;
	            long res = 0L;
	            c = buf[bufIndex];
	            if (c == DASH) {
	                sgn = -1;
	                bufIndex++;
	            }
	 
	            do {
	 
	                while (bufIndex < numBytesRead) {
	                    if (buf[bufIndex] > SP) {
	                        res = (res << 3) + (res << 1);
	                        res += ints[buf[bufIndex++]];
	                    } else {
	                        bufIndex++;
	                        return res * sgn;
	                    }
	                }
	 
	                // Reload buffer
	                numBytesRead = stream.read(buf);
	                if (numBytesRead == EOF) return res * sgn;
	                bufIndex = 0;
	 
	            } while (true);
	 
	        }
	 
	        private void doubleCharBufferSize() {
	            char[] newBuffer = new char[charBuffer.length << 1];
	            for (int i = 0; i < charBuffer.length; i++) newBuffer[i] = charBuffer[i];
	            charBuffer = newBuffer;
	        }
	 
	        public String nextLine() throws java.io.IOException {
	 
	            try {
	                c = read();
	            } catch (java.io.IOException e) {
	                return null;
	            }
	            if (c == NL) return ""; // Empty line
	            if (c == EOF) return null; // EOF
	 
	            int i = 0;
	            charBuffer[i++] = (char) c;
	 
	            do {
	 
	                while (bufIndex < numBytesRead) {
	                    if (buf[bufIndex] != NL) {
	                        if (i == charBuffer.length) doubleCharBufferSize();
	                        charBuffer[i++] = (char) buf[bufIndex++];
	                    } else {
	                        bufIndex++;
	                        return new String(charBuffer, 0, i);
	                    }
	                }
	 
	                // Reload buffer
	                numBytesRead = stream.read(buf);
	                if (numBytesRead == EOF)
	                    return new String(charBuffer, 0, i);
	                bufIndex = 0;
	 
	            } while (true);
	 
	        }
	 
	 
	        public String nextString() throws java.io.IOException {
	 
	            if (numBytesRead == EOF) return null;
	            if (readJunk(SP) == EOF) return null;
	            int i = 0;
	 
	            do {
	 
	                while (bufIndex < numBytesRead) {
	                    if (buf[bufIndex] > SP) {
	                        if (i == charBuffer.length) doubleCharBufferSize();
	                        charBuffer[i++] = (char) buf[bufIndex++];
	                    } else {
	                        bufIndex++;
	                        return new String(charBuffer, 0, i);
	                    }
	                }
	 
	                // Reload buffer
	                numBytesRead = stream.read(buf);
	                if (numBytesRead == EOF) return new String(charBuffer, 0, i);
	                bufIndex = 0;
	 
	            } while (true);
	 
	        }
	 
	        public double nextDouble() throws java.io.IOException {
	            String doubleVal = nextString();
	            if (doubleVal == null) throw new java.io.IOException();
	            return Double.valueOf(doubleVal);
	        }
	 
	        public double nextDoubleFast() throws java.io.IOException {
	            c = read();
	            int sgn = 1;
	            while (c <= SP) c = read(); // while c is either: ' ', '\n', EOF
	            if (c == DASH) {
	                sgn = -1;
	                c = read();
	            }
	            double res = 0.0;
	            // while c is not: ' ', '\n', '.' or -1
	            while (c > DOT) {
	                res *= 10.0;
	                res += ints[c];
	                c = read();
	            }
	            if (c == DOT) {
	                int i = 0;
	                c = read();
	                // while c is digit and we are less than the maximum decimal precision
	                while (c > SP && i < MAX_DECIMAL_PRECISION) {
	                    res += doubles[ints[c]][i++];
	                    c = read();
	                }
	            }
	            return res * sgn;
	        }
	 
	        public int[] nextIntArray(int n) throws java.io.IOException {
	            int[] ar = new int[n];
	            for (int i = 0; i < n; i++) ar[i] = nextInt();
	            return ar;
	        }
	 
	        public long[] nextLongArray(int n) throws java.io.IOException {
	            long[] ar = new long[n];
	            for (int i = 0; i < n; i++) ar[i] = nextLong();
	            return ar;
	        }
	 
	        public double[] nextDoubleArray(int n) throws java.io.IOException {
	            double[] ar = new double[n];
	            for (int i = 0; i < n; i++) ar[i] = nextDouble();
	            return ar;
	        }
	 
	        public double[] nextDoubleArrayFast(int n) throws java.io.IOException {
	            double[] ar = new double[n];
	            for (int i = 0; i < n; i++) ar[i] = nextDoubleFast();
	            return ar;
	        }
	 	
	/*
	* Read next line as array of String, each element’s seperated by blank space
	* Similar to StringTokenizer
	*/
	        public String[] nextStringArray(int n) throws java.io.IOException {
	            String[] ar = new String[n];
	            for (int i = 0; i < n; i++) {
	                String str = nextString();
	                if (str == null) throw new java.io.IOException();
	                ar[i] = str;
	            }
	            return ar;
	        }
	 
	        public int[][] nextIntMatrix(int rows, int cols) throws java.io.IOException {
	            int[][] matrix = new int[rows][cols];
	            for (int i = 0; i < rows; i++)
	                for (int j = 0; j < cols; j++)
	                    matrix[i][j] = nextInt();
	            return matrix;
	        }
	 
	        public long[][] nextLongMatrix(int rows, int cols) throws java.io.IOException {
	            long[][] matrix = new long[rows][cols];
	            for (int i = 0; i < rows; i++)
	                for (int j = 0; j < cols; j++)
	                    matrix[i][j] = nextLong();
	            return matrix;
	        }
	 
	        public double[][] nextDoubleMatrixFast(int rows, int cols) throws java.io.IOException {
	            double[][] matrix = new double[rows][cols];
	            for (int i = 0; i < rows; i++)
	                for (int j = 0; j < cols; j++)
	                    matrix[i][j] = nextDoubleFast();
	            return matrix;
	        }
	 
	        public String[][] nextStringMatrix(int rows, int cols) throws java.io.IOException {
	            String[][] matrix = new String[rows][cols];
	            for (int i = 0; i < rows; i++)
	                for (int j = 0; j < cols; j++)
	                    matrix[i][j] = nextString();
	            return matrix;
	        }
	 
	        // Closes the input stream
	        public void close() throws java.io.IOException {
	            stream.close();
	        }
	 
	    }
}