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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.io.OutputStreamWriter;
import java.util.NoSuchElementException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.util.Set;
import java.io.IOException;
import java.io.Reader;
import java.io.InputStreamReader;
import java.util.Objects;
import java.util.List;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Ruins He
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        private int n;
        private Graph graph;
        private DisjointSet disjointSet;
        int[] tags;
        List<List<Integer>> lists = new ArrayList<>();
        Set<Pair<Integer, Integer>> edges = new HashSet<>();

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            n = in.nextInt();
            int m = in.nextInt();
            graph = new Graph(n);
            tags = new int[n];
            for (int i = 0; i < 3; i++) {
                lists.add(new ArrayList<>());
            }

            for (int i = 0; i < m; i++) {
                int u = in.nextInt() - 1;
                int v = in.nextInt() - 1;
                graph.addEdge(u, v);
                graph.addEdge(v, u);
                edges.add(Pair.ofUnique(u, v));
            }

            disjointSet = new DisjointSet(n);
            int current = 0;
            int[] count = new int[3];

            for (int i = 0; i < n; i++) {
                if (disjointSet.find(i) == i) {
                    if (current == 3) {
                        out.println(-1);
                        return;
                    }
                    count[current] = process(i, current);
                    current++;
                }
            }

            if (current != 3
                    || (long) count[0] * count[1] + (long) count[1] * count[2] + (long) count[0] * count[2] != m) {
                out.println(-1);
                return;
            }

            for (int i = 0; i < 3; i++) {
                for (int j = i + 1; j < 3; j++) {
                    List<Integer> first = lists.get(i);
                    List<Integer> second = lists.get(j);
                    for (int u : first) {
                        for (int v : second) {
                            if (!edges.contains(Pair.ofUnique(u, v))) {
                                out.println(-1);
                                return;
                            }
                        }
                    }
                }
            }

            out.printInts(tags);
        }

        private int process(int u, int tag) {
            boolean[] used = new boolean[n];
            for (int i = 0; i < n; i++) {
                used[i] = i < u || disjointSet.find(i) != i;
            }

            for (int v : graph.adj(u)) {
                if (!used[v]) {
                    used[v] = true;
                }
            }
            int result = 0;
            List<Integer> array = lists.get(tag);
            for (int i = 0; i < n; i++) {
                if (!used[i]) {
                    result++;
                    tags[i] = tag + 1;
                    array.add(i);
                    disjointSet.merge(i, u);
                }
            }

            return result;
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer = null;

        public InputReader(Reader reader) {
            this.reader = new BufferedReader(reader, 32767);
        }

        public InputReader(InputStream inputStream) {
            this(new InputStreamReader(inputStream));
        }

        public String next() {
            if (hasNext()) return tokenizer.nextToken();
            else throw new NoSuchElementException();
        }

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

        public boolean hasNext() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    String nextLine = reader.readLine();
                    if (nextLine == null) return false;
                    tokenizer = new StringTokenizer(nextLine);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.hasMoreTokens();
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        private OutputWriter(Writer writer, boolean autoFlush) {
            this.writer = new PrintWriter(new BufferedWriter(writer, 32767), autoFlush);
        }

        public OutputWriter(Writer writer) {
            this(writer, true);
        }

        public OutputWriter(OutputStream outputStream) {
            this(new OutputStreamWriter(outputStream), false);
        }

        public OutputWriter println() {
            writer.println();
            return this;
        }

        public OutputWriter println(int value) {
            writer.println(value);
            return this;
        }

        public OutputWriter print(int value) {
            writer.print(value);
            return this;
        }

        public OutputWriter print(Object object) {
            writer.print(object);
            return this;
        }

        public void close() {
            writer.close();
        }

        public void printInts(int[] values) {
            for (int i = 0; i < values.length; i++) {
                if (i > 0) print(" ");
                print(values[i]);
            }
            println();
        }

    }

    static class DisjointSet {
        public int[] p;

        public DisjointSet(int n) {
            p = new int[n + 1];
            for (int i = 0; i <= n; i++) p[i] = i;
        }

        public int find(int x) {
            return x == p[x] ? x : (p[x] = find(p[x]));
        }

        public void merge(int u, int parent) {
            if (find(u) == find(parent)) return;
            p[find(u)] = find(parent);
        }

    }

    static class Pair<F extends Comparable<F>, S extends Comparable<S>> implements Comparable<Pair<F, S>> {
        public F first;
        public S second;

        public Pair(F first, S second) {
            this.first = first;
            this.second = second;
        }

        public static <F extends Comparable<F>, S extends Comparable<S>> Pair<F, S> of(
                F first, S second) {
            return new Pair<>(first, second);
        }

        public static <T extends Comparable<T>> Pair<T, T> ofUnique(
                T first, T second) {
            if (first == null) return of(null, second);
            else if (second == null) return of(null, first);
            else return first.compareTo(second) < 0 ? of(first, second) : of(second, first);
        }

        public int compareTo(Pair<F, S> other) {
            int fd = this.first.compareTo(other.first);
            if (fd != 0) return fd;
            else return this.second.compareTo(other.second);
        }

        public String toString() {
            return "Pair{" + first + ", " + second + "}";
        }

        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair<?, ?> pair = (Pair<?, ?>) o;

            if (first != null ? !first.equals(pair.first) : pair.first != null) return false;
            return !(second != null ? !second.equals(pair.second) : pair.second != null);

        }

        public int hashCode() {
            return Objects.hash(first, second);
        }

    }

    static class Graph {
        protected final List<Integer>[] edges;
        protected final int n;
        protected int m = 0;

        public Graph(int n) {
            this.n = n;
            this.edges = new List[n];
            for (int i = 0; i < n; i++) {
                edges[i] = new ArrayList<>();
            }
        }

        public void addEdge(int u, int v) {
            edges[u].add(v);
            m++;
        }

        public int adjSize(int u) {
            return edges[u].size();
        }

        public Iterable<Integer> adj(int u) {
            return edges[u];
        }

        public String toString() {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append("graph with ").append(n).append(" nodes ");
            int res = 0;
            for (int i = 0; i < n; i++) res += adjSize(i);
            stringBuilder.append(res / 2).append(" edges\n");
            for (int u = 0; u < n; u++) {
                for (int v : adj(u)) {
                    if (u < v) {
                        stringBuilder.append(u).append(" ").append(v).append("\n");
                    }
                }
            }
            return stringBuilder.toString();
        }

    }
}

