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.FileInputStream;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;


public class Main {
    public static boolean isFileIO = false;
    public static String fileName = "input";
    public static Scanner scanner;

    public static void main(String[] args) throws Exception {
        if (isFileIO) {
            System.setIn(new FileInputStream(fileName + ".in"));
            System.setOut(new PrintStream(fileName + ".out"));
        }
        scanner = new Scanner(System.in);

        for(int i = 0; i<1; i++) {
            int n = scanner.nextInt();

            TableDataSet set = new TableDataSet(1, n);
            set.read();
            TableDataSet res = Solve(set, n);
            //System.out.println(set);
            if (res == null) {
                System.out.println("NO");
            } else {
                System.out.println("YES");
                System.out.println(res.toString());
            }
        }
    }


    public static TableDataSet Solve(TableDataSet input, int n) {
        long[] array = input.get(0);
        ArrayList<Long> list = new ArrayList<Long>();
        for (int i = 0; i < array.length; i++) {
            list.add(array[i]);
        }
        TableDataSet res = new TableDataSet(3, n);
        ArrayList<ArrayList<Long>> tasks = new ArrayList<ArrayList<Long>>();

        while (list.size() > 0) {
            long min = Long.MAX_VALUE;
            for (int i = 0; i < list.size(); i++) {
                if (list.get(i) < min) {
                    min = list.get(i);
                }
            }

            ArrayList<Long> r = new ArrayList<Long>();
            ArrayList<Long> current = new ArrayList<Long>();
            tasks.add(current);
            for (int i = 0; i < list.size(); i++) {
                {
                    if (list.get(i) == min) {
                        current.add(list.get(i));
                    } else {
                        r.add(list.get(i));
                    }
                }
            }
            list = r;
        }


        /*
        for(int i=  0; i<tasks.size(); i++)
        {
            for(int j = 0; j<tasks.get(i).size(); j++){
                System.out.print(tasks.get(i).get(j) + " ");
            }
            System.out.println();
        }
        */



        int plans = 1;
        for(int i=  0; i<tasks.size(); i++)
        {
            if(tasks.get(i).size()>0) {
                plans *= tasks.get(i).size();
            }

            if(plans>3){
                break;
            }
        }

        //System.out.println(plans+" plans");

        if(plans >= 3){
            ArrayList<Long> p1 = new ArrayList<Long>();
            for(int i =  0; i<tasks.size(); i++)
            {
                boolean f = false;
                for(int j = 0; j<tasks.get(i).size(); j++) {
                    if (tasks.get(i).size() == 1) {
                        p1.add(findFirst(tasks.get(i).get(0), array));
                    } else {
                        if(tasks.get(i).size() == 2) {
                            if (!f) {
                                p1.add(findFirst(tasks.get(i).get(0), array));
                                f = true;
                            } else {
                                p1.add(findSecond(tasks.get(i).get(0), array));
                            }
                        }
                        else
                        {
                            p1.add(findN(tasks.get(i).get(0), j+1, array));
                        }
                    }
                }
            }



            ArrayList<Long> p2 = new ArrayList<Long>();
            int count = 0;
            for(int i =  0; i<tasks.size(); i++)
            {
                boolean f = false;
                for(int j = 0; j<tasks.get(i).size(); j++) {
                    if (tasks.get(i).size() == 1) {
                        p2.add(findFirst(tasks.get(i).get(0), array));
                    } else {
                        if(tasks.get(i).size() == 2) {
                            if (count == 0) {
                                if (!f) {
                                    p2.add(findFirst(tasks.get(i).get(0), array));
                                    f = true;
                                } else {
                                    p2.add(findSecond(tasks.get(i).get(0), array));
                                }
                            } else {
                                if (!f) {
                                    p2.add(findSecond(tasks.get(i).get(0), array));
                                    f = true;
                                } else {
                                    p2.add(findFirst(tasks.get(i).get(0), array));
                                }
                            }
                            if (j == 1) {
                                count++;
                            }
                        }
                        else
                        {
                            p2.add(findN(tasks.get(i).get(0), tasks.get(i).size()-j, array));
                        }
                    }
                }
            }




            ArrayList<Long> p3 = new ArrayList<Long>();
            boolean was = false;
            for(int i =  0; i<tasks.size(); i++)
            {
                boolean f = false;
                for(int j = 0; j<tasks.get(i).size(); j++) {
                    if (tasks.get(i).size() == 1) {
                        p3.add(findFirst(tasks.get(i).get(0), array));
                    } else {
                        if(tasks.get(i).size() == 2) {
                            if (!was) {
                                if (!f) {
                                    p3.add(findSecond(tasks.get(i).get(0), array));
                                    f = true;
                                } else {
                                    p3.add(findFirst(tasks.get(i).get(0), array));
                                }
                                was = true;
                            } else {
                                if (!f) {
                                    p3.add(findSecond(tasks.get(i).get(0), array));
                                    f = true;
                                } else {
                                    p3.add(findFirst(tasks.get(i).get(0), array));
                                }
                            }
                        }
                        else
                        {
                            if(j == 0) {
                                p3.add(findN(tasks.get(i).get(0), 1, array));
                            }
                            else {
                                p3.add(findN(tasks.get(i).get(0), tasks.get(i).size()-j+1, array));
                            }
                        }
                    }
                }
            }


            checkList(p1, array);
            checkList(p2, array);
            checkList(p3, array);

            if(checkInd(p1, p2)) {
                System.out.println("Fuck");
            }

            if(checkInd(p1, p3)) {
                System.out.println("Fuck");
            }

            if(checkInd(p2, p3)) {
                System.out.println("Fuck");
            }

            for(int  i=  0; i<p1.size(); i++) {
                res.set(0, i, p1.get(i)+1);
                res.set(1, i, p2.get(i)+1);
                res.set(2, i, p3.get(i)+1);
            }
        }
        else{
            return null;
        }

        return res;
    }

