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.math.*;
		    import java.io.*; 
		     public class A{
		     
		    static FastReader scan=new FastReader();
		     public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
		     static LinkedList<Integer>edges[];

		      //static LinkedList<Pair>edges[];
		      static boolean stdin = true;
		        static String filein = "input";
		        static String fileout = "output";
		         // FileReader scan = new FileReader("gfgInput.txt");
		    static int dx[] = { -1, 0, 1, 0 };
		    static int dy[] = { 0, 1, 0, -1 };
		    static char Dies[]={'D','L','U','R'};
		    int dx_8[]={1,1,1,0,0,-1,-1,-1};
		    int dy_8[]={-1,0,1,-1,1,-1,0,1};
		    static char sts[]={'U','R','D','L'};
		    static boolean prime[];
		    static long LCM(long a,long b){
		        return (Math.abs(a*b))/gcd(a,b);
		       }
		        public static int upperBound(long[] array, int length, long value) {
		            int low = 0;
		            int high = length;
		            while (low < high) {
		                final int mid = low+(high-low) / 2;
		                if ( array[mid]>value) {
		                    high = mid ;
		                } else {
		                    low = mid+1;
		                }
		            }
		            return low;
		        }
		       static long gcd(long a, long b) {
		        if(a!=0&&b!=0)
		            while((a%=b)!=0&&(b%=a)!=0);
		        return a^b;
		    }
		    static int countSetBits(int n) 
		        { 
		            int count = 0; 
		            while (n > 0) { 
		                if((n&1)!=1)
		                    count++;
		                //count += n & 1; 
		                n >>= 1; 
		            } 
		            return count; 
		        } 
		     static void sieve(long n) 
		        { 
		            
		            prime = new boolean[(int)n+1]; 
		            for(int i=0;i<n;i++) 
		                prime[i] = true; 
		              
		            for(int p = 2; p*p <=n; p++) 
		            { 
		               
		                if(prime[p] == true) 
		                { 
		                    
		                    for(int i = p*p; i <= n; i += p) 
		                        prime[i] = false; 
		                } 
		            } 
		        }  
		      
		     
		     
		               static boolean isprime(long x)
		               {
		                for(long i=2;i*i<=x;i++)
		                    if(x%i==0)
		                        return false;
		                    return true;
		               }
		               static int perm=0,FOR=0;
		               
		         
		     
		    static boolean flag=false;
		    static int len=100000000;
		     
		    static ArrayList<Pair>inters=new ArrayList<Pair>();
		     
		      
		    static class comp1 implements  Comparator<Pair>{  
		    public int compare(Pair o1,Pair o2){
		    return  Integer.compare((int)o2.x,(int)o1.x);
		    }
		      }
		      public static class comp2 implements Comparator<Pair>{  
		    public int compare(Pair o1,Pair o2){
		    return Integer.compare((int)o2.x,(int)o1.x); 
		    }
		      }

		     
		        static boolean isPowerOfTwo(int n)
		    {
		        if(n==0)
		        return false;
		     
		    return (int)(Math.ceil((Math.log(n) / Math.log(2)))) == 
		           (int)(Math.floor(((Math.log(n) / Math.log(2)))));
		    }
		    static ArrayList<Integer>v;
		    static ArrayList<Integer>pows;
		    static void block(long x) 
		    { 
		       v = new ArrayList<Integer>(); 
		          
		        pows=new ArrayList<Integer>();
		       
		        while (x > 0)  
		        { 
		            v.add((int)x % 2); 
		            x = x / 2; 
		        } 
		      
		        // Displaying the output when 
		        // the bit is '1' in binary 
		        // equivalent of number. 
		        for (int i = 0; i < v.size(); i++)  
		        { 
		            if (v.get(i)==1)  
		            { 
		          pows.add(i); 
		            } 
		        } 
		     
		    } 
		     
		     
		       static long ceil(long a,long b)
		       {
		        if(a%b==0)
		            return a/b;
		        return a/b+1;
		       }
		     
		     
		     
		    static boolean isprime(int n)
		        {
		            // Corner cases
		            if (n <= 1) return false;
		            if (n <= 3) return true;
		             
		            // This is checked so that we can skip
		            // middle five numbers in below loop
		            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;
		        }
		         
		        // Function to return the smallest
		        // prime number greater than N
		        static int nextPrime(int N)
		        {
		         
		            // Base case
		            if (N <= 1)
		                return 2;
		         
		            int prime = N;
		            boolean found = false;
		         
		            // Loop continuously until isPrime returns
		            // true for a number greater than n
		            while (!found)
		            {
		                prime++;
		         
		                if (isprime(prime))
		                    found = true;
		            }
		         
		            return prime;
		        }
		      
		        
		        static long mod=(long)1e9+7;
		     
		     
		    static long nPr(long n,long r)
		    {
		        
		        long ret=1;
		        for(long i=n-r+1;i<=n;i++)
		        {
		           ret=1L*ret*i%mod;
		               }
		        return ret%mod;
		    }
		   
		   
	

		   static int arr[];
		   static int n;
		     static final int MAXN = 2000000+5;
      
    // stores smallest prime factor for every number
    static int spf[] = new int[MAXN];
		   static void sieve()
    {
        spf[1] = 1;
        for (int i=2; i<MAXN; i++)
      
            // marking smallest prime factor for every
            // number to be itself.
            spf[i] = i;
      
        // separately marking spf for every even
        // number as 2
        for (int i=4; i<MAXN; i+=2)
            spf[i] = 2;
      
        for (int i=3; i*i<MAXN; i++)
        {
            // checking if i is prime
            if (spf[i] == i)
            {
                // marking SPF for all numbers divisible by i
                for (int j=i*i; j<MAXN; j+=i)
      
                    // marking spf[j] if it is not
                    // previously marked
                    if (spf[j]==j)
                        spf[j] = i;
            }
        }
    }
      
    // A O(log n) function returning primefactorization
    // by dividing by smallest prime factor at every step
    static ArrayList<Integer> getFactorization(int x)
    {
        ArrayList<Integer> ret = new ArrayList<>();
        while (x != 1)
        {
            ret.add(spf[x]);
            x = x / spf[x];
        }
        return ret;
    }
    static long dp[][]=new long[1006][22];
    static int m;
    static long rec(int i,int j,int arr[])
    {
    	if(j==m+1){
    		//out.println(j);
    	//	out.println(i);
    	//	for(int k=0;k<m;k++)
    	//	out.print(arr[k]+" ");
    	//	out.println();
    		return 1;
    	}
    	//out.println(i+" "+j);
    	if(dp[i][j]!=-1){
    	//	out.println(i+" "+j);
    		return dp[i][j];
    	}
    	long ret=0;
    	
    	for(int k=i;k<=n;k++)
    	{
    		arr[j]=k;
    		ret+=(rec(k,j+1,arr)%mod);
    		ret%=mod;

    	}
    	//out.println(i+" "+j);

    	return dp[i][j]=ret;
    }
		    public static void main(String[] args)  throws Exception 
		    {
		    //SUCK IT UP AND DO IT ALRIGHT
		    //scan=new FastReader("vs.txt");
		    //out = new PrintWriter("hps.out");
		   
		    int tt=1;

		  
		      
		   
		    
		     int T=tt;
		    

 //tt=scan.nextInt();
		    
		    outer:while(tt-->0)
		    {
		    int n=scan.nextInt();
		    int cnt[]=new int[n];
		    Set<Pair>set=new HashSet<Pair>();
		    ArrayList<Pair>lol[]=new ArrayList[n];
		    for(int i=0;i<n;i++)
		    	lol[i]=new ArrayList();
		    for(int i=0;i<n-2;i++)
		    {
		    	int x=scan.nextInt()-1,y=scan.nextInt()-1,z=scan.nextInt()-1;
		    	ArrayList<Integer>sorted=new ArrayList<Integer>();
		    	sorted.add(x);
		    	sorted.add(y);
		    	sorted.add(z);
		    	Collections.sort(sorted);
		    	set.add(new Pair(sorted.get(0),sorted.get(1),sorted.get(2)));
		    	cnt[x]++;
		    	cnt[y]++;
		    	cnt[z]++;
		    	lol[x].add(new Pair(y,z));
		    	lol[y].add(new Pair(x,z));
		    	lol[z].add(new Pair(x,y));
		    }

		    ArrayList<Integer>arr[]=new ArrayList[4];
		    for(int i=0;i<4;i++)
		    	arr[i]=new ArrayList();
		    for(int i=0;i<n;i++)
		    {
		    	arr[cnt[i]].add(i);
		    }
		    int x=arr[1].get(0);
		    //System.out.println(x+1);
		    int res[]=new int[n];
		    Arrays.fill(res,-1);
		    res[0]=x;
		    boolean vis[]=new boolean[n];
		    vis[x]=true;
		    int j=1;
		   // System.out.println(set.contains(new Pair(0,1,3)));
		    while(true)
		    {
		    	for(Pair p:lol[x])
		    	{
		    		if(j==1||j==n-2)
		    		{
		    			//System.out.println("JJ");
		    			if(!vis[p.x]&&cnt[p.x]==2)
		    			{
		    				res[j++]=p.x;
		    				vis[p.x]=true;
		    				x=p.x;
		    				break;
		    			}
		    			else if(!vis[p.y]&&cnt[p.y]==2)
		    			{
		    				res[j++]=p.y;
		    				vis[p.y]=true;
		    				x=p.y;
		    				break;
		    			}
		    		//	for(int k=0;k<=j;k++)
		    		//		out.print((res[k]+1)+" ");
		    		//	out.println();

		    			//else out.println("FUCK");
		    		//	System.out.println("FUCK");
		    		}
		    		else if(j==n-1)
		    		{
		    			//if(x+1==4)
		    			//	System.out.println("IT");
		    			//out.println(p);
		    			//out.println(x);
		    			if(!vis[p.x]&&cnt[p.x]==1)
		    			{
		    				res[j++]=p.x;
		    				x=p.y;
		    				break;
		    			}
		    			else if(!vis[p.y]&&cnt[p.y]==1)
		    				{
		    					res[j++]=p.y;
		    					x=p.y;
		    					break;

		    				}
		    		}
		    		else 
		    		{
		    			//System.out.println("YES");
		    			int sorted[]={res[j-2],res[j-1],p.x};
		    			
		    			int newsorted[]={res[j-2],res[j-1],p.y};
		    			//System.out.println(Arrays.toString(newsorted));
		    			Arrays.sort(sorted);

		    			Pair pp=new Pair(sorted[0],sorted[1],sorted[2]);
		    			if(!vis[p.x]&&set.contains(pp))
		    			{
		    				vis[p.x]=true;
		    				res[j++]=p.x;
		    				x=p.x;
		    				break;
		    			}


		    			//sorted={res[j-2],res[j-1],p.y};
		    			//sorted[2]=p.y;
		    			//System.out.println(Arrays.toString(sorted));
		    			Arrays.sort(newsorted);
		    			pp=new Pair(newsorted[0],newsorted[1],newsorted[2]);
		    			if(!vis[p.y]&&set.contains(pp))
		    			{
		    				vis[p.y]=true;
		    				res[j++]=p.y;
		    				x=p.y;
		    				break;
		    			}
		    		}

		    	}
		    	//System.out.println(j);
		    	//if(x+1==4)
		    	//	System.out.println(j);
		    	if(j==n)
		    		break;
		    }
		   
		 //  for(int i=0;i<n;i++)
		    	//out.println((i+1)+" "+cnt[i]);
		 // for(int i=0;i<n;i++)
		  //	out.print((res[i]+1)+" ");
		    //out.println();
		    
		    for(int i=0;i<n;i++)
		    	out.print((res[i]+1)+" ");
		    out.println();

		      
		}
		    out.close();
		     
		    //SEE UP 
		     
		    }
		    static class special implements Comparable<special>{
		        int x,y;
		        String s;
		        special(int x,int y,String s)
		        {
		            this.x=x;
		           this.y=y;
		           this.s=s;
		        }
		     
		     @Override
		            public boolean equals(Object o){
		                if (o == this) return true;
		                if (o.getClass() != getClass()) return false;
		                special t = (special)o;
		                return t.x == x && t.y == y&&t.s.equals(s);
		            }
		     
		    public int compareTo(special o)
		    {
		        return Integer.compare(x,o.x);
		    }
		    }
		    static long binexp(long a,long n)
		    {
		        if(n==0)
		            return 1;
		        long res=binexp(a,n/2);
		        if(n%2==1)
		            return res*res*a;
		        else 
		            return res*res;
		    }
		     
		    static long powMod(long base, long exp, long mod) {
		           if (base == 0 || base == 1) return base;
		           if (exp == 0) return 1;
		           if (exp == 1) return (base % mod+mod)%mod;
		           long R = (powMod(base, exp/2, mod) % mod+mod)%mod;
		           R *= R;
		           R %= mod;
		           if ((exp & 1) == 1) {
		               return (base * R % mod+mod)%mod;
		           }
		           else return (R %mod+mod)%mod;
		       }
		    static double dis(double x1,double y1,double x2,double y2)
		    {
		        return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
		    }
		    static long mod(long x,long y)
		        {
		            if(x<0)
		                x=x+(-x/y+1)*y;
		            return x%y;
		        }
		     public static  long pow(long b, long e) {
		                long r = 1;
		                while (e > 0) {
		                    if (e % 2 == 1) r = r * b ;
		                    b = b * b;
		                    e >>= 1;
		                }
		                return r;
		            }
		    private static void sort(long[] arr) {
		            List<Long> list = new ArrayList<>();
		            for (long object : arr) list.add(object);
		            Collections.sort(list);
		        //Collections.reverse(list);
		            for (int i = 0; i < list.size(); ++i) arr[i] = list.get(i);
		        }
		    private static void sort2(int[] arr) {
		            List<Integer> list = new ArrayList<>();
		            for (int object : arr) list.add(object);
		            Collections.sort(list);
		        Collections.reverse(list);
		            for (int i = 0; i < list.size(); ++i) arr[i] = list.get(i);
		        }
		     public static class FastReader {
		            BufferedReader br;
		            StringTokenizer root;
		            
		     
		            public FastReader() {
		                br = new BufferedReader(new InputStreamReader(System.in));
		            }
		            FastReader(String filename)throws Exception
		            {
		     
		                br=new BufferedReader(new FileReader(filename));
		            }
		     
		            boolean hasNext(){
		                String line;
		                while(root.hasMoreTokens())
		                    return true;
		                return false;
		            }
		     
		            String next() {
		                while (root == null || !root.hasMoreTokens()) {
		                    try {
		                        root = new StringTokenizer(br.readLine());
		                    } catch (Exception addd) {
		                        addd.printStackTrace();
		                    }
		                }
		                return root.nextToken();
		            }
		     
		            int nextInt() {
		                return Integer.parseInt(next());
		            }
		     
		            double nextDouble() {
		                return Double.parseDouble(next());
		            }
		     
		            long nextLong() {
		                return Long.parseLong(next());
		            }
		     
		            String nextLine() {
		                String str = "";
		                try {
		                    str = br.readLine();
		                } catch (Exception addd) {
		                    addd.printStackTrace();
		                }
		                return str;
		            }
		             public int[] nextIntArray(int arraySize) {
		                int array[] = new int[arraySize];
		     
		                for (int i = 0; i < arraySize; i++) {
		                    array[i] = nextInt();
		                }
		     
		                return array;
		            }
		    }
		     static class Pair implements Comparable<Pair>{
		            public int x, y,z;
		            public Pair(int x1, int y1,int z1) {
		                x=x1;
		                y=y1;
		                z=z1;
		            }
		             public Pair(int x1, int y1) {
		                x=x1;
		                y=y1;
		    
		            }
		            
		            @Override
		            public int hashCode() {
		                return (int)(x + 31 * y);
		            }
		            public String toString() {
		                return x + " " + y+" "+z;
		            }
		            @Override
		            public boolean equals(Object o){
		                if (o == this) return true;
		                if (o.getClass() != getClass()) return false;
		                Pair t = (Pair)o;
		                return t.x == x && t.y == y&&t.z==z;
		            }
		    public int compareTo(Pair o)
		    {return (int)(y-o.y);
		     
		        }
		     
		    }
		     static class tuple{
		            int x,y,z;
		            tuple(int a,int b,int c){
		                x=a;
		                y=b;
		                z=c;
		            }
		        }
		        static class Edge{
		            int d,w;
		            Edge(int d,int w)
		            {
		                this.d=d;
		                this.w=w;
		            }
		        }
		    }
		     
