Bob is an avid fan of the video game "League of Leesins", and today he celebrates as the League of Leesins World Championship comes to an end! 

The tournament consisted of n (n ≥ 5) teams around the world. Before the tournament starts, Bob has made a prediction of the rankings of each team, from 1-st to n-th. After the final, he compared the prediction with the actual result and found out that the i-th team according to his prediction ended up at the p_i-th position (1 ≤ p_i ≤ n, all p_i are unique). In other words, p is a permutation of 1, 2, ..., n.

As Bob's favorite League player is the famous "3ga", he decided to write down every 3 consecutive elements of the permutation p. Formally, Bob created an array q of n-2 triples, where q_i = (p_i, p_{i+1}, p_{i+2}) for each 1 ≤ i ≤ n-2. Bob was very proud of his array, so he showed it to his friend Alice.

After learning of Bob's array, Alice declared that she could retrieve the permutation p even if Bob rearranges the elements of q and the elements within each triple. Of course, Bob did not believe in such magic, so he did just the same as above to see Alice's respond.

For example, if n = 5 and p = [1, 4, 2, 3, 5], then the original array q will be [(1, 4, 2), (4, 2, 3), (2, 3, 5)]. Bob can then rearrange the numbers within each triple and the positions of the triples to get [(4, 3, 2), (2, 3, 5), (4, 1, 2)]. Note that [(1, 4, 2), (4, 2, 2), (3, 3, 5)] is not a valid rearrangement of q, as Bob is not allowed to swap numbers belong to different triples.

As Alice's friend, you know for sure that Alice was just trying to show off, so you decided to save her some face by giving her any permutation p that is consistent with the array q she was given. 

Input

The first line contains a single integer n (5 ≤ n ≤ 10^5) — the size of permutation p.

The i-th of the next n-2 lines contains 3 integers q_{i, 1}, q_{i, 2}, q_{i, 3} (1 ≤ q_{i, j} ≤ n) — the elements of the i-th triple of the rearranged (shuffled) array q_i, in random order. Remember, that the numbers within each triple can be rearranged and also the positions of the triples can be rearranged.

It is guaranteed that there is at least one permutation p that is consistent with the input. 

Output

Print n distinct integers p_1, p_2, …, p_n (1 ≤ p_i ≤ n) such that p is consistent with array q. 

If there are multiple answers, print any. 

Example

Input


5
4 3 2
2 3 5
4 1 2


Output


1 4 2 3 5 
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;
import java.util.concurrent.LinkedBlockingDeque;


public class scratch_25 {
    // int count=0;
    //static long count=0;
    static class Reader {
        static BufferedReader reader;
        static StringTokenizer tokenizer;

        /**
         * call this method to initialize reader for InputStream
         */
        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        /**
         * get next word
         */
        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                //TODO add check for eof if necessary
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

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

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

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





    static class Pair implements Comparable<Pair>{
        long x;
        long y;
        public Pair(long x,long y){
            this.x=x;
            this.y=y;
        }
        @Override
        public int compareTo(Pair o){
            return (int)this.x-(int)o.x;


        }
        @Override
        public boolean equals(Object me) {
            Pair binMe = (Pair)me;
            if(this.x==binMe.x && this.y==binMe.y)
                return true;
            else
                return false;
        }

        @Override
        public int hashCode() {
            return (int)this.x + (int)this.y;
        }

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


    }







    public static void main(String[] args)  throws IOException {
        Reader.init(System.in);
        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        int n= Reader.nextInt();
        HashMap<Integer, ArrayList<Integer>>map= new HashMap<>();
        int done[]= new int[n];
        int arr[][]= new int[n-2][3];
        for (int i = 0; i <n-2 ; i++) {
            for (int j = 0; j <3 ; j++) {
                int x= Reader.nextInt();
                arr[i][j]=x;
                if(!map.containsKey(x)){
                    ArrayList<Integer>ar= new ArrayList<>();
                    ar.add(i);
                    map.put(x,ar);
                }
                else if(map.containsKey(x)){
                    ArrayList<Integer>ar=map.get(x);
                    ar.add(i);
                    map.put(x,ar);
                }
            }
        }
//        for (int i = 0; i <n-2 ; i++) {
//            System.out.println(Arrays.toString(arr[i]));
//        }
      //  System.out.println("map="+map);
        int ans[]=new int[n];
        for (int i = 1; i <=n ; i++) {
            if(map.get(i).size()==1){
                if(ans[0]==0){
                    ans[0]=i;
                    done[i-1]=1;
                }
                else{
                    ans[n-1]=i;
                    done[i-1]=1;
                }
            }
        }
       // System.out.println("ans_0="+Arrays.toString(ans));
        ArrayList<Integer>a1=map.get(ans[0]);
        int x= a1.get(0);
        for (int i = 0; i <3 ; i++) {
            int u= arr[x][i];
            if(map.get(u).size()==2){
                ans[1]=u;
                done[u-1]=1;
            }
        }
        int y= map.get(ans[n-1]).get(0);
        for (int i = 0; i <3 ; i++) {
            int u=arr[y][i];
            if(map.get(u).size()==2){
                ans[n-2]=u;
                done[u-1]=1;
            }
        }
          // System.out.println("ans_1="+Arrays.toString(ans));

        for (int i = 1; i <n-3 ; i++) {
            int x1= ans[i];
            int x2= ans[i-1];
            ArrayList<Integer>a=map.get(x1);
            for (int j = 0; j <a.size() ; j++) {
                int ind=a.get(j);
                boolean c1=false;
                for (int k = 0; k <3 ; k++) {
                    if(arr[ind][k]==x2){
                        c1=true;
                    }
                }
                if(c1){
                    for (int k = 0; k <3 ; k++) {
                        if(arr[ind][k]!=x1 && arr[ind][k]!=x2 && done[arr[ind][k]-1]==0){
                            ans[i+1]=arr[ind][k];
                            done[arr[ind][k]-1]=1;
                        }
                    }
                }
            }
        }
       // System.out.println("ans_f="+Arrays.toString(ans));
        for (int i = 0; i <n ; i++) {
            out.append(ans[i]+" ");
        }
        out.append("\n");





















        out.flush();
        out.close();



    }























    public static ArrayList<Integer> Sieve(int n) {
        boolean arr[]= new boolean [n+1];
        Arrays.fill(arr,true);
        arr[0]=false;
        arr[1]=false;
        for (int i = 2; i*i <=n ; i++) {
            if(arr[i]){
                for (int j = 2; j <=n/i ; j++) {
                    int u= i*j;
                    arr[u]=false;
                }}
        }
        ArrayList<Integer> ans= new ArrayList<>();
        for (int i = 0; i <n+1 ; i++) {
            if(arr[i]){
                ans.add(i);
            }
        }
        return ans;
    }




    static long power( long x, long y, long p)
    {

        long res = 1;


        x = x % p;

        if (x == 0) return 0;

        while (y > 0)
        {

            if((y & 1)==1)
                res = (res * x) % p;


            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }

    public static long ceil_div(long a, long b){
        return (a+b-1)/b;
    }

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

    static long lcm(long a, long b)
    {
        return (a*b)/gcd(a, b);
    }

}