    static boolean checkInd(ArrayList<Long> list, ArrayList<Long> an) {
        for(int i = 0; i<list.size(); i++)
        {
            if(list.get(i) != an.get(i)){
                return false;
            }
        }
        return true;
    }

    static void checkList(ArrayList<Long> list, long[] array)
    {
        for(int  i =  0; i<list.size(); i++) {
            for(int j = 0; j<list.size(); j++)
            {
                if(i!=j) {
                    if (list.get(i) == list.get(j)) {
                        System.out.println("Error same");
                    }

                    if (i > j && array[(int)((list.get(i)+0))] < array[(int)((list.get(j)+0))]) {
                        System.out.println("Error order");
                    }
                }
            }
        }
    }

    static long findSecond(long r, long[] array){
        boolean f = false;
        for(int i = 0; i<array.length; i++){
            if(array[i] == r) {
                if (!f) {
                    f = true;
                } else {
                    return i;
                }
            }
        }
        return -1;
    }

    static long findFirst(long r, long[] array){
        for(int i = 0; i<array.length; i++){
            if(array[i] == r) {
                return i;
            }
        }
        return -1;
    }

    static long findN(long r, long n,  long[] array){
        int t = 0;
        for(int i = 0; i<array.length; i++){
            if(array[i] == r) {
                t++;
                if(t == n)
                {
                    return i;
                }
            }
        }
        return -1;
    }

    static long findLast(long r, long[] array){
        for(int i = array.length-1; i>=0; i--){
            if(array[i] == r) {
                return i;
            }
        }
        return -1;
    }


    static class Utils {
        static Random random = new Random();

        public static int random(int low, int high) {
            return random.nextInt(high - low + 1) + low;
        }
    }

    static class SequenceDataSet {
        long[] vals;

        public SequenceDataSet(int length, int lowBound, int highBound) {
            vals = new long[length];
            for (int i = 0; i < vals.length; i++) {
                vals[i] = Utils.random(lowBound, highBound);
            }
        }

        public SequenceDataSet(int length) {
            vals = new long[length];
        }

        public void read() {
            for (int i = 0; i < vals.length; i++) {
                vals[i] = Main.scanner.nextLong();
            }
        }

        public void set(int index, long value) {
            vals[index] = value;
        }

        public void set(long value) {
            set(0, value);
        }

        public long get(int index) {
            return vals[index];
        }

        public long get() {
            return vals[0];
        }

        public String toString() {
            StringBuilder res = new StringBuilder();
            for (int i = 0; i < vals.length; i++) {
                res.append(vals[i]);
                if (i != vals.length - 1) {
                    res.append(" ");
                }
            }
            return res.toString();
        }
    }


    static class TableDataSet {
        long[][] array;
        int width;
        int height;


        public TableDataSet(int height, int width, int lowBound, int highBound) {
            this.width = width;
            this.height = height;
            array = new long[height][];
            for (int j = 0; j < height; j++) {
                array[j] = new long[width];
                for (int i = 0; i < width; i++) {
                    array[j][i] = Utils.random(lowBound, highBound);
                }
            }
        }

        public int getWidth() {
            return width;
        }

        public int getHeight() {
            return height;
        }

        public TableDataSet(int height, int width) {
            this.width = width;
            this.height = height;
            array = new long[height][];
            for (int j = 0; j < height; j++) {
                array[j] = new long[width];
            }
        }

        public void read() {
            for (int j = 0; j < array.length; j++) {
                for (int i = 0; i < array[j].length; i++) {
                    array[j][i] = Main.scanner.nextLong();
                }
            }
        }

        public long[] get(int index) {
            return array[index];
        }

        public long get(int i, int j) {
            return array[i][j];
        }

        public long[][] get() {
            return array;
        }

        public void set(int i, int j, long value) {
            array[i][j] = value;
        }

        public void set(int index, long value) {
            array[0][index] = value;
        }

        public String toString() {
            StringBuilder res = new StringBuilder();
            for (int i = 0; i < array.length; i++) {
                for (int j = 0; j < array[i].length; j++) {
                    res.append(array[i][j]);
                    if (j != array[i].length - 1) {
                        res.append(" ");
                    }
                }

                if (i != array.length - 1) {
                    res.append("\n");
                }
            }
            return res.toString();
        }
    }
}