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.lang.*;
import java.io.*;

public class Main {
    /*
     * HashMap<> map=new HashMap<>(); TreeMap<> map=new TreeMap<>();
     * map.put(p,map.getOrDefault(p,0)+1); for(Map.Entry<> mx:map.entrySet()){ int
     * v=mx.getValue(),k=mx.getKey(); }for (int i = 1; i <= 1000; i++) fac[i] =
     * fac[i - 1] * i % mod; ArrayList<Pair<Character,Integer>> l=new ArrayList<>();
     * ArrayList<> l=new ArrayList<>(); HashSet<> has=new HashSet<>();
     * PriorityQueue<Integer> pq=new PriorityQueue<>(new Comparator<Integer>(){
     * public int compare(Integer a,Integer b){ return Integer.compare(b,a); } });
     * Arrays.sort(ar,new Comparator<int[]>() { public int compare(int[] a, int[] b)
     * { return Double.compare(a[0], b[0]); } });
     */
    PrintWriter out;
    FastReader sc;
    long mod = (long) (1e9 + 7);
    long maxlong = Long.MAX_VALUE;
    long minlong = Long.MIN_VALUE;

    /******************************************************************************************
     *****************************************************************************************/
    public void sol() {
        int n = ni();
        HashMap<Integer, ArrayList<Integer>> map = new HashMap<>();
        int[][] ar = new int[n][3];
        for (int i = 0; i < n-2; i++) {
            int p = ni(), q = ni(), r = ni();
            ar[i][0] = p;
            ar[i][1] = q;
            ar[i][2] = r;
            if (map.get(p) == null) {
                ArrayList<Integer> l = new ArrayList<>();
                l.add(i);
                map.put(p, l);
            }else {
                map.get(p).add(i);
            }
            if (map.get(q) == null) {
                ArrayList<Integer> l = new ArrayList<>();
                l.add(i);
                map.put(q, l);
            } else {
                map.get(q).add(i);
            }
            if (map.get(r) == null) {
                ArrayList<Integer> l = new ArrayList<>();
                l.add(i);
                map.put(r, l);
            } else {
                map.get(r).add(i);
            }
        }
        ArrayList<Integer> a = new ArrayList<>();
        for (Map.Entry<Integer, ArrayList<Integer>> m : map.entrySet()) {
            int k = m.getKey();
            if (m.getValue().size() == 1) {
                a.add(k);
            }
        }
        StringBuilder sb = new StringBuilder();
        boolean[] bol=new  boolean[n+1];
        int  p=a.get(0) ,q=0;
        int ind=map.get(p).get(0);
        if(map.get(ar[ind][0]).size()==2)q=ar[ind][0];
        else if(map.get(ar[ind][1]).size()==2)q=ar[ind][1];
        else if(map.get(ar[ind][2]).size()==2)q=ar[ind][2];
        sb.append(a.get(0) + " " + q + " ");
        bol[p]=true;bol[q]=true;
        for(int j=2;j<n;j++){
            ArrayList<Integer> list=map.get(p);
            for(int i:list){
                  if(ar[i][0]==q||ar[i][1]==q||ar[i][2]==q){
                        if(!bol[ar[i][0]]){
                              sb.append(ar[i][0]+" ");
                              p=q;
                              q=ar[i][0];
                              bol[ar[i][0]]=true;
                        }else if(!bol[ar[i][1]]){
                              sb.append(ar[i][1]+" ");
                              p=q;
                              q=ar[i][1];
                              bol[ar[i][1]]=true;
                        }else if(!bol[ar[i][2]]){
                              sb.append(ar[i][2]+" ");
                              p=q;
                              q=ar[i][2];
                              bol[ar[i][2]]=true;
                        }
                  }
            }
        }pl(sb);
    }

    public static void main(String[] args) {
        Main g = new Main();
        g.out = new PrintWriter(System.out);
        g.sc = new FastReader();
        int t = 1;
        // t=g.ni();
        while (t-- > 0)
            g.sol();
        g.out.flush();
    }

    /****************************************************************************************
     *****************************************************************************************/
    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();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public int ni() {
        return sc.nextInt();
    }

    public long nl() {
        return sc.nextLong();
    }

    public double nd() {
        return sc.nextDouble();
    }

    public char[] rl() {
        return sc.nextLine().toCharArray();
    }

    public String rl1() {
        return sc.nextLine();
    }

    public void pl(Object s) {
        out.println(s);
    }

    public void ex() {
        out.println();
    }

    public void pr(Object s) {
        out.print(s);
    }

    public String next() {
        return sc.next();
    }

    public long abs(long x) {
        return Math.abs(x);
    }

    public int abs(int x) {
        return Math.abs(x);
    }

    public double abs(double x) {
        return Math.abs(x);
    }

    public long pow(long x, long y) {
        return (long) Math.pow(x, y);
    }

    public int pow(int x, int y) {
        return (int) Math.pow(x, y);
    }

    public double pow(double x, double y) {
        return Math.pow(x, y);
    }

    public long min(long x, long y) {
        return (long) Math.min(x, y);
    }

    public int min(int x, int y) {
        return (int) Math.min(x, y);
    }

    public double min(double x, double y) {
        return Math.min(x, y);
    }

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

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

