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.sql.Array;
import java.util.*;

public class Main {
    static PrintWriter pw;
    static Scanner sc;
    static long ceildiv(long x, long y) { return (x+y-1)/y; }
    static int mod(long x, int m) { return (int)((x%m+m)%m); }
    static void put(TreeMap<Pair, Integer> map, Pair p){if(map.containsKey(p)) map.replace(p, map.get(p)+1); else map.put(p, 1); }
    static void remove(TreeMap<Pair, Integer> map, Pair p){ if(map.get(p)==1) map.remove(p);else map.replace(p, map.get(p)-1); }
    static long gcd(long x, long y) {return y==0?x:gcd(y, x%y);}
    static int Int(boolean x){ return x?1:0; }
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        pw=new PrintWriter(System.out);
        int n=sc.nextInt();
        ArrayList<Pair>[] arr=new ArrayList[n];
        for(int i=0; i<n; i++)
            arr[i]=new ArrayList<>(2);
        for(int i=0; i<n-2; i++){
            int x=sc.nextInt()-1, y=sc.nextInt()-1, z=sc.nextInt()-1;
            arr[x].add(new Pair(y, z));
            arr[y].add(new Pair(x, z));
            arr[z].add(new Pair(y, x));
        }
        int idx=0;
        for(int i=0; i<n; i++){
            if(arr[i].size()==1){
                idx=i;
                break;
            }
        }
        int temp=idx;
        boolean[] visit=new boolean[n];
        int prev=idx;
        int[][] ans=new int[2][n];
        for(int c=0; c<n; c++){
            ans[0][c]=idx+1;
            visit[idx]=true;
            for(Pair p: arr[idx]){
                if(!visit[p.x] && contains(arr[p.x], prev) && contains(arr[p.x], idx)){
                    prev=idx;
                    idx=p.x;
                    break;
                }else if(!visit[p.y] && contains(arr[p.y], prev) && contains(arr[p.y], idx)){
                    prev=idx;
                    idx=p.y;
                    break;
                }
            }
        }
        idx=temp;
        prev=idx;
        Arrays.fill(visit, false);
        for(int c=0; c<n; c++){
            ans[1][c]=idx+1;
            visit[idx]=true;
            for(Pair p: arr[idx]){
                if(!visit[p.y] && contains(arr[p.y], prev) && contains(arr[p.y], idx)){
                    prev=idx;
                    idx=p.y;
                    break;
                }else if(!visit[p.x] && contains(arr[p.x], prev) && contains(arr[p.x], idx)){
                    prev=idx;
                    idx=p.x;
                    break;
                }
            }
        }
        if(check(ans[0], arr))
            printArr(ans[0]);
        else
            printArr(ans[1]);
        pw.close();
    }
    static boolean check(int[] ans, ArrayList<Pair>[] arr){
        for(int i=0; i<ans.length; i++){
            if(i>=2){
                if(!contains(arr[ans[i]-1], ans[i-1]-1) || !contains(arr[ans[i]-1], ans[i-2]-1))
                    return false;
            }else if(i==1){
                if(!contains(arr[ans[i]-1], ans[i-1]-1))
                    return false;
            }
            if(i<ans.length-2){
                if(!contains(arr[ans[i]-1], ans[i+1]-1) || !contains(arr[ans[i]-1], ans[i+2]-1))
                    return false;
            }else if(i==ans.length-2){
                if(!contains(arr[ans[i]-1], ans[i+1]-1))
                    return false;
            }
        }
        return true;
    }
    static boolean contains(ArrayList<Pair> list, int val){
        for(Pair p: list){
            if(p.x==val || p.y==val)
                return true;
        }
        return false;
    }
    static void printArr(int[] arr) {
        for (int i = 0; i < arr.length - 1; i++)
            pw.print(arr[i] + " ");
        pw.println(arr[arr.length - 1]);
    }
    static void printArr(long[] arr) {
        for (int i = 0; i < arr.length - 1; i++)
            pw.print(arr[i] + " ");
        pw.println(arr[arr.length - 1]);
    }
    static void printArr(Integer[] arr) {
        for (int i = 0; i < arr.length; i++)
            pw.print(arr[i] + " ");
        pw.println();
    }
    static void printArr(char[] arr) {
        for (int i = 0; i < arr.length; i++)
            pw.print(arr[i]==0? '1': arr[i]);
        pw.println();
    }
    static void printArr(ArrayList<Integer> list) {
        for (int i = 0; i < list.size(); i++)
            pw.print(list.get(i)+" ");
        pw.println();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;
        public Scanner(InputStream s) {
            br = new BufferedReader(new InputStreamReader(s));
        }

        public Scanner(FileReader r) {
            br = new BufferedReader(r);
        }

        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

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

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

        public String nextLine() throws IOException {
            return br.readLine();
        }

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

        public int[] nextArr(int n) throws IOException {
            int[] arr = new int[n];
            for (int i = 0; i < arr.length; i++)
                arr[i] = nextInt();
            return arr;
        }
        public Integer[] nextsort(int n) throws IOException{
            Integer[] arr=new Integer[n];
            for(int i=0; i<n; i++)
                arr[i]=nextInt();
            return arr;
        }
        public Pair nextPair() throws IOException{
            return new Pair(nextInt(), nextInt());
        }
        public Pair[] nextPairArr(int n) throws IOException{
            Pair[] arr=new Pair[n];
            for(int i=0; i<n; i++)
                arr[i]=nextPair();
            return arr;
        }
        public boolean ready() throws IOException {
            return br.ready();
        }
    }
    static class Pair implements Comparable<Pair>{
        int x;
        int y;
        public Pair(int x, int y) {
            this.x=x;
            this.y=y;
        }
        public int hashCode() {
            return (this.x*1000+this.y);
        }
        public int compareTo(Pair p){
            int min1=Math.min(x, y), min2=Math.min(p.x, p.y);
            if(min1!=min2)
                return min1-min2;
            if(x==p.x)
                return y-p.y;
            return x-p.x;
        }
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (this.getClass() != obj.getClass()) {
                return false;
            }
            Pair p = (Pair) obj;
            return this.x==p.x && this.y==p.y;
        }
        public Pair clone(){
            return new Pair(x, y);
        }
        public String toString(){
            return this.x+" "+this.y;
        }
        public void add(Pair p){
            x+=p.x;
            y+=p.y;
        }
    }
    static class Union{
        int[] rep, size;
        int sets;
        public Union(int n){
            rep=new int[n];
            size=new int[n];
            sets=n;
            Arrays.fill(size, 1);
            for(int i=0; i<n; i++)
                rep[i]=i;
        }
        public void join(int x, int y){
            int a=getSet(x), b=getSet(y);
            if(a==b) return;
            sets--;
            if(size[a]>size[b]){
                rep[b]=a;
                size[a]+=size[b];
            }else{
                rep[a]=b;
                size[b]+=size[a];
            }
        }
        public int getSet(int x){
            if(rep[x]==x)
                return x;
            return rep[x]=getSet(rep[x]);
        }
    }
}