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.util.*;
import java.io.*;
import java.math.*;
 
public class C
{
    static class Triplet{
        int a, b, c;
        public Triplet(int a, int b, int c){
            this.a = a;
            this.b = b;
            this.c = c;
        }

        @Override
        public boolean equals(Object o){
            Triplet ob = (Triplet)o;
            return ob.a == this.a && ob.b == this.b && ob.c == this.c;
        }

        @Override
        public int hashCode(){
            return Objects.hash(this.a, this.b, this.c);
        }
    }

    public static void process(int test_number)throws IOException
    {
        int n = ni(), res[] = new int[n + 1], freq[] = new int[n + 1];
        Triplet arr[] = new Triplet[n - 2];
        HashMap<String, ArrayList<Triplet>> map = new HashMap<>();
        HashSet<Triplet> taken = new HashSet<Triplet>();

        for(int i = 0; i < n - 2; i++){
            int tmp[] = {ni(), ni(), ni()};
            Arrays.sort(tmp);
            for(int j = 0; j < 3; j++)
                freq[tmp[j]]++;
            arr[i] = new Triplet(tmp[0], tmp[1], tmp[2]);

           String key1 = tmp[0] + " " + tmp[1], key2 = tmp[0] + " " + tmp[2], key3 = tmp[1] + " " + tmp[2];
           map.putIfAbsent(key1, new ArrayList<>());
           (map.get(key1)).add(arr[i]);

           map.putIfAbsent(key2, new ArrayList<>());
           (map.get(key2)).add(arr[i]);

           map.putIfAbsent(key3, new ArrayList<>());
           (map.get(key3)).add(arr[i]);
        }          

        for(int i = 0; i < n - 2; i++){
            int a = arr[i].a, b = arr[i].b, c = arr[i].c;
            if(freq[a] == 1 || freq[b] == 1 || freq[c] == 1){
                res[1] = a;
                res[2] = b;
                res[3] = c;
                String key1 = a + " " + b, key2 = a + " " + c, key3 = b + " " + c;
                (map.get(key1)).remove(arr[i]);
                (map.get(key2)).remove(arr[i]);
                (map.get(key3)).remove(arr[i]);

                break;
            }
        }

        for(int i = 4; i <= n; i++){ 
            int a1 = res[i - 3], a2 = res[i - 2], a3 = res[i - 1];
            String key1 = Math.min(a1, a2) + " " + Math.max(a1, a2), 
                    key2 = Math.min(a1, a3) + " " + Math.max(a1, a3),
                    key3 = Math.min(a2, a3) + " " + Math.max(a2, a3);

            /*
                if success
                key1 -> a3, a1, a2
                key2 -> a2, a1, a3
                key3 -> a1, a2, a3
            */

            ArrayList<Triplet> li = null;
            li = map.get(key1);
            Triplet t = null;
            boolean flag = true;
            if(li != null && li.size() != 0){
                t = li.get(0);
                res[i - 3] = a3;
                res[i - 2] = a1;
                res[i - 1] = a2;
                flag = false;
            }

            if(flag)
                li = map.get(key2);
            if(flag && li != null && li.size() != 0){
                t = li.get(0);
                res[i - 3] = a2;
                res[i - 2] = a1;
                res[i - 1] = a3;
                flag = false;
            }

            if(flag)
                li = map.get(key3);
            if(flag && li != null && li.size() != 0){
                t = li.get(0);
                res[i - 3] = a1;
                res[i - 2] = a2;
                res[i - 1] = a3;
                flag = false;
            }

            (map.get(key1)).remove(t);
            (map.get(key2)).remove(t);
            (map.get(key3)).remove(t);

            

            int tmp[] = {t.a, t.b, t.c};  
            for(int j = 0; j < 3; j++){
                if(tmp[j] != a1 && tmp[j] != a2 && tmp[j] != a3){
                    res[i] = tmp[j];
                    break;
                }
            }

            a1 = res[i - 2]; a2 = res[i - 1]; a3 = res[i];
            key1 = Math.min(a1, a2) + " " + Math.max(a1, a2);
            key2 = Math.min(a1, a3) + " " + Math.max(a1, a3);
            key3 = Math.min(a2, a3) + " " + Math.max(a2, a3);
            
            (map.get(key1)).remove(t);
            (map.get(key2)).remove(t);
            (map.get(key3)).remove(t);
        }

        for(int i = 1; i <= n; i++)
            p(res[i] + " ");
        p('\n');
    }
 
    static final long mod = (long)1e9+7l;
    static boolean DEBUG = true;
    static FastReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc = new FastReader();
 
        long s = System.currentTimeMillis();
        int t = 1;
        for(int i = 1; i <= t; i++)
            process(i);
 
        out.flush();
        System.err.println(System.currentTimeMillis()-s+"ms");
    }

    static void trace(Object... o){ if(!DEBUG) return; System.err.println(Arrays.deepToString(o)); };    
    static void pn(Object o){ out.println(o); }
    static void p(Object o){ out.print(o); }
    static int ni()throws IOException{ return Integer.parseInt(sc.next()); }
    static long nl()throws IOException{ return Long.parseLong(sc.next()); }
    static double nd()throws IOException{ return Double.parseDouble(sc.next()); }
    static String nln()throws IOException{ return sc.nextLine(); }
    static long gcd(long a, long b){ return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b){ return (b==0)?a:gcd(b,a%b); }
    
    static class FastReader{ 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader(){ 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next(){ 
            while (st == null || !st.hasMoreElements()){ 
                try{ st = new StringTokenizer(br.readLine()); } catch (IOException  e){ e.printStackTrace(); } 
            } 
            return st.nextToken(); 
        } 
  
        String nextLine(){ 
            String str = ""; 
            try{ str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } 
            return str; 
        } 
    } 
}