    void sort1(int[] a) {
        ArrayList<Integer> l = new ArrayList<>();
        for (int i : a) {
            l.add(i);
        }
        Collections.sort(l, Collections.reverseOrder());
        for (int i = 0; i < a.length; i++) {
            a[i] = l.get(i);
        }
    }

    void sort(int[] a) {
        ArrayList<Integer> l = new ArrayList<>();
        for (int i : a) {
            l.add(i);
        }
        Collections.sort(l);
        for (int i = 0; i < a.length; i++) {
            a[i] = l.get(i);
        }
    }

    void sort(long[] a) {
        ArrayList<Long> l = new ArrayList<>();
        for (long i : a) {
            l.add(i);
        }
        Collections.sort(l);
        for (int i = 0; i < a.length; i++) {
            a[i] = l.get(i);
        }
    }

    void sort1(long[] a) {
        ArrayList<Long> l = new ArrayList<>();
        for (long i : a) {
            l.add(i);
        }
        Collections.sort(l, Collections.reverseOrder());
        for (int i = 0; i < a.length; i++) {
            a[i] = l.get(i);
        }
    }

    void sort(double[] a) {
        ArrayList<Double> l = new ArrayList<>();
        for (double i : a) {
            l.add(i);
        }
        Collections.sort(l);
        for (int i = 0; i < a.length; i++) {
            a[i] = l.get(i);
        }
    }

    int swap(int a, int b) {
        return a;
    }

    long swap(long a, long b) {
        return a;
    }

    double swap(double a, double b) {
        return a;
    }

    boolean isPowerOfTwo(int x) {
        return x != 0 && ((x & (x - 1)) == 0);
    }

    boolean isPowerOfTwo(long x) {
        return x != 0 && ((x & (x - 1)) == 0);
    }

    public long max(long x, long y) {
        return (long) Math.max(x, y);
    }

    public int max(int x, int y) {
        return (int) Math.max(x, y);
    }

    public double max(double x, double y) {
        return Math.max(x, y);
    }

    long sqrt(long x) {
        return (long) Math.sqrt(x);
    }

    int sqrt(int x) {
        return (int) Math.sqrt(x);
    }

    void input(int[] ar, int n) {
        for (int i = 0; i < n; i++)
            ar[i] = ni();
    }

    void input(long[] ar, int n) {
        for (int i = 0; i < n; i++)
            ar[i] = nl();
    }

    void fill(int[] ar, int k) {
        Arrays.fill(ar, k);
    }

    void yes() {
        pl("YES");
    }

    void no() {
        pl("NO");
    }

    int[] sieve(int n) {
        boolean prime[] = new boolean[n + 1];
        int[] k = new int[n + 1];
        for (int i = 0; i <= n; i++) {
            prime[i] = true;
            k[i] = i;
        }

        for (int p = 2; p <= n; p++) {
            if (prime[p] == true) {
                // sieve[p]=p;
                for (int i = p * 2; i <= n; i += p) {
                    prime[i] = false;
                    // sieve[i]=p;
                    while (k[i] % (p * p) == 0) {
                        k[i] /= (p * p);
                    }
                }
            }
        }
        return k;
    }

    int strSmall(int[] arr, int target) {
        int start = 0, end = arr.length - 1;
        int ans = -1;
        while (start <= end) {
            int mid = (start + end) / 2;
            if (arr[mid] >= target) {
                end = mid - 1;
            } else {
                ans = mid;
                start = mid + 1;
            }
        }
        return ans;
    }

    int strSmall(ArrayList<Integer> arr, int target) {
        int start = 0, end = arr.size() - 1;
        int ans = -1;
        while (start <= end) {
            int mid = (start + end) / 2;
            if (arr.get(mid) > target) {
                start = mid + 1;
                ans = start;
            } else {
                end = mid - 1;
            }
        }
        return ans;
    }

    long mMultiplication(long a, long b) {
        long res = 0;
        a %= mod;

        while (b > 0) {
            if ((b & 1) > 0) {
                res = (res + a) % mod;
            }
            a = (2 * a) % mod;

            b >>= 1;
        }
        return res;
    }

    long nCr(int n, int r, long p) {

        if (n < r)
            return 0;
        if (r == 0)
            return 1;
        long[] fac = new long[n + 1];
        fac[0] = 1;

        for (int i = 1; i <= n; i++)
            fac[i] = fac[i - 1] * i % p;
        return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p;
    }

    long power(long x, long y, long p) {
        long res = 1;
        x = x % p;

        while (y > 0) {
            if (y % 2 == 1)
                res = (res * x) % p;
            y = y >> 1;
            x = (x * x) % p;
        }

        return res;
    }

    long modInverse(long n, long p) {
        return power(n, p - 2, p);
    }

    public static class Pair implements Comparable<Pair> {
        int x;
        int y;

        public Pair(int x, int y) {
            this.x = x;
            this.y = y;
        }

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

        public boolean equals(Object o) {
            if (o instanceof Pair) {
                Pair p = (Pair) o;
                return p.x == x && p.y == y;
            }
            return false;
        }

        public int hashCode() {
            return new Double(x).hashCode() * 31 + new Double(y).hashCode();
        }

        public int compareTo(Pair other) {
            if (this.x == other.x) {
                return Long.compare(this.y, other.y);
            }
            return Long.compare(this.x, other.x);
        }
    }

}