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.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class C {

    private static class Triple {
        int a;
        int b;
        int c;
        public Triple(String input) {
            String[] tok = input.split(" ");
            a = Integer.parseInt(tok[0]);
            b = Integer.parseInt(tok[1]);
            c = Integer.parseInt(tok[2]);
        }

        @Override public int hashCode() {
            final int PRIME = 59;
            int result = 1;
            result = (result*PRIME) + a;
            result = (result*PRIME) + b;
            result = (result*PRIME) + c;
            return result;
        }

        @Override public boolean equals(Object o) {
            if (o == this) return true;
            if (!(o instanceof Triple)) return false;
            Triple other = (Triple) o;
            return (this.a == other.a) && (this.b == other.b) && (this.c == other.c);
        }

        public Tuple[] getAllTuples() {
            Tuple[] result = new Tuple[3];
            result[0] = new Tuple(a, b);
            result[1] = new Tuple(b, c);
            result[2] = new Tuple(a, c);
            return result;
        }
    }

    private static class Tuple {
        int a;
        int b;

        public Tuple(int x, int y) {
            a = Math.min(x, y);
            b = Math.max(x, y);
        }

        @Override public int hashCode() {
            final int PRIME = 59;
            int result = 1;
            result = (result*PRIME) + a;
            result = (result*PRIME) + b;
            return result;
        }

        @Override public boolean equals(Object o) {
            if (o == this) return true;
            if (!(o instanceof Tuple)) return false;
            Tuple other = (Tuple) o;
            return (this.a == other.a) && (this.b == other.b);
        }
    }

    private static List<Triple>[] singleIndex;
    private static Map<Tuple, List<Triple>> doubleIndex;
    private static Set<Integer> singleDone;
    private static Set<Triple> tripleDone;

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int N = getInt(br);
        singleIndex = new List[N+1];
        doubleIndex = new HashMap<>();
        singleDone = new HashSet<>();
        tripleDone = new HashSet<>();
        for (int i=1; i<=N; i++) {
            singleIndex[i] = new ArrayList<>();
        }

        for (int i=0; i<N-2; i++) {
            Triple t = new Triple(br.readLine());
            indexTriple(t);
        }
        process(N);
    }

    private static void process(int N) {
        int[] result = new int[N];

        // Find first element;
        int firstElement = -1;
        Triple firstTriple = null;

        for (int i=1; i<=N; i++) {
            int count = singleIndex[i].size();
            if (count == 1) {
                firstElement = i;
                firstTriple = singleIndex[i].get(0);
                break;
            }
        }
        result[0] = firstElement;
        singleDone.add(firstElement);

        Tuple nextTuple = getRemainingTuple(firstElement, firstTriple);
        int aCount = singleIndex[nextTuple.a].size();
        int bCount = singleIndex[nextTuple.b].size();

        int newStart = -1;
        if (aCount == 2) {
            result[1] = nextTuple.a;
            result[2] = nextTuple.b;
        } else {
            result[1] = nextTuple.b;
            result[2] = nextTuple.a;
        }
        singleDone.add(result[1]);
        singleDone.add(result[2]);

        tripleDone.add(firstTriple);
        singleDone.add(result[0]);
        int nextIndex = 3;

        Tuple lookup = new Tuple(result[1], result[2]);
        while(nextIndex < N) {
            int next = getNextElement(lookup);
            result[nextIndex] = next;
            lookup = new Tuple(result[nextIndex - 1], next);
            nextIndex++;
        }
        for (int i=0; i<N; i++) {
            System.out.print(result[i] + " ");
        }
    }

    private static int getNextElement(Tuple t) {
        List<Triple> list = doubleIndex.get(t);
        Triple nextTriple = null;
        for (Triple triple : list) {
            if (!tripleDone.contains(triple)) {
                nextTriple = triple;
            }
        }

        tripleDone.add(nextTriple);
        // Find out which element is not yet done.
        if (!singleDone.contains(nextTriple.a)) {
            singleDone.add(nextTriple.a);
            return nextTriple.a;
        } else if (!singleDone.contains(nextTriple.b)) {
            singleDone.add(nextTriple.b);
            return nextTriple.b;
        } else {
            singleDone.add(nextTriple.c);
            return nextTriple.c;
        }
    }

    private static Tuple getRemainingTuple(int start, Triple triple) {
        if (triple.a == start) {
            return new Tuple(triple.b, triple.c);
        } else if (triple.b == start) {
            return new Tuple(triple.a, triple.c);
        } else {
            return new Tuple(triple.a, triple.b);
        }
    }

    private static void indexTriple(Triple t) {
        singleIndex[t.a].add(t);
        singleIndex[t.b].add(t);
        singleIndex[t.c].add(t);

        Tuple[] tuples = t.getAllTuples();
        for (Tuple tuple : tuples) {
            if (doubleIndex.containsKey(tuple)) {
                List<Triple> list = doubleIndex.get(tuple);
                list.add(t);
//                doubleIndex.put(id, list);
            } else {
                List<Triple> list = new ArrayList<>();
                list.add(t);
                doubleIndex.put(tuple, list);
            }
        }
    }

    private static Integer getInt(BufferedReader br) throws Exception {
        return Integer.parseInt(br.readLine());
    }

    private static Long getLong(BufferedReader br) throws Exception {
        return Long.parseLong(br.readLine());
    }

    private static int[] getIntArray(int N, BufferedReader br) throws Exception {
        String s = br.readLine();
        String[] tokens = s.split(" ");
        int[] result = new int[N+1];

        for (int i=0; i<N; i++) {
            result[i+1] = Integer.parseInt(tokens[i]);
        }
        return result;
    }

    private static long[] getLongArray(int N, BufferedReader br) throws Exception {
        String s = br.readLine();
        String[] tokens = s.split(" ");
        long[] result = new long[N+1];

        for (int i=0; i<N; i++) {
            result[i+1] = Long.parseLong(tokens[i]);
        }
        return result;
    }
}
