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:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.io.OutputStreamWriter;
import java.util.NoSuchElementException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Iterator;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.Writer;
import java.io.InputStream;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Alex
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }
    static class TaskB {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            int[] a = IOUtils.readIntArray(in, n);
            ArrayList<Integer>[] valToIdx = new ArrayList[2001];
            for (int i = 0; i < valToIdx.length; i++) valToIdx[i] = new ArrayList<>();
            for (int i = 0; i < a.length; i++) valToIdx[a[i]].add(i + 1);
            int bigCount = 0, twoCount = 0;
            for (ArrayList<Integer> al : valToIdx) {
                if (al.size() >= 3) bigCount++;
                else if (al.size() == 2) twoCount++;
            }
            if (bigCount >= 1 || twoCount >= 2) {
                out.printLine("YES");
                if (bigCount >= 1) {
                    for (int valIdx = 0; valIdx < valToIdx.length; valIdx++) {
                        if (valToIdx[valIdx].size() >= 3) {
                            int[] perm = new int[valToIdx[valIdx].size()];
                            for (int i = 0; i < perm.length; i++) perm[i] = i;
                            for (int permIdx = 0; permIdx < 3; permIdx++) {
                                for (int idx = 0; idx < valToIdx.length; idx++) {
                                    if (valToIdx[idx].isEmpty()) continue;
                                    if (idx == valIdx) {
                                        for (int i = 0; i < perm.length; i++)
                                            out.print(valToIdx[valIdx].get(perm[i]) + " ");
                                    } else {
                                        for (int val : valToIdx[idx]) out.print(val + " ");
                                    }
                                    out.printLine();
                                }
                                ArrayUtils.nextPermutation(perm);
                            }
                            return;
                        }
                    }
                } else {
                    int firstTwo = -1, secondTwo = -1;
                    for (int i = 0; i < valToIdx.length; i++) {
                        if (valToIdx[i].size() == 2) {
                            if (firstTwo == -1) firstTwo = i;
                            else if (secondTwo == -1) secondTwo = i;
                        }
                    }
                    if (firstTwo == -1 || secondTwo == -1 || firstTwo == secondTwo) throw new RuntimeException();
                    for (int iter = 0; iter < 3; iter++) {
                        for (int idx = 0; idx < valToIdx.length; idx++) {
                            if (valToIdx[idx].isEmpty()) continue;
                            for (int val : valToIdx[idx]) out.print(val + " ");
                        }
                        out.printLine();
                        if (iter == 0) {
                            swap(valToIdx[firstTwo]);
                        } else if (iter == 1) {
                            swap(valToIdx[secondTwo]);
                        }
                    }
                }
            } else out.printLine("NO");
        }
        private void swap(ArrayList<Integer> al) {
            if (al.size() != 2) throw new RuntimeException();
            int tmp = al.get(0);
            al.set(0, al.get(1));
            al.set(1, tmp);
        }
    }
    static interface IntCollection extends IntStream {
        public int size();
        default public void add(int value) {
            throw new UnsupportedOperationException();
        }
        default public IntCollection addAll(IntStream values) {
            for (IntIterator it = values.intIterator(); it.isValid(); it.advance()) {
                add(it.value());
            }
            return this;
        }
    }
    static interface IntReversableCollection extends IntCollection {
    }
    static class ArrayUtils {
        public static boolean nextPermutation(int[] array) {
            return new IntArray(array).nextPermutation();
        }
    }
    static interface IntIterator {
        public int value() throws NoSuchElementException;
        public boolean advance();
        public boolean isValid();
    }
    static interface IntList extends IntReversableCollection {
        public abstract int get(int index);
        public abstract void set(int index, int value);
        public abstract void addAt(int index, int value);
        public abstract void removeAt(int index);
        default public void swap(int first, int second) {
            if (first == second) {
                return;
            }
            int temp = get(first);
            set(first, get(second));
            set(second, temp);
        }
        default public IntIterator intIterator() {
            return new IntIterator() {
                private int at;
                private boolean removed;
                public int value() {
                    if (removed) {
                        throw new IllegalStateException();
                    }
                    return get(at);
                }
                public boolean advance() {
                    at++;
                    removed = false;
                    return isValid();
                }
                public boolean isValid() {
                    return !removed && at < size();
                }
                public void remove() {
                    removeAt(at);
                    at--;
                    removed = true;
                }
            };
        }
        default public void add(int value) {
            addAt(size(), value);
        }
        default public boolean nextPermutation() {
            return nextPermutation(IntComparator.DEFAULT);
        }
        default public boolean nextPermutation(IntComparator comparator) {
            int size = size();
            int last = get(size - 1);
            for (int i = size - 2; i >= 0; i--) {
                int current = get(i);
                if (comparator.compare(last, current) > 0) {
                    for (int j = size - 1; j > i; j--) {
                        if (comparator.compare(get(j), current) > 0) {
                            swap(i, j);
                            subList(i + 1, size).inPlaceReverse();
                            return true;
                        }
                    }
                }
                last = current;
            }
            return false;
        }
        default public void inPlaceReverse() {
            for (int i = 0, j = size() - 1; i < j; i++, j--) {
                swap(i, j);
            }
        }
        default public IntList subList(final int from, final int to) {
            return new IntList() {
                private final int shift;
                private final int size;
                {
                    if (from < 0 || from > to || to > IntList.this.size()) {
                        throw new IndexOutOfBoundsException("from = " + from + ", to = " + to + ", size = " + size());
                    }
                    shift = from;
                    size = to - from;
                }
                public int size() {
                    return size;
                }
                public int get(int at) {
                    if (at < 0 || at >= size) {
                        throw new IndexOutOfBoundsException("at = " + at + ", size = " + size());
                    }
                    return IntList.this.get(at + shift);
                }
                public void addAt(int index, int value) {
                    throw new UnsupportedOperationException();
                }
                public void removeAt(int index) {
                    throw new UnsupportedOperationException();
                }
                public void set(int at, int value) {
                    if (at < 0 || at >= size) {
                        throw new IndexOutOfBoundsException("at = " + at + ", size = " + size());
                    }
                    IntList.this.set(at + shift, value);
                }
                public IntList compute() {
                    return new IntArrayList(this);
                }
            };
        }
    }
    static class IntArray extends IntAbstractStream implements IntList {
        private int[] data;
        public IntArray(int[] arr) {
            data = arr;
        }
        public int size() {
            return data.length;
        }
        public int get(int at) {
            return data[at];
        }
        public void addAt(int index, int value) {
            throw new UnsupportedOperationException();
        }
        public void removeAt(int index) {
            throw new UnsupportedOperationException();
        }
        public void set(int index, int value) {
            data[index] = value;
        }
    }
    static class IntArrayList extends IntAbstractStream implements IntList {
        private int size;
        private int[] data;
        public IntArrayList() {
            this(3);
        }
        public IntArrayList(int capacity) {
            data = new int[capacity];
        }
        public IntArrayList(IntCollection c) {
            this(c.size());
            addAll(c);
        }
        public IntArrayList(IntStream c) {
            this();
            if (c instanceof IntCollection) {
                ensureCapacity(((IntCollection) c).size());
            }
            addAll(c);
        }
        public IntArrayList(IntArrayList c) {
            size = c.size();
            data = c.data.clone();
        }
        public IntArrayList(int[] arr) {
            size = arr.length;
            data = arr.clone();
        }
        public int size() {
            return size;
        }
        public int get(int at) {
            if (at >= size) {
                throw new IndexOutOfBoundsException("at = " + at + ", size = " + size);
            }
            return data[at];
        }
        private void ensureCapacity(int capacity) {
            if (data.length >= capacity) {
                return;
            }
            capacity = Math.max(2 * data.length, capacity);
            data = Arrays.copyOf(data, capacity);
        }
        public void addAt(int index, int value) {
            ensureCapacity(size + 1);
            if (index > size || index < 0) {
                throw new IndexOutOfBoundsException("at = " + index + ", size = " + size);
            }
            if (index != size) {
                System.arraycopy(data, index, data, index + 1, size - index);
            }
            data[index] = value;
            size++;
        }
        public void removeAt(int index) {
            if (index >= size || index < 0) {
                throw new IndexOutOfBoundsException("at = " + index + ", size = " + size);
            }
            if (index != size - 1) {
                System.arraycopy(data, index + 1, data, index, size - index - 1);
            }
            size--;
        }
        public void set(int index, int value) {
            if (index >= size) {
                throw new IndexOutOfBoundsException("at = " + index + ", size = " + size);
            }
            data[index] = value;
        }
    }
    static interface IntStream extends Iterable<Integer>, Comparable<IntStream> {
        public IntIterator intIterator();
        default public Iterator<Integer> iterator() {
            return new Iterator<Integer>() {
                private IntIterator it = intIterator();
                public boolean hasNext() {
                    return it.isValid();
                }
                public Integer next() {
                    int result = it.value();
                    it.advance();
                    return result;
                }
            };
        }
        default public int compareTo(IntStream c) {
            IntIterator it = intIterator();
            IntIterator jt = c.intIterator();
            while (it.isValid() && jt.isValid()) {
                int i = it.value();
                int j = jt.value();
                if (i < j) {
                    return -1;
                } else if (i > j) {
                    return 1;
                }
                it.advance();
                jt.advance();
            }
            if (it.isValid()) {
                return 1;
            }
            if (jt.isValid()) {
                return -1;
            }
            return 0;
        }
    }
    static class IOUtils {
        public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++) {
                array[i] = in.readInt();
            }
            return array;
        }
    }
    static interface IntComparator {
        public static final IntComparator DEFAULT = (first, second) -> {
            if (first < second) {
                return -1;
            }
            if (first > second) {
                return 1;
            }
            return 0;
        };
        public int compare(int first, int second);
    }
    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 readInt() {
            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);
        }
    }
    static class OutputWriter {
        private final PrintWriter writer;
        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }
        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }
        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }
        public void printLine() {
            writer.println();
        }
        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }
        public void close() {
            writer.close();
        }
    }
    static abstract class IntAbstractStream implements IntStream {
        public String toString() {
            StringBuilder builder = new StringBuilder();
            boolean first = true;
            for (IntIterator it = intIterator(); it.isValid(); it.advance()) {
                if (first) {
                    first = false;
                } else {
                    builder.append(' ');
                }
                builder.append(it.value());
            }
            return builder.toString();
        }
        public boolean equals(Object o) {
            if (!(o instanceof IntStream)) {
                return false;
            }
            IntStream c = (IntStream) o;
            IntIterator it = intIterator();
            IntIterator jt = c.intIterator();
            while (it.isValid() && jt.isValid()) {
                if (it.value() != jt.value()) {
                    return false;
                }
                it.advance();
                jt.advance();
            }
            return !it.isValid() && !jt.isValid();
        }
        public int hashCode() {
            int result = 0;
            for (IntIterator it = intIterator(); it.isValid(); it.advance()) {
                result *= 31;
                result += it.value();
            }
            return result;
        }
    }
}