You have a simple undirected graph consisting of n vertices and m edges. The graph doesn't contain self-loops, there is at most one edge between a pair of vertices. The given graph can be disconnected.

Let's make a definition.

Let v_1 and v_2 be two some nonempty subsets of vertices that do not intersect. Let f(v_{1}, v_{2}) be true if and only if all the conditions are satisfied:

  1. There are no edges with both endpoints in vertex set v_1. 
  2. There are no edges with both endpoints in vertex set v_2. 
  3. For every two vertices x and y such that x is in v_1 and y is in v_2, there is an edge between x and y. 



Create three vertex sets (v_{1}, v_{2}, v_{3}) which satisfy the conditions below;

  1. All vertex sets should not be empty. 
  2. Each vertex should be assigned to only one vertex set. 
  3. f(v_{1}, v_{2}), f(v_{2}, v_{3}), f(v_{3}, v_{1}) are all true. 



Is it possible to create such three vertex sets? If it's possible, print matching vertex set for each vertex.

Input

The first line contains two integers n and m (3 ≤ n ≤ 10^{5}, 0 ≤ m ≤ min(3 ⋅ 10^{5}, (n(n-1))/(2))) — the number of vertices and edges in the graph.

The i-th of the next m lines contains two integers a_{i} and b_{i} (1 ≤ a_{i} < b_{i} ≤ n) — it means there is an edge between a_{i} and b_{i}. The graph doesn't contain self-loops, there is at most one edge between a pair of vertices. The given graph can be disconnected.

Output

If the answer exists, print n integers. i-th integer means the vertex set number (from 1 to 3) of i-th vertex. Otherwise, print -1.

If there are multiple answers, print any.

Examples

Input


6 11
1 2
1 3
1 4
1 5
1 6
2 4
2 5
2 6
3 4
3 5
3 6


Output


1 2 2 3 3 3 

Input


4 6
1 2
1 3
1 4
2 3
2 4
3 4


Output


-1

Note

In the first example, if v_{1} = \{ 1 \}, v_{2} = \{ 2, 3 \}, and v_{3} = \{ 4, 5, 6 \} then vertex sets will satisfy all conditions. But you can assign vertices to vertex sets in a different way; Other answers like "2 3 3 1 1 1" will be accepted as well.

<image>

