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.util.*; 
//import javafx.util.*; 
import java.math.*;
//import java.lang.*;
public class Main 
{ 
    
    //  static int n;static ArrayList<Integer> adj[];
    //  static int m;
    //  // static int count;
    // static boolean vis[];
    //   static int deg[];
    //   static int cou;
    //  static ArrayList<Integer> arr;
    //  static  HashSet<Integer> hs;
    //  static int a[];
    //  static int leaf[];
    //  static int dist[];
    // static final long oo=(long)1e18;
    static int mod=1000000007;
    static ArrayList<Integer> aa; 
    public static void main(String[] args) throws IOException { 
    //    Scanner sc=new Scanner(System.in);
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        br = new BufferedReader(new InputStreamReader(System.in));
        int t=1;
        //int t=nextInt();
        while(t--!=0){
            int n=nextInt();
            HashMap<String,ArrayList<Integer>> hm=new HashMap<String,ArrayList<Integer>>();
            HashMap<Integer,Integer> count=new HashMap<Integer,Integer>();
            int arr[][]=new int[n-2][3];
            for(int i=0;i<n-2;i++){
                for(int j=0;j<3;j++){
                    arr[i][j]=nextInt();
                    if(!count.containsKey(arr[i][j])){
                        count.put(arr[i][j],1);
                    }
                    else{
                        count.put(arr[i][j],count.get(arr[i][j])+1);
                    }
                }
                for(int j=0;j<3;j++){
                    String p1=arr[i][j]+" "+arr[i][(j+1)%3];
                    String p2=arr[i][(j+1)%3]+" "+arr[i][j];
                    if(!hm.containsKey(p1)){
                        ArrayList<Integer> ar=new ArrayList<Integer>();
                        ar.add(arr[i][(j+2)%3]);
                        hm.put(p1,ar);
                    }
                    else{
                        ArrayList<Integer> ar=hm.get(p1);
                        ar.add(arr[i][(j+2)%3]);
                        hm.put(p1,ar);
                    }
                    if(!hm.containsKey(p2)){
                        ArrayList<Integer> ar=new ArrayList<Integer>();
                        ar.add(arr[i][(j+2)%3]);
                        hm.put(p2,ar);
                    }
                    else{
                        ArrayList<Integer> ar=hm.get(p2);
                        ar.add(arr[i][(j+2)%3]);
                        hm.put(p2,ar);
                    }
                }
               //  String p1=arr[i][0]+" "+arr[i][1];
               //  String p11=arr[i][1]+" "+arr[i][0];
               //  //Pair p1=new Pair(arr[i][0],arr[i][1]);
               //  //Pair p11=new Pair(arr[i][1],arr[i][0]);

                
               //  String p2=arr[i][2]+" "+arr[i][1];
               //  String p22=arr[i][1]+" "+arr[i][2];
               // // Pair p2=new Pair(arr[i][2],arr[i][1]);
               // // Pair p22=new Pair(arr[i][1],arr[i][2]);
                
               //  String p3=arr[i][0]+" "+arr[i][2];
               //  String p33=arr[i][2]+" "+arr[i][0];
               // // Pair p3=new Pair(arr[i][2],arr[i][0]);
               // // Pair p33=new Pair(arr[i][0],arr[i][2]);
               //  if(!hm.containsKey(p1)){

               //  }

               //  hm.put(p3,arr[i][1]);
               //  hm.put(p33,arr[i][1]);
               //  hm.put(p1,arr[i][2]);
               //  hm.put(p11,arr[i][2]);
               //  hm.put(p2,arr[i][0]);
               //  hm.put(p22,arr[i][0]);
            }
            int vis[]=new int[n+1];
            int imp=-1;
            for(int a:count.keySet()){
                if(count.get(a)==1){
                    imp=a;
                    break;
                }
            }
            int ans[]=new int[n];
            ans[0]=imp;
            vis[imp]=1;
            for(int i=0;i<n-2;i++){
                for(int j=0;j<3;j++){
                    if(arr[i][j]==imp){
                        if(count.get(arr[i][(j+1)%3])==2){
                            ans[1]=arr[i][(j+1)%3];
                            vis[ans[1]]=1;
                        }
                        else{
                            ans[1]=arr[i][(j+2)%3];
                            vis[ans[1]]=1;
                        }
                    }
                }
            }
            // for(String a:hm.keySet()){
            //     pw.println(a);
            // }
            for(int i=2;i<n;i++){
                String a=ans[i-1]+" "+ans[i-2];
                ArrayList<Integer> ar=hm.get(a);
                for(int j:ar){
                    if(vis[j]==0){
                        ans[i]=j;
                        vis[j]=1;
                    }
                }
               // Pair a=new Pair(ans[i-1],ans[i-2]);
               // pw.println(ans[i-1]+" "+ans[i-2]);
                
                //ans[i]=hm.get(a);
            }
            for(int i =0;i<n;i++){
                pw.print(ans[i]+" ");
            }
            pw.println();

        }
        pw.close();
    }
   
   
    public static BufferedReader br;
    public static StringTokenizer st;
    public static String next() {
        while (st == null || !st.hasMoreTokens()) {
       try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return st.nextToken();
    }
 
    public static Integer nextInt() {
        return Integer.parseInt(next());
    }
    public static Long nextLong() {
        return Long.parseLong(next());
    }
 
    public static Double nextDouble() {
        return Double.parseDouble(next());
    }
    // static class Pair{
    //     int x;int y;
    //     Pair(int x,int y,int z){
    //         this.x=x;
    //         this.y=y;
    //        // this.z=z;
    //      //   this.z=z;
    //       //  this.i=i;
    //     }
    // }
    // static class sorting implements Comparator<Pair>{
    //     public int compare(Pair a,Pair b){
    //         //return (a.y)-(b.y);
    //         if(a.y==b.y){
    //             return -1*(a.z-b.z);
    //         }
    //         return (a.y-b.y);
    //     }
   // }
    public static int[] na(int n)throws IOException{
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = nextInt();
        return a;
    }
    static class query implements Comparable<query>{
        int l,r,idx,block;
        static int len;
        query(int l,int r,int i){
            this.l=l;
            this.r=r;
            this.idx=i;
            this.block=l/len;
        }   
        public int compareTo(query a){
            return block==a.block?r-a.r:block-a.block;
        }
    }
    static class Pair implements Comparable<Pair>{
        int a;int b;
        Pair(int a,int b){
            this.a=a;
            this.b=b;
            //this.z=z;
        }   
        public int compareTo(Pair p){
            
            return (a-p.a);
            //return (x-a.x)>0?1:-1;
        }
    }
    // static class sorting implements Comparator<Pair>{  
    //     public int compare(Pair a1,Pair a2){  
    //         if(o1.a==o2.a)
    //             return (o1.b>o2.b)?1:-1;  
    //         else if(o1.a>o2.a)  
    //             return 1;  
    //         else  
    //             return -1;  
    //     }
    // }  
    static boolean isPrime(int n) { 
        if (n <= 1) 
            return false; 
        if (n <= 3) 
            return true; 
        if (n % 2 == 0 ||  
            n % 3 == 0) 
            return false; 
      
        for (int i = 5; 
                 i * i <= n; i = i + 6) 
            if (n % i == 0 || 
                n % (i + 2) == 0) 
                return false; 
      
        return true; 
    } 
    static int gcd(int a, int b) { 
      if (b == 0) 
        return a; 
      return gcd(b, a % b);  
    }  
    // To compute x^y under modulo m 
    static long power(long x, long y, long m){ 
        if (y == 0) 
            return 1;      
        long p = power(x, y / 2, m) % m; 
        p = (p * p) % m; 
      
        if (y % 2 == 0) 
            return p; 
        else
            return (x * p) % m; 
    }
    static long fast_pow(long base,long n,long M){
        if(n==0)
           return 1;
        if(n==1)
        return base;
        long halfn=fast_pow(base,n/2,M);
        if(n%2==0)
            return ( halfn * halfn ) % M;
        else
            return ( ( ( halfn * halfn ) % M ) * base ) % M;
    }
       static long modInverse(long n,int M){
        return fast_pow(n,M-2,M);
    }
    
} 