In the second example, it's impossible to make such vertex sets.
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.Scanner; 
import java.util.StringTokenizer; 
import java.util.*;
import java.io.*;
public class codeforces 
{ 
   static class Student{
       int x,y;
        Student(int x,int y){
            this.x=x;
            this.y=y;
        }
    }
    static int sieveOfEratosthenes(int n) 
    { 
        // Create a boolean array "prime[0..n]" and initialize 
        // all entries it as true. A value in prime[i] will 
        // finally be false if i is Not a prime, else true. 
        int pos=0;
        boolean prime[] = new boolean[n+1]; 
        for(int i=0;i<=n;i++) 
            prime[i] = true; 
          
        for(int p = 2; p*p <=n; p++) 
        { 
            // If prime[p] is not changed, then it is a prime 
            if(prime[p] == true) 
            { 
                // Update all multiples of p 
                for(int i = p*p; i <= n; i += p) 
                    prime[i] = false; 
            } 
        } 
          
        // Print all prime numbers 
        for(int i = 2; i <= n; i++) 
        { 
            if(prime[i] == true) 
                ++pos;
        }
        return pos;
    }
static    class Sortbyroll implements Comparator<Student> 
{ 
    // Used for sorting in ascending order of 
    // roll number 
    public int compare(Student c, Student b) 
    { 
        return c.x-b.y;
    } 
} 
    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; 
        } 
    }
    static class Edge{
        int a,b;
        Edge(int a,int b){
            this.a=a;
            this.b=b;
        }
    }
    static ArrayList<ArrayList<Integer>>adj;
    static HashMap<Integer,Integer>map;
    static HashMap<Integer,Integer>m1;
    static HashMap<Integer,Integer>m2;
    static HashMap<Integer,Integer>m3;
    static int c1,c2,c3;
    public static void main(String[] args){
        //long sum=0;
        FastReader sc=new FastReader();
        int n,m,i,pos,a,b;
        n=sc.nextInt();
        m=sc.nextInt();
       adj=new ArrayList<>();
        for(i=0;i<=n;i++)
            adj.add(new ArrayList<>());
        int temp[][]=new int[m][2];
        for(i=0;i<m;i++){
            a=sc.nextInt();
            b=sc.nextInt();
            temp[i][0]=a;
            temp[i][1]=b;
            adj.get(a).add(b);
            adj.get(b).add(a);
        }
        map=new HashMap<>();
        m1=new HashMap<>();
        m2=new HashMap<>();
        m3=new HashMap<>();
        c1=0;
        c2=0;
        c3=0;
        pos=0;
        for(i=0;i<m;i++){
            if(!map.containsKey(temp[i][0])){
                pos=insert(temp[i][0]);
            }
            if(!map.containsKey(temp[i][1]))
                pos=insert(temp[i][1]);
        }
        if(pos==1)
            System.out.println(-1);
        else{
            for(i=1;i<=n;i++){
                if(!map.containsKey(i))
                {
                    pos=1;
                    break;
                }
                if(m1.containsKey(i)&&!(m1.get(i)==c1))
                    pos=1;
                if(m2.containsKey(i)&&!(m2.get(i)==c2))
                    pos=1;
                if(m3.containsKey(i)&&!(m3.get(i)==c3))
                    pos=1;
            }
            if(pos==1||c1==0||c2==0||c3==0)
                System.out.println(-1);
            else{
                for(i=1;i<=n;i++){
                    System.out.print(map.get(i)+" ");
                }
                System.out.println();
            }
        }
    }
    static int insert(int x){
        int pos=1,j;
         if(!m1.containsKey(x)){
             pos=0;
             ++c1;
                    map.put(x,1);
                    for(j=0;j<adj.get(x).size();j++){
                        if(!m1.containsKey(adj.get(x).get(j)))
                            m1.put(adj.get(x).get(j),1);
                        else
                            m1.put(adj.get(x).get(j),m1.get(adj.get(x).get(j))+1);
                    }
                }
        else if(!m2.containsKey(x)){
             pos=0;
            ++c2;
                    map.put(x,2);
                    for(j=0;j<adj.get(x).size();j++){
                        if(!m2.containsKey(adj.get(x).get(j)))
                            m2.put(adj.get(x).get(j),1);
                        else
                            m2.put(adj.get(x).get(j),m2.get(adj.get(x).get(j))+1);
                    }
                }
        else if(!m3.containsKey(x)){
             pos=0;
            ++c3;
                    map.put(x,3);
                    for(j=0;j<adj.get(x).size();j++){
                        if(!m3.containsKey(adj.get(x).get(j)))
                            m3.put(adj.get(x).get(j),1);
                        else
                            m3.put(adj.get(x).get(j),m3.get(adj.get(x).get(j))+1);
                    }
                }
        return pos;
    }
 static long power(long x, long y, long p) 
{ 
    long res = 1;      // Initialize result 
  
    x = x % p;  // Update x if it is more than or  
                // equal to p 
  
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if ((y & (long)1)%2!=0) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p;   
    } 
    return res%p; 
} 
   static int find(int x,int parent[]) 
    { 
        // Finds the representative of the set 
        // that x is an element of 
        while(parent[x]!=x) 
        { 
            // if x is not the parent of itself 
            // Then x is not the representative of 
            // his set,
            x=parent[x];
  
            // so we recursively call Find on its parent 
            // and move i's node directly under the 
            // representative of this set 
        } 
  
        return x; 
    }
    static void union(int x, int y,int rank[],int parent[]) 
    { 
        // Find representatives of two sets 
        int xRoot = find(x,parent), yRoot = find(y,parent); 
  
        // Elements are in the same set, no need 
        // to unite anything. 
        if (xRoot == yRoot) 
            return; 
  
         // If x's rank is less than y's rank 
        if (rank[xRoot] < rank[yRoot]) 
  
            // Then move x under y  so that depth 
            // of tree remains less 
            parent[xRoot] = yRoot; 
  
        // Else if y's rank is less than x's rank 
        else if (rank[yRoot] < rank[xRoot]) 
  
            // Then move y under x so that depth of 
            // tree remains less 
            parent[yRoot] = xRoot; 
  
        else // if ranks are the same 
        { 
            // Then move y under x (doesn't matter 
            // which one goes where) 
            parent[yRoot] = xRoot; 
  
            // And increment the the result tree's 
            // rank by 1 
            rank[xRoot] = rank[xRoot] + 1; 
        } 
    } 
    static long gcd(long a, long b) 
    { 
        if (a == 0) 
            return b; 
        return gcd(b % a, a); 
    }
}