I have an undirected graph consisting of n nodes, numbered 1 through n. Each node has at most two incident edges. For each pair of nodes, there is at most an edge connecting them. No edge connects a node to itself.I would like to create a new graph in such a way that:   The new graph consists of the same number of nodes and edges as the old graph.  The properties in the first paragraph still hold.  For each two nodes u and v, if there is an edge connecting them in the old graph, there is no edge connecting them in the new graph. Help me construct the new graph, or tell me if it is impossible.

The first line consists of two space-separated integers: n and m (1 ≤ m ≤ n ≤ 105), denoting the number of nodes and edges, respectively. Then m lines follow. Each of the m lines consists of two space-separated integers u and v (1 ≤ u, v ≤ n; u ≠ v), denoting an edge between nodes u and v.

If it is not possible to construct a new graph with the mentioned properties, output a single line consisting of -1. Otherwise, output exactly m lines. Each line should contain a description of edge in the same way as used in the input format.

NoteThe old graph of the first example:A possible new graph for the first example:In the second example, we cannot create any new graph.The old graph of the third example:A possible new graph for the third example:

import java.util.*;
import java.io.*;

public class Main{

    BufferedReader in;
    StringTokenizer str = null;
    PrintWriter out;

    private String next() throws Exception{
    	if (str == null || !str.hasMoreElements())
    	    str = new StringTokenizer(in.readLine());
    	return str.nextToken();
    }

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

    HashSet<Integer> []g;

    public void run() throws Exception{
    	in = new BufferedReader(new InputStreamReader(System.in));
    	out = new PrintWriter(System.out);

        int n = nextInt(), m = nextInt();
        g = new HashSet[n];
        for(int i=0;i<n;i++){
            g[i] = new HashSet<Integer>();
        }

        for(int i=0;i<m;i++){
            int x = nextInt()-1, y = nextInt()-1;
            g[x].add(y);
            g[y].add(x);
        }

        int v[] = new int[n];
        for(int i=1;i<n;i++)
            v[i] = i;

        for(int iteration=0;iteration<100;iteration++){
            shuffle(v);
            int edges = 0;
            for(int i=0;i<n;i++){
                int a = v[i];
                int b = v[(i+1)%n];
                if (!g[a].contains(b))
                    edges++;
            }

            if (edges < m) continue;
            edges = 0;
            for(int i=0;i<n && edges < m;i++){
                int a = v[i];
                int b = v[(i+1)%n];
                if (!g[a].contains(b)){
                    edges++;
                    out.println((a+1) + " " + (b+1));
                }
            }
            out.close();
            return;
        }
        out.println(-1);
        out.close();
    }

    private void shuffle(int a[]) {
        int n = a.length;
        Random rnd = new Random();
        for(int i=0;i<n;i++){
            int x = rnd.nextInt(n);
            int c = a[i];
            a[i] = a[x];
            a[x] = c;
        }
    }

    public static void main(String args[]) throws Exception{
	   new Main().run();
    }
}

import java.util.*;
import java.io.*;
public class a {
    static long mod = 1000000007;
public static void main(String[] args) throws IOException
{
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));

  input.init(System.in);
  PrintWriter out  = new PrintWriter((System.out));

  int n = input.nextInt(), m = input.nextInt();
  ArrayList<Integer>[] g = new ArrayList[n];
  for(int i = 0; i<n; i++) g[i] = new ArrayList<Integer>();
  for(int i = 0; i<m; i++)
  {
      int a = input.nextInt()-1, b = input.nextInt()-1;
      g[a].add(b);
      g[b].add(a);
  }
  int[] data = new int[n];
  for(int i = 0; i<n; i++) data[i] = i;
  Random r = new Random();
  boolean found = false;
  for(int i = 0; i<10000000/n; i++)
  {
      for(int j = 0; j<n; j++)
      {
          int a = r.nextInt(n), b = r.nextInt(n);
          int temp = data[a];
          data[a] = data[b];
          data[b] = temp;
      }
      int count = 0;
      boolean[] valid = new boolean[n];
      for(int j =0; j<n; j++)
      {
          int to = data[j], from = data[((j+1)%n)];
          if(!g[to].contains(from))
          {
              valid[j] = true;
              count++;
          }
      }
      if(count < m) continue;
      found = true;
      int x = 0;
      for(int j = 0; j<n; j++)
      {
          if(valid[j]&& x<m) {x++;out.println((data[j]+1)+" "+(data[(j+1)%n]+1));}
      }

      break;
  }
  if(!found) out.println(-1);
  out.close();
}
public static long[] gcd(long p, long q)
{
    if(q==0)
        return new long[] {p, 1, 0};
    long[] vals = gcd(q, p%q);
    return new long[] {vals[0], vals[2], vals[1] - (p/q)*vals[2]};
}
static long pow (long a, long p)
{
    if(p==0) return 1;
    if((p&1) == 0)
    {
        long sqrt = pow(a, p/2);
        return (sqrt*sqrt)%mod;
    }
    return (a*pow(a,p-1))%mod;
}
static class input {
  static BufferedReader reader;
  static StringTokenizer tokenizer;

  /** call this method to initialize reader for InputStream */
  static void init(InputStream input) {
      reader = new BufferedReader(
                   new InputStreamReader(input) );
      tokenizer = new StringTokenizer("");
  }

  /** get next word */
  static String next() throws IOException {
      while ( ! tokenizer.hasMoreTokens() ) {
          //TODO add check for eof if necessary
          tokenizer = new StringTokenizer(
                 reader.readLine() );
      }
      return tokenizer.nextToken();
  }

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

  static double nextDouble() throws IOException {
      return Double.parseDouble( next() );
  }
  static long nextLong() throws IOException {
      return Long.parseLong( next() );
  }
  static String nextLine() throws IOException {
    return reader.readLine();
  }
}
public static int oo = 987654321;
public static ArrayList<Integer>[] g;
public static int a, b, x;
public static int [] match, dist;
public static boolean bfs()
{
    Queue<Integer> q = new LinkedList<Integer>();
    for(int i=0; i<a; i++)
    {
        if(match[i]==-1)
        {
            dist[i] = 0;
            q.add(i);
        }
        else dist[i] = oo;
    }
    boolean found = false;
    while(!q.isEmpty())
    {
        int u = q.poll();
        if(u!=-1)
        {
            int len = g[u].size();
            for(int i=0; i<len; i++)
            {
                int v = g[u].get(i);
                if(match[v] == -1)
                {
                    found = true;
                    x = dist[u] + 1;
                }
                else if(dist[match[v]]==oo)
                {
                    dist[match[v]] = dist[u] + 1;
                    q.add(match[v]);
                }
            }
        }
    }
    return found;
}

public static boolean dfs(int u)
{
    if(u==-1)
        return true;
    for(int i=0; i<g[u].size(); i++)
    {
        int v = g[u].get(i);
        int d = match[v] > -1 ? dist[match[v]] : x;
        if(d==dist[u]+1 && dfs(match[v]))
        {
            match[v] = u;
            match[u] = v;
            return true;
        }
    }
    dist[u] = oo;
    return false;
}
public static int hopcroft_karp(int n, int m)
{
    a = n; b = m;
    int res = 0;
    match = new int[a+b];
    dist = new int[a+b];
    Arrays.fill(match, -1);
    while(bfs())
        for(int i=0; i<a; i++)
            if(match[i]==-1 && dfs(i))
                res++;
    return res;
}
}

import java.io.*;
import java.util.*;

public class E
{
	public static void main(String [] args) throws IOException
	{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

		StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
		int nodes = Integer.parseInt(tokenizer.nextToken());
		int edges = Integer.parseInt(tokenizer.nextToken());

		int [][] graph = new int[nodes+1][2];
		int [] pointer = new int[nodes+1];
		for(int i = 0 ; i < edges ; i++)
		{
			tokenizer = new StringTokenizer(reader.readLine());
			int u = Integer.parseInt(tokenizer.nextToken());
			int v = Integer.parseInt(tokenizer.nextToken());

			graph[u][pointer[u]++] = v;
			graph[v][pointer[v]++] = u;
		}

		int [] res = new int[nodes];
		for(int i = 0 ; i < nodes ; i++)
			res[i] = i+1;

		outer : for(int time = 0 ; time < 100 ; time++)
		{
			shuffle(res);
			for(int i = 0 ; i < edges ; i++)
				if(edge(res[i], res[(i+1)%nodes], graph, pointer))
					continue outer;

			for(int i = 0 ; i < edges ; i++)
				writer.println(res[i]+" "+res[(i+1)%nodes]);

			writer.flush();
			writer.close();
			return;
		}
		writer.println(-1);

		writer.flush();
		writer.close();
	}

	private static boolean edge(int a, int b, int [][] graph, int[] pointer)
	{
		for(int i = 0 ; i < pointer[a] ; i++)
			if(b == graph[a][i])
				return true;

		return false;
	}

	private static void shuffle(int[] array)
	{
		for(int i = 0 ; i < array.length/2 ; i++)
		{
			int u = (int) (Math.random()*array.length);
			int v = (int) (Math.random()*array.length);

			swap(array, u, v);
		}
	}

	private static void swap(int[] array, int u, int v)
	{
		int t = array[u];
		array[u] = array[v];
		array[v] = t;
	}
}

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.TreeSet;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskE {
  static final long mult = (long) 1e6;

  public void solve(int testNumber, FastScanner in, PrintWriter out) {
    int n = in.nextInt();
    int m = in.nextInt();

    TreeSet<Long> hs = new TreeSet<Long>();
    for (int i = 0; i < m; i++) {
      int a = in.nextInt() - 1;
      int b = in.nextInt() - 1;
      hs.add(key(a, b));
    }

    if (n <= 6) {
      int e = n * (n - 1) / 2;

      boolean works = false;
      int[] a = new int[m];
      int[] b = new int[m];
      for (int i = 0; i < (1 << e) && !works; i++) {
        if (Integer.bitCount(i) != m) continue;
        int[] deg = new int[n];
        int bit = 0;
        int ii = 0;
        boolean badFlag = false;
        for (int j = 0; j < n; j++) {
          for (int k = j + 1; k < n; k++) {
            if ((i & (1 << bit)) != 0) {
              deg[j]++;
              deg[k]++;
              a[ii] = j;
              b[ii] = k;

              ii++;
              if (deg[j] > 2 || deg[k] > 2 || hs.contains(key(j, k)))
                badFlag = true;
            }
            bit++;
          }
        }

        if (!badFlag) {
          works = true;
        }
      }

      if (!works) {
        out.printf("-1\n");
      } else {
        for (int i = 0; i < m; i++) {
          out.printf("%d %d\n", a[i] + 1, b[i] + 1);
        }
      }
    } else {
      Random r = new Random();
      int runs = (int) (5e7 / n);
      for (int i = 0; i < runs; i++) {
        int[] p = new int[n];
        for (int j = 0; j < n; j++)
          p[j] = j;
        for (int j = 0; j < n - 1; j++) {
          int offSet = r.nextInt(n - j - 1) + 1;
          int k = j + offSet;
          int t = p[k];
          p[k] = p[j];
          p[j] = t;
        }
        int cnt = 0;
        for (int j = 0; j < n; j++) {
          if (!hs.contains(key(j, p[j])))
            cnt++;
        }

        if (cnt < m) continue;

        cnt = 0;
        for (int j = 0; j < n; j++) {
          if (!hs.contains(key(j, p[j]))) {
            cnt++;
            out.printf("%d %d\n", j + 1, p[j] + 1);
            if (cnt == m) return;
          }
        }
      }

      out.printf("-1\n");
    }
  }

  static long key(int a, int b) {
    if (a <= b) return a * mult + b;
    return key(b, a);
  }

}

class FastScanner {
  BufferedReader br;
  StringTokenizer st;

  public FastScanner(InputStream in) {
    br = new BufferedReader(new InputStreamReader(in));
    st = new StringTokenizer("");
  }

  public String next() {
    try {
      if (st.hasMoreTokens()) return st.nextToken();
      st = new StringTokenizer(br.readLine());
      return next();
    } catch (Exception e) {
      return "";
    }
  }

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

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.StringTokenizer;

public class CodeE
{
	static class Scanner
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String nextLine()
		{
			try
			{
				return br.readLine();
			}
			catch(Exception e)
			{
				throw(new RuntimeException());
			}
		}

		public String next()
		{
			while(!st.hasMoreTokens())
			{
				String l = nextLine();
				if(l == null)
					return null;
				st = new StringTokenizer(l);
			}
			return st.nextToken();
		}

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

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

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

		public int[] nextIntArray(int n)
		{
			int[] res = new int[n];
			for(int i = 0; i < res.length; i++)
				res[i] = nextInt();
			return res;
		}

		public long[] nextLongArray(int n)
		{
			long[] res = new long[n];
			for(int i = 0; i < res.length; i++)
				res[i] = nextLong();
			return res;
		}

		public double[] nextDoubleArray(int n)
		{
			double[] res = new double[n];
			for(int i = 0; i < res.length; i++)
				res[i] = nextDouble();
			return res;
		}
		public void sortIntArray(int[] array)
		{
			Integer[] vals = new Integer[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public void sortLongArray(long[] array)
		{
			Long[] vals = new Long[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public void sortDoubleArray(double[] array)
		{
			Double[] vals = new Double[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public String[] nextStringArray(int n)
		{
			String[] vals = new String[n];
			for(int i = 0; i < n; i++)
				vals[i] = next();
			return vals;
		}

		Integer nextInteger()
		{
			String s = next();
			if(s == null)
				return null;
			return Integer.parseInt(s);
		}

		int[][] nextIntMatrix(int n, int m)
		{
			int[][] ans = new int[n][];
			for(int i = 0; i < n; i++)
				ans[i] = nextIntArray(m);
			return ans;
		}
	}

	public static void main(String[] args)
	{
		Scanner sc = new Scanner();
		int n = sc.nextInt();
		int m = sc.nextInt();
		if(n <= 7)
		{
			boolean[][] grafo = new boolean[n][n];
			for(int i = 0; i < m; i++)
			{
				int a = sc.nextInt() - 1;
				int b = sc.nextInt() - 1;
				if(a < b) grafo[a][b] = true;
				else grafo[b][a] = true;
			}
			int cuenta = (n * (n - 1)) / 2;
			int limite = 1 << cuenta;
			int[] adjacentes = new int[n];
			outer:
			for(int a = 0; a < limite; a++)
			{
				if(Integer.bitCount(a) != m) continue;
				Arrays.fill(adjacentes, 0);
				int actual = 1;
				for(int i = 0; i < n; i++)
					for(int j = i + 1; j < n; j++)
					{
						if((a & actual) != 0)
						{
							if(grafo[i][j]) continue outer;
							adjacentes[i]++;
							if(adjacentes[i] > 2)
								continue outer;
							adjacentes[j]++;
							if(adjacentes[j] > 2)
								continue outer;
						}
						actual <<= 1;
					}
				actual = 1;
				for(int i = 0; i < n; i++)
					for(int j = i + 1; j < n; j++)
					{
						if((a & actual) != 0)
							System.out.println((i + 1) + " " + (j + 1));
						actual <<= 1;
					}
				return;
			}
			System.out.println(-1);
		}
		else
		{
			HashSet <String> entrada = new HashSet <String> ();
			for(int i = 0; i < m; i++)
			{
				int a = sc.nextInt();
				int b = sc.nextInt();
				if(a < b) entrada.add(a + " " + b);
				else entrada.add(b + " " + a);
			}
			ArrayList <Integer> orden = new ArrayList <Integer> ();
			for(int i = 0; i < n; i++) orden.add(i + 1);
			int[] adjacentes = new int[n];
			outer:
			while(true)
			{
				Arrays.fill(adjacentes, 0);
				Collections.shuffle(orden);
				for(int i = 0; i < m; i++)
				{
					int a = orden.get(i);
					int b = orden.get((i + 1) % n);
					adjacentes[a - 1]++;
					if(adjacentes[a - 1] > 2)
						continue outer;
					adjacentes[b - 1]++;
					if(adjacentes[b - 1] > 2)
						continue outer;
					if(a > b)
					{
						if(entrada.contains(b + " " + a))
							continue outer;
					}
					else
					{
						if(entrada.contains(a + " " + b))
							continue outer;
					}
				}
				for(int i = 0; i < m; i++)
				{
					int a = orden.get(i);
					int b = orden.get((i + 1) % n);
					System.out.println(a + " " + b);
				}
				return;
			}
		}
	}

}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.StringTokenizer;

public class CodeE
{
	static class Scanner
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		public String nextLine()
		{
			try
			{
				return br.readLine();
			}
			catch(Exception e)
			{
				throw(new RuntimeException());
			}
		}

		public String next()
		{
			while(!st.hasMoreTokens())
			{
				String l = nextLine();
				if(l == null)
					return null;
				st = new StringTokenizer(l);
			}
			return st.nextToken();
		}

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

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

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

		public int[] nextIntArray(int n)
		{
			int[] res = new int[n];
			for(int i = 0; i < res.length; i++)
				res[i] = nextInt();
			return res;
		}

		public long[] nextLongArray(int n)
		{
			long[] res = new long[n];
			for(int i = 0; i < res.length; i++)
				res[i] = nextLong();
			return res;
		}

		public double[] nextDoubleArray(int n)
		{
			double[] res = new double[n];
			for(int i = 0; i < res.length; i++)
				res[i] = nextDouble();
			return res;
		}
		public void sortIntArray(int[] array)
		{
			Integer[] vals = new Integer[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public void sortLongArray(long[] array)
		{
			Long[] vals = new Long[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public void sortDoubleArray(double[] array)
		{
			Double[] vals = new Double[array.length];
			for(int i = 0; i < array.length; i++)
				vals[i] = array[i];
			Arrays.sort(vals);
			for(int i = 0; i < array.length; i++)
				array[i] = vals[i];
		}

		public String[] nextStringArray(int n)
		{
			String[] vals = new String[n];
			for(int i = 0; i < n; i++)
				vals[i] = next();
			return vals;
		}

		Integer nextInteger()
		{
			String s = next();
			if(s == null)
				return null;
			return Integer.parseInt(s);
		}

		int[][] nextIntMatrix(int n, int m)
		{
			int[][] ans = new int[n][];
			for(int i = 0; i < n; i++)
				ans[i] = nextIntArray(m);
			return ans;
		}
	}

	public static void main(String[] args)
	{
		Scanner sc = new Scanner();
		int n = sc.nextInt();
		int m = sc.nextInt();
		if(n <= 7)
		{
			boolean[][] grafo = new boolean[n][n];
			for(int i = 0; i < m; i++)
			{
				int a = sc.nextInt() - 1;
				int b = sc.nextInt() - 1;
				if(a < b) grafo[a][b] = true;
				else grafo[b][a] = true;
			}
			int cuenta = (n * (n - 1)) / 2;
			int limite = 1 << cuenta;
			int[] adjacentes = new int[n];
			outer:
			for(int a = 0; a < limite; a++)
			{
				if(Integer.bitCount(a) != m) continue;
				Arrays.fill(adjacentes, 0);
				int actual = 1;
				for(int i = 0; i < n; i++)
					for(int j = i + 1; j < n; j++)
					{
						if((a & actual) != 0)
						{
							if(grafo[i][j]) continue outer;
							adjacentes[i]++;
							if(adjacentes[i] > 2)
								continue outer;
							adjacentes[j]++;
							if(adjacentes[j] > 2)
								continue outer;
						}
						actual <<= 1;
					}
				actual = 1;
				for(int i = 0; i < n; i++)
					for(int j = i + 1; j < n; j++)
					{
						if((a & actual) != 0)
							System.out.println((i + 1) + " " + (j + 1));
						actual <<= 1;
					}
				return;
			}
			System.out.println(-1);
		}
		else
		{
			HashSet <String> entrada = new HashSet <String> ();
			for(int i = 0; i < m; i++)
			{
				int a = sc.nextInt();
				int b = sc.nextInt();
				if(a < b) entrada.add(a + " " + b);
				else entrada.add(b + " " + a);
			}
			ArrayList <Integer> orden = new ArrayList <Integer> ();
			for(int i = 0; i < n; i++) orden.add(i + 1);
			outer:
			while(true)
			{
				Collections.shuffle(orden);
				for(int i = 0; i < m; i++)
				{
					int a = orden.get(i);
					int b = orden.get((i + 1) % n);
					if(a > b)
					{
						if(entrada.contains(b + " " + a))
							continue outer;
					}
					else
					{
						if(entrada.contains(a + " " + b))
							continue outer;
					}
				}
				for(int i = 0; i < m; i++)
				{
					int a = orden.get(i);
					int b = orden.get((i + 1) % n);
					System.out.println(a + " " + b);
				}
				return;
			}
		}
	}

}

import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskE {

    private int[][] graph;
    private int[] answer;
    private int vertices, edges;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        vertices = in.nextInt();
        edges = in.nextInt();
        graph = new int[vertices + 1][2];
        for (int i = 0; i < edges; i++) {
            int v = in.nextInt();
            int u = in.nextInt();
            if (graph[v][0] == 0) graph[v][0] = u;
            else graph[v][1] = u;
            if (graph[u][0] == 0) graph[u][0] = v;
            else graph[u][1] = v;
        }
        answer = new int[vertices];
        if (vertices < 7)
            if (exist())
                print(out, 1);
            else
                out.println(-1);
        else {
            boolean[] used = new boolean[vertices + 1];
            int next = 0;
            int size = 0;
            for (int i = 1; i <= vertices; i++) {
                if (used[i])
                    continue;
                used[i] = true;
                answer[size++] = i;
                while (next < size) {
                    for (int k = 0; k < 2; k++)
                        if (graph[answer[next]][k] != 0 && !used[graph[answer[next]][k]]) {
                            used[graph[answer[next]][k]] = true;
                            answer[size++] = graph[answer[next]][k];
                        }
                    next++;
                }
            }
            print(out, 3);
        }
    }

    private boolean exist() {
        for (int i = 0; i < vertices; i++)
            answer[i] = i + 1;
        while (!isValid())
            if (!getNext())
                return false;
        return true;
    }

    private boolean getNext() {
        int next = -1;
        for (int i = answer.length - 1; i > 0; i--)
            if (answer[i] > answer[i - 1]) {
                next = i - 1;
                break;
            }
        if (next == -1)
            return false;
        int minIndex = next + 1;
        for (int i = minIndex + 1; i < answer.length; i++)
            if (answer[i] > answer[next] && answer[minIndex] > answer[i])
                minIndex = i;
        int temp = answer[minIndex];
        answer[minIndex] = answer[next];
        answer[next] = temp;
        Arrays.sort(answer, next + 1, answer.length);
        return true;
    }

    private boolean isValid() {
        for (int i = 0; i < edges; i++) {
            int j = (i + 1) % vertices;
            if (graph[answer[i]][0] == answer[j] || graph[answer[i]][1] == answer[j])
                return false;
        }
        return true;
    }

    private void print(PrintWriter out, int k) {
        for (int i = 0; i < edges; ++i) {
            out.print(answer[i]);
            out.print(" ");
            out.println(answer[(i + k) % vertices]);
        }
    }

}

class InputReader {

    private static BufferedReader bufferedReader;
    private static StringTokenizer stringTokenizer;

    public InputReader(InputStream inputStream) {
        bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        stringTokenizer = null;
    }

    public String next() {
        while(stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
            try {
                stringTokenizer = new StringTokenizer(bufferedReader.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return stringTokenizer.nextToken();
    }

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

    }

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class problemE {

	static void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		long[] edges = new long[m];
		for (int i = 0; i < m; i++) {
			int a = nextInt() - 1;
			int b = nextInt() - 1;
			if (a > b) {
				int t = a;
				a = b;
				b = t;
			}
			edges[i] = (long) a * n + b;
		}
		Arrays.sort(edges);
		int[] pos = new int[n];
		for (int i = 0; i < n; i++) {
			pos[i] = i;
		}
		int IT = 10000000 / n;
		for (int it = 0; it < IT; it++) {
			shuffle(pos);
			int cnt = 0;
			for (int z = 0; z < n; z++) {
				int i = pos[z];
				int j = pos[(z + 1) % n];
				if (i > j) {
					int t = i;
					i = j;
					j = t;
				}
				long id = (long) i * n + j;
				if (Arrays.binarySearch(edges, id) < 0) {
					++cnt;
				}
			}
			if (cnt >= m) {
				cnt = 0;
				for (int z = 0; cnt < m && z < n; z++) {
					int i = pos[z];
					int j = pos[(z + 1) % n];
					if (i > j) {
						int t = i;
						i = j;
						j = t;
					}
					long id = (long) i * n + j;
					if (Arrays.binarySearch(edges, id) < 0) {
						++cnt;
						out.println((i + 1) + " " + (j + 1));
					}
				}
				return ;
			}
		}
		out.println("-1");
	}

	static final Random rnd = new Random();

	static void shuffle(int[] a) {
		for (int i = 0; i < a.length; i++) {
			int j = rnd.nextInt(i + 1);
			int t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
	}

	static BufferedReader br;
	static PrintWriter out;
	static StringTokenizer st;

	static boolean hasNextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return false;
			}
			st = new StringTokenizer(line);
		}
		return true;
	}

	static String nextToken() throws IOException {
		return hasNextToken() ? st.nextToken() : null;
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
		solve();
		br.close();
		out.close();
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class problemE {

	static void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		long[] edges = new long[m];
		for (int i = 0; i < m; i++) {
			int a = nextInt() - 1;
			int b = nextInt() - 1;
			if (a > b) {
				int t = a;
				a = b;
				b = t;
			}
			edges[i] = (long) a * n + b;
		}
		Arrays.sort(edges);
		int[] pos = new int[n];
		for (int i = 0; i < n; i++) {
			pos[i] = i;
		}
		int IT = 3000000 / n;
		for (int it = 0; it < IT; it++) {
			shuffle(pos);
			int cnt = 0;
			for (int z = 0; z < n; z++) {
				int i = pos[z];
				int j = pos[(z + 1) % n];
				if (i > j) {
					int t = i;
					i = j;
					j = t;
				}
				long id = (long) i * n + j;
				if (Arrays.binarySearch(edges, id) < 0) {
					++cnt;
				}
			}
			if (cnt >= m) {
				cnt = 0;
				for (int z = 0; cnt < m && z < n; z++) {
					int i = pos[z];
					int j = pos[(z + 1) % n];
					if (i > j) {
						int t = i;
						i = j;
						j = t;
					}
					long id = (long) i * n + j;
					if (Arrays.binarySearch(edges, id) < 0) {
						++cnt;
						out.println((i + 1) + " " + (j + 1));
					}
				}
				return ;
			}
		}
		out.println("-1");
	}

	static final Random rnd = new Random();

	static void shuffle(int[] a) {
		for (int i = 0; i < a.length; i++) {
			int j = rnd.nextInt(i + 1);
			int t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
	}

	static BufferedReader br;
	static PrintWriter out;
	static StringTokenizer st;

	static boolean hasNextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return false;
			}
			st = new StringTokenizer(line);
		}
		return true;
	}

	static String nextToken() throws IOException {
		return hasNextToken() ? st.nextToken() : null;
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
		solve();
		br.close();
		out.close();
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class problemE {

	static void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		long[] edges = new long[m];
		for (int i = 0; i < m; i++) {
			int a = nextInt() - 1;
			int b = nextInt() - 1;
			if (a > b) {
				int t = a;
				a = b;
				b = t;
			}
			edges[i] = (long) a * n + b;
		}
		Arrays.sort(edges);
		int[] pos = new int[n];
		for (int i = 0; i < n; i++) {
			pos[i] = i;
		}
		int IT = 2000000 / n;
		for (int it = 0; it < IT; it++) {
			shuffle(pos);
			int cnt = 0;
			for (int z = 0; z < n; z++) {
				int i = pos[z];
				int j = pos[(z + 1) % n];
				if (i > j) {
					int t = i;
					i = j;
					j = t;
				}
				long id = (long) i * n + j;
				if (Arrays.binarySearch(edges, id) < 0) {
					++cnt;
				}
			}
			if (cnt >= m) {
				cnt = 0;
				for (int z = 0; cnt < m && z < n; z++) {
					int i = pos[z];
					int j = pos[(z + 1) % n];
					if (i > j) {
						int t = i;
						i = j;
						j = t;
					}
					long id = (long) i * n + j;
					if (Arrays.binarySearch(edges, id) < 0) {
						++cnt;
						out.println((i + 1) + " " + (j + 1));
					}
				}
				return ;
			}
		}
		out.println("-1");
	}

	static final Random rnd = new Random();

	static void shuffle(int[] a) {
		for (int i = 0; i < a.length; i++) {
			int j = rnd.nextInt(i + 1);
			int t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
	}

	static BufferedReader br;
	static PrintWriter out;
	static StringTokenizer st;

	static boolean hasNextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return false;
			}
			st = new StringTokenizer(line);
		}
		return true;
	}

	static String nextToken() throws IOException {
		return hasNextToken() ? st.nextToken() : null;
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
		solve();
		br.close();
		out.close();
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class problemE {

	static void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		long[] edges = new long[m];
		for (int i = 0; i < m; i++) {
			int a = nextInt() - 1;
			int b = nextInt() - 1;
			if (a > b) {
				int t = a;
				a = b;
				b = t;
			}
			edges[i] = (long) a * n + b;
		}
		Arrays.sort(edges);
		int[] pos = new int[n];
		for (int i = 0; i < n; i++) {
			pos[i] = i;
		}
		int IT = 3000000 / n;
		for (int it = 0; it < IT; it++) {
			shuffle(pos);
			int cnt = 0;
			for (int z = 0; z < n; z++) {
				int i = pos[z];
				int j = pos[(z + 1) % n];
				if (i > j) {
					int t = i;
					i = j;
					j = t;
				}
				long id = (long) i * n + j;
				if (!find(edges, id)) {
					++cnt;
				}
			}
			if (cnt >= m) {
				cnt = 0;
				for (int z = 0; cnt < m && z < n; z++) {
					int i = pos[z];
					int j = pos[(z + 1) % n];
					if (i > j) {
						int t = i;
						i = j;
						j = t;
					}
					long id = (long) i * n + j;
					if (!find(edges, id)) {
						++cnt;
						out.println((i + 1) + " " + (j + 1));
					}
				}
				return ;
			}
		}
		out.println("-1");
	}

	static final Random rnd = new Random();

	static void shuffle(int[] a) {
		for (int i = 0; i < a.length; i++) {
			int j = rnd.nextInt(i + 1);
			int t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
	}

	static boolean find(long[] a, long key) {
		int low = 0;
		int high = a.length - 1;
		while (low <= high) {
			int mid = low + high >> 1;
			if (a[mid] <= key) low = mid + 1;
			else high = mid - 1;
		}
		return low > 0 && a[low - 1] == key;
	}

	static BufferedReader br;
	static PrintWriter out;
	static StringTokenizer st;

	static boolean hasNextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return false;
			}
			st = new StringTokenizer(line);
		}
		return true;
	}

	static String nextToken() throws IOException {
		return hasNextToken() ? st.nextToken() : null;
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
		solve();
		br.close();
		out.close();
	}
}

import static java.util.Arrays.binarySearch;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class problemE {

	static void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		long[] edges = new long[m];
		for (int i = 0; i < m; i++) {
			int a = nextInt() - 1;
			int b = nextInt() - 1;
			if (a > b) {
				int t = a;
				a = b;
				b = t;
			}
			edges[i] = (long) a * n + b;
		}
		Arrays.sort(edges);
		int[] pos = new int[n];
		for (int i = 0; i < n; i++) {
			pos[i] = i;
		}
		int IT = 3000000 / n;
		for (int it = 0; it < IT; it++) {
			shuffle(pos);
			int cnt = 0;
			for (int z = 0; z < n; z++) {
				int i = pos[z];
				int j = pos[(z + 1) % n];
				if (i > j) {
					int t = i;
					i = j;
					j = t;
				}
				long id = (long) i * n + j;
				if (binarySearch(edges, id) < 0) {
					++cnt;
				}
			}
			if (cnt >= m) {
				cnt = 0;
				for (int z = 0; cnt < m && z < n; z++) {
					int i = pos[z];
					int j = pos[(z + 1) % n];
					if (i > j) {
						int t = i;
						i = j;
						j = t;
					}
					long id = (long) i * n + j;
					if (binarySearch(edges, id) < 0) {
						++cnt;
						out.println((i + 1) + " " + (j + 1));
					}
				}
				return ;
			}
		}
		out.println("-1");
	}

	static final Random rnd = new Random();

	static void shuffle(int[] a) {
		for (int i = 0; i < a.length; i++) {
			int j = rnd.nextInt(i + 1);
			int t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
	}

	static BufferedReader br;
	static PrintWriter out;
	static StringTokenizer st;

	static boolean hasNextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return false;
			}
			st = new StringTokenizer(line);
		}
		return true;
	}

	static String nextToken() throws IOException {
		return hasNextToken() ? st.nextToken() : null;
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
		solve();
		br.close();
		out.close();
	}
}

import javax.swing.*;
import java.io.*;
import java.util.*;

public class CodeForces {
    static boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    Random rand = new Random();

    void RandomShuffle(int[] nodes, int n) {
        for (int i = n - 1; i > 0; --i) {
            int j = rand.nextInt(i + 1);
            int t = nodes[i];
            nodes[i] = nodes[j];
            nodes[j] = t;
        }
    }

    void runCase(int caseNum) throws IOException {
        int n = nextInt();
        int m = nextInt();
        int[][] edges = new int[n + 1][2];
        for (int i = 0; i < m; ++i) {
            int a = nextInt();
            int b = nextInt();
            if (edges[a][0] > 0)
                edges[a][1] = b;
            else
                edges[a][0] = b;
            if (edges[b][0] > 0)
                edges[b][1] = a;
            else
                edges[b][0] = a;
        }
        int[] nodes = new int[n + 1];
        for (int i = 0; i < n; ++i)
            nodes[i] = i + 1;
        for (int tt = 0; tt < 100; ++tt) {
            RandomShuffle(nodes, n);
            nodes[n] = nodes[0];
            int cnt = 0;
            for (int i = 0; i < n; ++i) {
                if (edges[nodes[i]][0] != nodes[i + 1] && edges[nodes[i]][1] != nodes[i + 1])
                    ++cnt;
            }
            if (cnt >= m) {
                for (int i = 0; i < n; ++i) {
                    if (edges[nodes[i]][0] != nodes[i + 1] && edges[nodes[i]][1] != nodes[i + 1]) {
                        System.out.println(nodes[i] + " " + nodes[i + 1]);
                        --m;
                        //System.out.println("m: " + m);
                        if (m == 0)
                            break;
                    }
                }
                return;
            }
        }
        System.out.println("-1");
    }

    public static void main(String[] args) throws IOException {
        if (ONLINE_JUDGE){
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }else{
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
        new CodeForces().runIt();
        out.flush();
        out.close();
        return;
    }

    static BufferedReader in;
    private StringTokenizer st;
    static PrintWriter out;

    String next() throws IOException {
        while (!st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line, " ");
        }
        return st.nextToken();
    }

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

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

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

    void runIt() throws IOException {
        st = new StringTokenizer("");

//        int N = nextInt();
//        for (int i = 0; i < N; i++) {
//            runCase(i + 1);
//        }
        runCase(0);

        out.flush();
    }

}

import java.io.*;
import java.math.BigInteger;
import java.util.*;

import static java.util.Arrays.*;

public class C {
    private static final int mod = (int)1e9+7;

    IOFast io = new IOFast();

    int V, E;
    int[][] es;
    SimpleGraph ori;
    SimpleGraph g;

    void swap(int[] d, int i, int j) {
        final int v = d[i];
        d[i] = d[j];
        d[j] = v;
    }

    boolean dfs(boolean[][] con, int[] deg, int rest, int idx) {
        if(rest == 0) {
            return true;
        }

        if(idx >= V) return false;
        for(int i = 0; i < idx; i++) {
            if(deg[i] < 2 && deg[idx] < 2 && !con[i][idx]) {
                con[i][idx] = con[idx][i] = true;
                deg[i]++;
                deg[idx]++;
                if(dfs(con, deg, rest - 1, idx)) {
                    io.out.println((i+1) + " " + (idx+1));
                    return true;
                }
                con[i][idx] = con[idx][i] = false;
                deg[i]--;
                deg[idx]--;
            }
        }

        return dfs(con, deg, rest, idx + 1);
    }

    public void run() throws IOException {
        V = io.nextInt();
        E = io.nextInt();
//      V = 100000;
//      E = 100000;
        es = new int[E][2];
        ori = new SimpleGraph(V);
        g = new SimpleGraph(V);
        for(int i = 0; i < E; i++) {
            for(int j = 0; j < es[i].length; j++) {
                es[i][j] = io.nextInt() - 1;
//              es[i][j] = (i + j) % V;
            }
        }

        if(V <= 4) {
            int[] deg = new int[V];
            boolean[][] con = new boolean[V][V];
            for(int i = 0; i < E; i++) {
                con[es[i][0]][es[i][1]] = true;
                con[es[i][1]][es[i][0]] = true;
            }
            if(!dfs(con, deg, E, 0)) {
                io.out.println(-1);
            }
            return;
        }

        for(int[] e : es) {
            ori.add(e[0], e[1]);
            ori.add(e[1], e[0]);
        }

        int len = 0;
        int[] set = new int[V];
        for(int i = 0; i < V; i++) {
            set[len++] = i;
        }
        swap(set, 0, --len);

        Random random = new Random(0);
        int rest = E;
        for(int p = 0; rest > 0; rest--) {
            while(true) {
                int ji, j;

                if(len == 0) {
                    ji = random.nextInt(V - len);
                    j = set[ji + len];
                }
                else {
                    ji = random.nextInt(len);
                    j = set[ji];
                }

                if(p == j) continue;

                if(g.deg(j) < 2 && !ori.connected(p, j)) {
                    g.add(p, j);
                    g.add(j, p);
                    if(len != 0) swap(set, ji, --len);
                    p = j;
                    break;
                }

                final int ki = random.nextInt(V - len);
                final int k = set[len + ki];
                if(p != k) {
                    boolean bad = false;
                    for(final int t : g.to[p]) {
                        if(ori.connected(k, t)) {
                            bad = true;
                        }
                    }
                    for(final int t : g.to[k]) {
                        if(ori.connected(p, t)) {
                            bad = true;
                        }
                    }
                    if(!bad) {
                        g.swap(p, k);
                        p = k;
                    }
                }
            }
        }

        for(int i = 0; i < V; i++)
            for(int j : g.to[i])
                if(i < j)
                    io.out.println((i+1) + " " + (j+1));
    }

    static
    public class SimpleGraph {
        int V;

        List<Integer>[] to;

        public SimpleGraph(int V) {
            this.V = V;
            to = new List[V];

            for(int i = 0; i < V; i++) {
                to[i] = new ArrayList<Integer>();
            }
        }

        int deg(int v) { return to[v].size(); }

        void add(int s, int t) {
            to[s].add(t);
        }

        boolean connected(int s, int t) {
            return to[s].contains(t);
        }

        boolean remove(int s, int t) {
            return to[s].remove(Integer.valueOf(t));
        }

        void replace(int v, int s, int t) {
            if(remove(v, s)) {
                add(v, t);
            }
        }

        void swap(int s, int t) {
            for(int v : to[s]) if(v != s) replace(v, s, t);
            for(int v : to[t]) if(v != t) replace(v, t, s);

            final List<Integer> tmp = to[s];
            to[s] = to[t];
            to[t] = tmp;

            replace(t, t, s);
            replace(s, s, t);
        }
    }

    void main() throws IOException {
        //      IOFast.setFileIO("rle-size.in", "rle-size.out");
        try {
            run();
        }
        catch (EndOfFileRuntimeException e) { }
        io.out.flush();
    }

    public static void main(String[] args) throws IOException {
        new C().main();
    }

    static class EndOfFileRuntimeException extends RuntimeException {
        private static final long serialVersionUID = -8565341110209207657L; }

    static
    public class IOFast {
        private BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        private PrintWriter out = new PrintWriter(System.out);

        void setFileIO(String ins, String outs) throws IOException {
            in = new BufferedReader(new FileReader(ins));
            out = new PrintWriter(new FileWriter(outs));
        }

        //      private static final int BUFFER_SIZE = 50 * 200000;
        private static int pos, readLen;
        private static final char[] buffer = new char[1024 * 8];
        private static final char[] str = new char[500000*8*2];
        private static boolean[] isDigit = new boolean[256];
        private static boolean[] isSpace = new boolean[256];
        private static boolean[] isLineSep = new boolean[256];

        static {
            for(int i = 0; i < 10; i++) { isDigit['0' + i] = true; }
            isDigit['-'] = true;
            isSpace[' '] = isSpace['\r'] = isSpace['\n'] = isSpace['\t'] = true;
            isLineSep['\r'] = isLineSep['\n'] = true;
        }

        public int read() throws IOException {
            if(pos >= readLen) {
                pos = 0;
                readLen = in.read(buffer);
                if(readLen <= 0) { throw new EndOfFileRuntimeException(); }
            }
            return buffer[pos++];
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(nextString());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(nextString());
        }

        public char nextChar() throws IOException {
            while(true) {
                final int c = read();
                if(!isSpace[c]) { return (char)c; }
            }
        }

        int reads(char[] cs, int len, boolean[] accept) throws IOException {
            try {
                while(true) {
                    final int c = read();
                    if(accept[c]) { break; }
                    str[len++] = (char)c;
                }
            }
            catch(EndOfFileRuntimeException e) { ; }

            return len;
        }

        public char[] nextLine() throws IOException {
            int len = 0;
            str[len++] = nextChar();
            len = reads(str, len, isLineSep);

            try {
                if(str[len-1] == '\r') { len--; read(); }
            }
            catch(EndOfFileRuntimeException e) { ; }

            return Arrays.copyOf(str, len);
        }

        public String nextString() throws IOException {
            return new String(next());
        }

        public char[] next() throws IOException {
            int len = 0;
            str[len++] = nextChar();
            len = reads(str, len, isSpace);
            return Arrays.copyOf(str, len);
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(nextString());
        }

    }

}

import java.io.*;
import java.math.BigInteger;
import java.util.*;

import static java.util.Arrays.*;

public class C {
    private static final int mod = (int)1e9+7;

    IOFast io = new IOFast();

    int V, E;
    int[][] es;
    int[][] con;
    int[] deg;
    int[][] oriCon;
    int[] oriDeg;

    boolean isOriginal(int i, int j) {
        for(int k = 0; k < oriDeg[i]; k++) {
            if(oriCon[i][k] == j) {
                return true;
            }
        }
        return false;
    }

    boolean connected(int i, int j) {
        if(i == j || isOriginal(i, j)) return true;
        for(int k = 0; k < deg[i]; k++) {
            if(con[i][k] == j) {
                return true;
            }
        }
        return false;
    }

    void remove(int i, int j) {
        int u = 0;
        for(int k = 0; k < deg[i]; k++) {
            if(con[i][k] != j) {
                con[i][u++] = con[i][k];
            }
        }
        con[i][u] = -1;
        deg[i] = u;
    }

    void add(int i, int j) {
        if(!connected(i, j)) {
            con[i][deg[i]++] = j;
            con[j][deg[j]++] = i;
        }
    }

    boolean swap(int p, int k) {
        boolean adj = false;
        for(int a = 0; a < deg[k]; a++) {
            if(p == con[k][a]) adj = true;
            if(isOriginal(p, con[k][a])) {
                return false;
            }
        }
        for(int a = 0; a < deg[p]; a++) {
            if(isOriginal(k, con[p][a])) {
                return false;
            }
        }

        final int[] ck = Arrays.copyOf(con[k], deg[k]);
        final int[] cp = Arrays.copyOf(con[p], deg[p]);
        for(int kk : ck) {
            remove(k, kk);
            remove(kk, k);
        }
        for(int kk : cp) {
            remove(p, kk);
            remove(kk, p);
        }

        for(int kk : ck) { add(p, kk); }
        for(int kk : cp) { add(k, kk); }

        if(adj) {
            add(p, k);
            add(k, p);
        }

        return true;
    }

    boolean dfs(boolean[][] con, int[] deg, int rest, int idx) {
        if(rest == 0) {
            return true;
        }

        if(idx >= V) return false;
        for(int i = 0; i < idx; i++) {
            if(deg[i] < 2 && deg[idx] < 2 && !con[i][idx]) {
                con[i][idx] = con[idx][i] = true;
                deg[i]++;
                deg[idx]++;
                if(dfs(con, deg, rest - 1, idx)) {
                    io.out.println((i+1) + " " + (idx+1));
                    return true;
                }
                con[i][idx] = con[idx][i] = false;
                deg[i]--;
                deg[idx]--;
            }
        }

        return dfs(con, deg, rest, idx + 1);
    }

    public void run() throws IOException {
        V = io.nextInt();
        E = io.nextInt();
//      V = 100000;
//      E = 100000;
        es = new int[E][2];
        for(int i = 0; i < E; i++) {
            for(int j = 0; j < es[i].length; j++) {
                es[i][j] = io.nextInt() - 1;
//              es[i][j] = (i + j) % V;
            }
        }

        oriCon = new int[V][2];
        oriDeg = new int[V];
        con = new int[V][2];
        deg = new int[V];
        if(V <= 4) {
            boolean[][] con = new boolean[V][V];
            for(int i = 0; i < E; i++) {
                con[es[i][0]][es[i][1]] = true;
                con[es[i][1]][es[i][0]] = true;
            }
            if(!dfs(con, deg, E, 0)) {
                io.out.println(-1);
            }
            return;
        }

        int len = V;
        int ulen = 0;
        int[] set = new int[V];
        int[] setu = new int[V];
        for(int i = 0; i < V; i++) {
            set[i] = i;
        }
        for(int[] e : es) {
            oriCon[e[0]][oriDeg[e[0]]++] = e[1];
            oriCon[e[1]][oriDeg[e[1]]++] = e[0];
        }
        Random random = new Random(0);
        int rest = E;
        setu[ulen++] = 0;
        set[0] = set[--len];
        LOOP2: for(int p = 0; rest > 0; rest--) {
            if(rest == 1 && len == 0) {
                int q = -1;
                for(int i = 0; i < V; i++) {
                    if(i != p && deg[i] == 1) {
                        q = i;
                    }
                }

                while(true) {
                    if(!connected(p, q)) {
                        add(p, q);
                        break LOOP2;
                    }

                    if(random.nextBoolean()) {
                        final int t = p;
                        p = q;
                        q = t;
                    }

                    final int ki = random.nextInt(ulen);
                    int k = setu[ki];
                    if(p != k) {
                        if(swap(p, k)) {
                            p = k;
                        }
                    }
                }
            }

            while(true) {
                final int ji = random.nextInt(len);
                int j = set[ji];
                if(deg[j] == 0 && p != j && !connected(p, j)) {
                    add(p, j);
                    set[ji] = set[--len];
                    setu[ulen++] = j;
                    /*
//                  System.err.println(p + " " + j);
                    System.err.println("test2");
                    //*
                    for(int ii = 0; ii < V; ii++)
                        for(int jj = 0; jj < deg[ii]; jj++)
//                          if(i < con[i][j])
                            System.err.println((ii+1) + " " + (con[ii][jj]+1));
                    //*/
                    p = j;
                    break;
                }

                final int ki = random.nextInt(ulen);
                int k = setu[ki];
                if(p != k) {
                    /*
                    System.err.println("test");
                    for(int ii = 0; ii < V; ii++)
                        for(int jj = 0; jj < deg[ii]; jj++)
//                              if(i < con[i][j])
                            System.err.println((ii+1) + " " + (con[ii][jj]+1));
                    //*/
                    if(swap(p, k)) {
//                      System.err.println("swap: " + p + " " + k);
                        p = k;
                    }
                }
            }
        }

        for(int i = 0; i < V; i++)
            for(int j = 0; j < deg[i]; j++)
                if(i < con[i][j])
                    io.out.println((i+1) + " " + (con[i][j]+1));
    }

    void main() throws IOException {
        //      IOFast.setFileIO("rle-size.in", "rle-size.out");
        try {
            run();
        }
        catch (EndOfFileRuntimeException e) { }
        io.out.flush();
    }

    public static void main(String[] args) throws IOException {
        new C().main();
    }

    static class EndOfFileRuntimeException extends RuntimeException {
        private static final long serialVersionUID = -8565341110209207657L; }

    static
    public class IOFast {
        private BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        private PrintWriter out = new PrintWriter(System.out);

        void setFileIO(String ins, String outs) throws IOException {
            in = new BufferedReader(new FileReader(ins));
            out = new PrintWriter(new FileWriter(outs));
        }

        //      private static final int BUFFER_SIZE = 50 * 200000;
        private static int pos, readLen;
        private static final char[] buffer = new char[1024 * 8];
        private static final char[] str = new char[500000*8*2];
        private static boolean[] isDigit = new boolean[256];
        private static boolean[] isSpace = new boolean[256];
        private static boolean[] isLineSep = new boolean[256];

        static {
            for(int i = 0; i < 10; i++) { isDigit['0' + i] = true; }
            isDigit['-'] = true;
            isSpace[' '] = isSpace['\r'] = isSpace['\n'] = isSpace['\t'] = true;
            isLineSep['\r'] = isLineSep['\n'] = true;
        }

        public int read() throws IOException {
            if(pos >= readLen) {
                pos = 0;
                readLen = in.read(buffer);
                if(readLen <= 0) { throw new EndOfFileRuntimeException(); }
            }
            return buffer[pos++];
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(nextString());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(nextString());
        }

        public char nextChar() throws IOException {
            while(true) {
                final int c = read();
                if(!isSpace[c]) { return (char)c; }
            }
        }

        int reads(char[] cs, int len, boolean[] accept) throws IOException {
            try {
                while(true) {
                    final int c = read();
                    if(accept[c]) { break; }
                    str[len++] = (char)c;
                }
            }
            catch(EndOfFileRuntimeException e) { ; }

            return len;
        }

        public char[] nextLine() throws IOException {
            int len = 0;
            str[len++] = nextChar();
            len = reads(str, len, isLineSep);

            try {
                if(str[len-1] == '\r') { len--; read(); }
            }
            catch(EndOfFileRuntimeException e) { ; }

            return Arrays.copyOf(str, len);
        }

        public String nextString() throws IOException {
            return new String(next());
        }

        public char[] next() throws IOException {
            int len = 0;
            str[len++] = nextChar();
            len = reads(str, len, isSpace);
            return Arrays.copyOf(str, len);
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(nextString());
        }

    }

}

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collections;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

public class ERandom {
	static StringBuilder sb;
	static List<Integer>[] edges;
	static int m;
	static int n;

	public static void main(String[] args) throws Exception{
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);

		n = in.nextInt();
		m = in.nextInt();

		edges = (List<Integer>[])Array.newInstance(List.class, n+1);
		for(int i = 1 ; i <edges.length; i++){
			edges[i] = new ArrayList<Integer>();
		}

		for(int i = 0; i < m;  i++){
			int a = in.nextInt();
			int b = in.nextInt();
			edges[a].add(b);
			edges[b].add(a);
		}

		List<Integer> perm = new ArrayList<Integer>();
		for(int i = 1; i <= n; i++){
			perm.add(i);
		}
		for(int i=1; i<=300; i++){
			Collections.shuffle(perm);
			StringBuilder ans = new StringBuilder();

			boolean good = true;
			for(int j = 0 ;j < m ;j++){
				if(edges[perm.get(j)].contains(perm.get((j+1)%n))){
					good=false;
					break;
				}else{
					ans.append(perm.get(j) + " " + perm.get((j+1)%n)+"\n");
				}
			}
			if(good){
				out.println(ans);
				out.close();
				return;
			}
		}

		out.println(-1);
		out.close();
	}

	public static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String nextToken() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return isWhitespace(c);
		}

		public static boolean isWhitespace(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

}

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

public class ERedo {
	static StringBuilder sb;
	static List<Integer>[] edges;
	static int m;
	static int n;

	public static void main(String[] args) throws Exception{
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);

		n = in.nextInt();
		m = in.nextInt();

		edges = (List<Integer>[])Array.newInstance(List.class, n+1);
		for(int i = 1 ; i <edges.length; i++){
			edges[i] = new ArrayList<Integer>();
		}

		for(int i = 0; i < m;  i++){
			int a = in.nextInt();
			int b = in.nextInt();
			edges[a].add(b);
			edges[b].add(a);
		}

		if(n <= 6){
			//brute force
			boolean[][] bad = new boolean[n+1][n+1];
			for(int i = 1 ; i<= n; i++){
				for(int j = 1 ; j<= n; j++){
					bad[i][j] = edges[i].contains(j);
				}
			}

			List<List<Integer>> allPerms = new ArrayList<List<Integer>>();
			List<List<Integer>> allConfigs = new ArrayList<List<Integer>>();
			getAllPerms(new ArrayList<Integer>(), new boolean[n+1], allPerms);
			getAllConfigs(new ArrayList<Integer>(), n, allConfigs);

			//every configuration can be expressed as a permutation of nodes, and 3 states:
			final int CONTINUE = 0;
			final int CYCLE = 1;
			final int END = 2;

			StringBuilder ans = null;
			boolean good = false;
			for(List<Integer> perm : allPerms){
				for(List<Integer> config : allConfigs){
					ans = new StringBuilder();
					int numEdges = 0;
					//last start points to index right after last end / cycle
					int lastStart = perm.get(0);
					int lastStartIndex = 0;
					boolean isConfigGood = true;
					for(int i = 0; i < perm.size() && isConfigGood; i++){
						int curNode = perm.get(i);
						switch (config.get(i)){
							case CONTINUE:
								if(i == perm.size()-1){
									isConfigGood = false;
								}else{
									int nextNode = perm.get(i+1);
									if(bad[curNode][nextNode]){
										isConfigGood = false;
									}else{
										ans.append(curNode + " " + nextNode +"\n");
										numEdges++;
									}
								}
								break;
							case CYCLE:
								if(lastStartIndex < 0 || lastStartIndex+1 >= i){
									isConfigGood = false;
								}else{
									if(bad[curNode][lastStart]){
										isConfigGood = false;
									}else{
										ans.append(curNode + " " + lastStart + "\n");
										numEdges++;
										lastStartIndex = i+1;
										if(i < perm.size()-1)
											lastStart = perm.get(i+1);
									}
								}
								break;
							case END:
								lastStartIndex = i+1;
								if(i < perm.size()-1)
									lastStart = perm.get(i+1);
								break;
						}

						if(numEdges == m){
							good = true;
							break;
						}
					}
					if(good)
						break;
				}
				if(good)
					break;
			}

			if(good){
				out.println(ans);
			}else{
				out.println(-1);
			}
			out.close();
			return;
		}else{
			//n > 6
			//somebody's pro solution :<
			//we note that if bfs, i and i+3 will never be adjacent
			//if node i is distance d from root, then the worst possible case
			//,since each node has at most 2 outgoing edges, is that
			//node i+1 also has distance d, then i+2 must have distance d+1,
			//but touches i, due to bfs nature, and finally i+3 also has distance d+1
			//but touches node i+1, not i
			//if the condition is more relaxed, then i+3 distance >= i distance + 2,
			//which means it's trivially non touching
			//the other case is when i and i+3%n can be cyclic in the same component?
			//since n>6, we can eyeball that this will never happen

			boolean[] visit = new boolean[n+1];
			int[] order = new int[n];
			int index = 0;
			for(int i = 1 ; i <= n; i ++){
				if(!visit[i]){
					visit[i] = true;
					Queue<Integer> q = new LinkedList<Integer>();
					q.add(i);
					while(!q.isEmpty()){
						int j = q.poll();
						order[index] = j;
						index++;
						for(int next : edges[j]){
							if(!visit[next]){
								visit[next] = true;
								q.add(next);
							}
						}
					}
				}
			}
			for(int i = 0; i < m ;i++){
				out.println(order[i]  + " " + order[(i+3)%n]);
			}
		}

		out.close();
	}

	static void getAllPerms(List<Integer> current, boolean[] used, List<List<Integer>> compilation){
		if(current.size() == used.length-1){
			compilation.add(new ArrayList<Integer>(current));
		}else{
			for(int i = 1 ; i < used.length; i++){
				if(!used[i]){
					current.add(i);
					used[i] = true;
					getAllPerms(current, used, compilation);
					used[i] = false;
					current.remove(current.size()-1);
				}
			}
		}
	}

	static void getAllConfigs(List<Integer> current, int n, List<List<Integer>> compilation){
		if(current.size() == n){
			compilation.add(new ArrayList<Integer>(current));
		}else{
			for(int i = 0; i< 3; i++){
				current.add(i);
				getAllConfigs(current, n, compilation);
				current.remove(current.size()-1);
			}
		}
	}

	public static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String nextToken() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return isWhitespace(c);
		}

		public static boolean isWhitespace(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

}

import java.io.*;
import java.util.*;

public class C {

	int[][] next;

	void addEdge(int from, int to) {
		if (next[0][from] == -1) {
			next[0][from] = to;
		} else {
			next[1][from] = to;
		}
	}

	boolean fine(ArrayList<Integer> order, int m) {
		for (int i = 0; i < m; i++) {
			int st = order.get(i);
			int en = order.get(i + 1);
			if (next[0][st] == en || next[1][st] == en) {
				return false;
			}
		}
		return true;
	}

	void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		next = new int[2][n];
		Arrays.fill(next[0], -1);
		Arrays.fill(next[1], -1);
		for (int i = 0; i < m; i++) {
			int st = nextInt() - 1;
			int en = nextInt() - 1;
			addEdge(st, en);
			addEdge(en, st);
		}
		ArrayList<Integer> order = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			order.add(i);
		}
		for (int it = 0; it < 10000; it++) {
			Collections.shuffle(order);
			order.add(order.get(0));
			if (fine(order, m)) {
				for (int i = 0; i < m; i++) {
					out.println((order.get(i) + 1) + " "
							+ (order.get(i + 1) + 1));
				}
				return;
			}
			order.remove(order.size() - 1);
		}
		out.println(-1);
	}

	void run() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new C().run();
	}

	BufferedReader br;
	PrintWriter out;
	StringTokenizer str;

	String next() throws IOException {
		while (str == null || !str.hasMoreTokens()) {
			str = new StringTokenizer(br.readLine());
		}
		return str.nextToken();
	}

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

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

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

}

import java.util.List;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

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

class TaskC {
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        int n = in.nextInt();
        int m = in.nextInt();
        int[] p = new int[n];
        for (int i = 0; i < n; i++) {
            p[i] = i;
        }
        long[] edges = new long[m];
        for (int i = 0; i < m; i++) {
            int x = in.nextInt() - 1;
            int y = in.nextInt() -1 ;
            if (x > y) {
                int t = x;
                x = y;
                y = t;
            }
            edges[i] = (long) x * n + y;
        }
        ArrayUtils.sort(edges);
        int IT = 10000000 / n;
        for (int it = 0; it < IT; it++) {
            ArrayUtils.shuffle(p);
            int count = 0;
            for (int i = 0; i < n; i++) {
                int x = p[i];
                int y = p[(i + 1) % n];
                if (x > y) {
                    int t = x;
                    x = y;
                    y = t;
                }
                long ed = (long) x * n + y;
                if (Arrays.binarySearch(edges, ed) < 0) {
                    ++count;
                }
            }
            if (count >= m) {
                count = 0;
                for (int i = 0; count < m && i < n; i++) {
                    int x = p[i];
                    int y = p[(i + 1) % n];
                    if (x > y) {
                        int t = x;
                        x = y;
                        y = t;
                    }
                    long ed = (long) x * n + y;
                    if (Arrays.binarySearch(edges, ed) < 0) {
                        out.println((x + 1) + " " + (y + 1));
                        ++count;
                    }
                }
                return;
            }
        }
        out.println(-1);
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}

class ArrayUtils {

    static final long seed = System.nanoTime();

    static final Random rand = new Random(seed);

    public static void shuffle(int[] a) {
        for (int i = 0; i < a.length; i++) {
            int j = rand.nextInt(i + 1);
            int t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    public static void sort(long[] a) {
        shuffle(a);
        Arrays.sort(a);
    }

    public static void shuffle(long[] a) {
        for (int i = 0; i < a.length; i++) {
            int j = rand.nextInt(i + 1);
            long t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    }

import java.io.*;
import java.util.*;

public class C {

	static void solve() throws IOException {
		int n = nextInt(), edgesCount = nextInt();
		if (edgesCount == 0) {
			return;
		}
		@SuppressWarnings("unchecked")
		List<Integer>[] edges = new List[n];
		for (int i = 0; i < n; i++) {
			edges[i] = new ArrayList<>(2);
		}
		for (int i = 0; i < edgesCount; i++) {
			int u = nextInt() - 1, v = nextInt() - 1;
			edges[u].add(v);
			edges[v].add(u);
		}

		if (edgesCount <= n - 2) {
			int start = 0;
			for (int i = 0; i < n; i++) {
				if (edges[i].size() < edges[start].size()) {
					start = i;
				}
			}
			int current = start;
			Queue<Integer> free = new ArrayDeque<>();
			for (int i = 0; i < n; i++) {
				if (i != start) {
					free.add(i);
				}
			}
			for (int i = 0; i < edgesCount - 1; i++) {
				int next = -1;
				while (true) {
					Integer to = free.poll();
					if (!edges[current].contains(to)) {
						next = to;
						break;
					} else {
						free.add(to);
					}
				}
				out.println((current + 1) + " " + (next + 1));
				current = next;
			}
			for (Integer to : free) {
				if (!edges[start].contains(to)) {
					out.println((start + 1) + " " + (to + 1));
					break;
				}
			}
			return;
		}

		if (edgesCount == n) {
			if (n < 5) {
				out.println(-1);
			} else {
				solveForGraphOfCycles(n, edges);
			}
			return;
		}

		// if (edgesCount == n - 1) {
		if (n <= 3) {
			out.println(-1);
			return;
		}
		if (n == 4) {
			for (int u = 0; u < n; u++) {
				if (edges[u].size() == 0) {
					out.println(-1);
					return;
				}
			}
			for (int i = 0; i < n; i++) {
				for (int j = i + 1; j < n; j++) {
					if (!edges[i].contains(j)) {
						out.println((i + 1) + " " + (j + 1));
					}
				}
			}
			return;
		}
		for (int u = 0; u < n; u++) {
			if (edges[u].size() == 0) {
				boolean[] was = new boolean[n];
				was[u] = true;
				List<List<Integer>> cycles = getCycles(n, edges, was);
				if (n > 5) {
					output(solveForCycles(cycles));
					return;
				} else {
					List<Integer> list = cycles.get(0);
					out.println((list.get(2) + 1) + " " + (list.get(0) + 1));
					out.println((list.get(0) + 1) + " " + (u + 1));
					out.println((u + 1) + " " + (list.get(1) + 1));
					out.println((list.get(1) + 1) + " " + (list.get(3) + 1));
					return;
				}
			}
		}
		for (int u = 0; u < n; u++) {
			if (edges[u].size() == 1) {
				for (int v = u + 1; v < n; v++) {
					if (edges[v].size() == 1) {
						if (!edges[u].contains(v)) {
							edges[u].add(v);
							edges[v].add(u);
							++edgesCount;
							List<List<Integer>> cycles = getCycles(n, edges,
									new boolean[n]);
							List<Integer> answer = solveForCycles(cycles);
							outputPath(answer);
							return;
						} else {
							if (n == 5) {
								List<Integer> notij = new ArrayList<>();
								for (int k = 0; k < 5; k++) {
									if (k != u && k != v) {
										notij.add(k);
									}
								}
								out.println((notij.get(0) + 1) + " " + (u + 1));
								out.println((u + 1) + " " + (notij.get(1) + 1));
								out.println((notij.get(1) + 1) + " " + (v + 1));
								out.println((v + 1) + " " + (notij.get(2) + 1));
								return;
							} else {
								boolean[] was = new boolean[n];
								was[u] = was[v] = true;
								List<List<Integer>> cycles = getCycles(n,
										edges, was);
								if (n == 6) {
									List<Integer> list = cycles.get(0);
									out.println((list.get(2) + 1) + " " + (list.get(0) + 1));
									out.println((list.get(0) + 1) + " " + (u + 1));
									out.println((u + 1) + " " + (list.get(1) + 1));
									out.println((list.get(1) + 1) + " " + (list.get(3) + 1));
									out.println((list.get(3)+1)+" "+(v+1));
								} else {
									List<Integer> answer = solveForCycles(cycles);
									answer.add(u);
									output(answer);
								}
								return;
							}
						}
					}
				}
			}
			// }
		}

	}

	private static void solveForGraphOfCycles(int n, List<Integer>[] edges) {
		boolean[] was = new boolean[n];
		List<List<Integer>> cycles = getCycles(n, edges, was);
		List<Integer> answer = solveForCycles(cycles);
		output(answer);
	}

	private static List<List<Integer>> getCycles(int n, List<Integer>[] edges,
			boolean[] was) {
		List<List<Integer>> cycles = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			if (was[i]) {
				continue;
			}
			List<Integer> curCycle = new ArrayList<>();
			curCycle.add(i);
			was[i] = true;
			int prev = i;
			int cur = edges[i].get(0);
			while (!was[cur]) {
				curCycle.add(cur);
				was[cur] = true;
				int next = edges[cur].get(0) ^ edges[cur].get(1) ^ prev;
				prev = cur;
				cur = next;
			}
			cycles.add(curCycle);
		}
		return cycles;
	}

	private static List<Integer> solveForCycles(List<List<Integer>> cycles) {
		int maxCycle = 0;
		for (int i = 0; i < cycles.size(); i++) {
			if (cycles.get(i).size() > cycles.get(maxCycle).size()) {
				maxCycle = i;
			}
		}
		List<Integer> what = cycles.remove(maxCycle);
		if (what.size() >= 5) {
			LinkedList<Integer> answer = new LinkedList<Integer>(
					reorderCycle(what));
			for (List<Integer> list : cycles) {
				insertListToAnswer(answer, list);
			}
			return (answer);
		} else {
			List<Integer> list1 = what;
			List<Integer> list2 = cycles.remove(cycles.size() - 1);
			LinkedList<Integer> answer = new LinkedList<>(uniteTwoSmall(list1,
					list2));
			for (List<Integer> list : cycles) {
				insertListToAnswer(answer, list);
			}
			return (answer);
		}
	}

	private static List<Integer> uniteTwoSmall(List<Integer> list1,
			List<Integer> list2) {
		List<Integer> result = new ArrayList<>();
		if (list1.size() == list2.size()) {
			for (int i = 0; i < list1.size(); i++) {
				result.add(list1.get(i));
				result.add(list2.get(i));
			}
		} else {
			if (list1.size() > list2.size()) {
				List<Integer> t = list1;
				list1 = list2;
				list2 = t;
			}
			if (list1.size() != 3 || list2.size() != 4) {
				throw new AssertionError();
			}
			result.add(list2.get(0));
			result.add(list1.get(0));
			result.add(list2.get(1));
			result.add(list1.get(1));
			result.add(list2.get(3));
			result.add(list1.get(2));
			result.add(list2.get(2));
		}
		return result;
	}

	private static void output(List<Integer> cycle) {
		Iterator<Integer> it = cycle.iterator();
		int first = it.next();
		int current = first;
		while (it.hasNext()) {
			int next = it.next();
			out.println((current + 1) + " " + (next + 1));
			current = next;
		}
		out.println((current + 1) + " " + (first + 1));
	}

	private static void outputPath(List<Integer> path) {
		Iterator<Integer> it = path.iterator();
		int first = it.next();
		int current = first;
		while (it.hasNext()) {
			int next = it.next();
			out.println((current + 1) + " " + (next + 1));
			current = next;
		}
	}

	private static void insertListToAnswer(LinkedList<Integer> answer,
			List<Integer> list) {
		ListIterator<Integer> it = answer.listIterator();
		for (Integer value : list) {
			it.add(value);
			it.next();
		}
	}

	private static List<Integer> reorderCycle(List<Integer> what) {
		if (what.size() == 6) {
			List<Integer> result = new ArrayList<>();
			result.add(what.get(0));
			result.add(what.get(3));
			result.add(what.get(1));
			result.add(what.get(5));
			result.add(what.get(2));
			result.add(what.get(4));
			return result;
		} else {
			int okStep = -1;
			for (int step = 2; step < what.size() - 1; step++) {
				if (gcd(what.size(), step) == 1) {
					okStep = step;
					break;
				}
			}
			if (okStep < 0) {
				throw new AssertionError();
			}
			List<Integer> result = new ArrayList<>();
			result.add(what.get(0));
			int pos = okStep;
			while (pos != 0) {
				result.add(what.get(pos));
				pos += okStep;
				if (pos >= what.size()) {
					pos -= what.size();
				}
			}
			return result;
		}
	}

	static int gcd(int a, int b) {
		while (a > 0 && b > 0) {
			if (a > b) {
				a %= b;
			} else {
				b %= a;
			}
		}
		return a | b;
	}

	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter out;

	public static void main(String[] args) throws IOException {
		InputStream input = System.in;
		PrintStream output = System.out;
		File file = new File("c.in");
		if (file.exists() && file.canRead()) {
			input = new FileInputStream(file);
		}
		br = new BufferedReader(new InputStreamReader(input));
		out = new PrintWriter(output);
		solve();
		out.close();
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return null;
			}
			st = new StringTokenizer(line);
		}
		return st.nextToken();
	}
}

import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskC {

    int n, m;
    int[] path;

    int[] next;

    boolean dfs(int depth) {

        if (depth == m + 1) return true;

        if (depth == n && n != 2) {
            for (Edge e = first[path[n - 1]]; e != null; e = e.next) {
                if (e.to == path[0]) return false;
            }

            return true;
        }

        for (int i = next[0], last = 0; i != -1; last = i, i = next[i]) {
            boolean used = false;
            if (depth > 0) {
                for (Edge e = first[path[depth - 1]]; e != null; e = e.next) {
                    if (e.to == i) {
                        used = true;
                        break;
                    }
                }
            }

            if (used) continue;
//            if(depth > 0) System.out.println(path[depth - 1] + " " + i);
            path[depth] = i;
            next[last] = next[i];
            if (dfs(depth + 1)) return true;
            next[last] = i;
        }

        return false;
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        n = in.nextInt();
        m = in.nextInt();
        path = new int[n];
        next = new int[n + 1];
        first = new Edge[n + 1];

        for (int i = 0; i < m; ++i) {
            int u, v;
            u = in.nextInt();
            v = in.nextInt();
            new Edge(u, v);
            new Edge(v, u);
        }

        next[0] = 1;
        for (int i = 1; i < n; ++i) {
            next[i] = i + 1;
        }
        next[n] = -1;
        for (int x = 0; x < 1; ++x) {
            if (dfs(x)) {
                if (m == n) {
                    for (int i = 0; i < n; ++i) {
                        out.println(path[i] + " " + path[(i + 1) % n]);
                    }
                } else {
                    for (int i = 0; i < m; ++i) {
                        out.println(path[i] + " " + path[(i + 1)]);
                    }
                }

                return;
            }
        }
        out.println(-1);

    }

    Edge first[];

    class Edge
    {
        int to;
        Edge next;

        public Edge(int from, int to) {
            // TODO Auto-generated constructor stub
            this.to = to;
            this.next = first[from];
            first[from] = this;
        }
    }
}

class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e) {
                throw new UnknownError();
            }
        }
        return tokenizer.nextToken();
    }

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

    }

import java.util.*;
import java.io.*;
import java.lang.Math.*;

public class Main {

    int n, m;
    ArrayList<Integer> e[] = new ArrayList[100001];

    Boolean isEdge(int u, int v) {
        for (int i = 0; i < e[u].size(); i++) if (e[u].get(i) == v) return true;
        return false;
    }

    public void Run() {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        m = in.nextInt();
        for (int i = 1; i <= n; i++) e[i] = new ArrayList<Integer>();
        for (int i = 0; i < m; i++) {
            int u, v;
            u = in.nextInt();
            v = in.nextInt();
            e[u].add(v);
            e[v].add(u);
        }

        ArrayList<Integer> v = new ArrayList<Integer>();
        for (int i = 1; i <= n; i++) v.add(i);

        Boolean found = false;
        for (int it = 0; it < 100; it++) {
            Boolean ok = true;
            Collections.shuffle(v);
            for (int i = 1; i < n; i++) {
                if (isEdge(v.get(i), v.get(i - 1))) {
                    ok = false;
                    break;
                }
            }
            if (m == n && isEdge(v.get(0), v.get(v.size() - 1))) ok = false;
            if (ok) {
                for (int i = 0; i < m; i++) {
                    System.out.println(v.get(i) + " " + v.get((i + 1) % n));
                }
                found = true;
                break;
            }
        }
        if (!found) {
            System.out.println(-1);
        }
    }

    public static void main(String[] args) {
        new Main().Run();
    }
}

import java.io.*;
import java.util.*;

public class C {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	long startTime = System.currentTimeMillis();

	int n, m;
	int[] a, b;
	int[] ind;
	int[] deg;

	void bruteForce() throws IOException {
		boolean[][] ban = new boolean[n][n];

		for (int i = 0; i < m; i++) {
			int v1 = nextInt() - 1;
			int v2 = nextInt() - 1;
			ban[v1][v2] = ban[v2][v1] = true;
		}

		int newM = n * (n - 1) / 2 - m;
		a = new int[newM];
		b = new int[newM];
		int ptr = 0;

		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				if (!ban[i][j]) {
					a[ptr] = i;
					b[ptr] = j;
					ptr++;
				}
			}
		}

		deg = new int[n];
		ind = new int[m];
		if (gen(0, 0)) {
			for (int i = 0; i < m; i++) {
				out.println((a[ind[i]] + 1) + " " + (b[ind[i]] + 1));
			}
		} else {
			out.println(-1);
		}
	}

	boolean gen(int i, int pick) {
		if (pick == m) {
			return true;
		}
		if (i == a.length) {
			return false;
		}
		if (deg[a[i]] < 2 && deg[b[i]] < 2) {
			deg[a[i]]++;
			deg[b[i]]++;
			ind[pick] = i;
			if (gen(i + 1, pick + 1))
				return true;
			deg[a[i]]--;
			deg[b[i]]--;
		}

		if (gen(i + 1, pick)) {
			return true;
		}
		return false;
	}

	void solve() throws IOException {
		n = nextInt();
		m = nextInt();

		long edges = (long) n * (n - 1) / 2;
		if (m > edges - m) {
			out.println(-1);
			return;
		}

		if (n <= 8) {
			bruteForce();
		} else {
			smart();
		}

	}

	void smart() throws IOException {
		Random rng = new Random();
		List<Integer>[] g = new List[n];
		for (int i = 0; i < n; i++) {
			g[i] = new ArrayList<>(2);
		}

		for (int i = 0; i < m; i++) {
			int v1 = nextInt() - 1;
			int v2 = nextInt() - 1;
			g[v1].add(v2);
			g[v2].add(v1);
		}

		int[] order = new int[n + 1];

		outer: while (System.currentTimeMillis() - startTime < 2300) {
			for (int i = 0; i < n; i++) {
				int j = rng.nextInt(i + 1);
				order[i] = order[j];
				order[j] = i;
			}
			order[n] = order[0];
			for (int i = 0; i < m; i++) {
				int v1 = order[i];
				int v2 = order[i + 1];
				if (g[v1].contains(v2))
					continue outer;
			}
			for (int i = 0; i < m; i++) {
				out.println((order[i] + 1) + " " + (order[i + 1] + 1));
			}
			return;
		}
		out.println(-1);
	}

	C() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new C();
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return null;
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			eof = true;
			return null;
		}
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
}

import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Reader;
import java.io.InputStream;

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

class TaskC {
    public void solve(int testNumber, InputStreamReader inSt, PrintWriter out) {
        InputReader in = new InputReader(inSt);
        int n = in.nextInt();
        int m = in.nextInt();
        int[][] g = new int[n][2];
        for (int i = 0; i < n; i++) {
            g[i][0] = -1;
            g[i][1] = -1;
        }
        for (int i = 0; i < m; i++) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            if (g[a][0] >= 0) {
                g[a][1] = b;
            } else {
                g[a][0] = b;
            }

            if (g[b][0] >= 0) {
                g[b][1] = a;
            } else {
                g[b][0] = a;
            }
        }
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = i;
        }

        for (int i = 0; i < 100; i++) {
            shuffle(arr);
            boolean isOk = true;
            for (int j = 0; j < m; j++) {
                if ((g[arr[j]][0] == arr[(j + 1) % n]) || (g[arr[j]][1] == arr[(j + 1) % n])) {
                    isOk = false;
                    break;
                }
            }
            if (isOk) {
                for (int j = 0; j < m; j++) {
                    out.println((arr[j] + 1) + " " + (arr[(j + 1) % n] + 1));
                }
                return;
            }

        }
        out.println(-1);
    }

    private void shuffle(int[] arr) {
        Random random = new Random();
        for (int i = 0; i < arr.length; i++) {
            int j = i + random.nextInt(arr.length - i);

            int tmp = arr[i];
            arr[i] = arr[j];
            arr[j] = tmp;
        }
    }

    class InputReader {
        public BufferedReader reader;
        private String[] currentArray;
        int curPointer;

        public InputReader(InputStreamReader inputStreamReader) {
            reader = new BufferedReader(inputStreamReader);
        }

        public String next() {
            try {
                currentArray = null;
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public void nextChars(char[] t) {
            try {
                currentArray = null;
                reader.read(t);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public char nextChar() {
            try {
                currentArray = null;
                return (char) reader.read();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            if ((currentArray == null) || (curPointer >= currentArray.length)) {
                try {
                    currentArray = reader.readLine().split(" ");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                curPointer = 0;
            }
            return Integer.parseInt(currentArray[curPointer++]);
        }

        public long nextLong() {
            if ((currentArray == null) || (curPointer >= currentArray.length)) {
                try {
                    currentArray = reader.readLine().split(" ");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                curPointer = 0;
            }
            return Long.parseLong(currentArray[curPointer++]);
        }

    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class C {
	static int i(String s) { return Integer.parseInt(s); }
	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String[] arr = in.readLine().split(" ");
		int n = i(arr[0]);
		int m = i(arr[1]);
		List<List<Integer>> E= new ArrayList<List<Integer>>();
		for(int i=0; i<n; i++) E.add(new ArrayList<Integer>());
		for(int i=0; i<m; i++) {
			arr = in.readLine().split(" ");
			int x = i(arr[0])-1;
			int y = i(arr[1])-1;
			E.get(x).add(y);
			E.get(y).add(x);
		}

		List<Integer> V = new ArrayList<Integer>();
		for(int i=0; i<n; i++) V.add(i);
		T: for(int t=0; t<1000; t++) {
			Collections.shuffle(V);
			int edges = 0;
			for(int i=0; i<V.size()-1; i++) {
				if(!E.get(V.get(i)).contains(V.get(i+1)))
					edges++;
				else continue T;
				if(edges==m) {
					for(int j=0; j<m; j++)
						System.out.printf("%d %d\n", V.get(j)+1, V.get(j+1)+1);
					return;
				}
			}
			if(m==n && !E.get(V.get(0)).contains(V.get(n-1))) {
				for(int j=0; j<n-1; j++)
					System.out.printf("%d %d\n", V.get(j)+1, V.get(j+1)+1);
				System.out.printf("%d %d\n", V.get(0)+1, V.get(n-1)+1);
				return;
			}
		}
		System.out.println(-1);
	}
}

import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskC {
    int[][] adj;
    int[] nadj;
    int[] seq;
    int[] deg;
    long finish;
    int checkEach;
    boolean timeOver;
    PrintWriter out;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        this.out = out;
        long start = System.currentTimeMillis();
        int nodes = in.nextInt();
        int edges = in.nextInt();
        adj = new int[nodes][2];
        for (int[] x : adj) Arrays.fill(x, -1);
        nadj = new int[nodes];
        for (int i = 0; i < edges; ++i) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            adj[a][nadj[a]++] = b;
            adj[b][nadj[b]++] = a;
        }
        Random random = new Random(5346543531L + System.currentTimeMillis());
        seq = new int[nodes];
        deg = new int[nodes];
        for (int attempt = 0; attempt < 10; ++attempt) {
            finish = start + (attempt + 1) * 200;
            checkEach = 1000000;
            timeOver = false;
            for (int i = 0; i < nodes; ++i) {
                seq[i] = i;
            }
            for (int i = 0; i < nodes; ++i) {
                int j = i + random.nextInt(nodes - i);
                int tmp = seq[i];
                seq[i] = seq[j];
                seq[j] = tmp;
            }
            Arrays.fill(deg, 0);
            if (rec(0, edges)) return;
        }
        out.println(-1);
    }

    private boolean rec(int at, int edges) {
        if (edges == 0) {
            return true;
        }
        if (at >= seq.length) return false;
        --checkEach;
        if (checkEach < 0) {
            if (System.currentTimeMillis() > finish) timeOver = true;
            checkEach = 1000000;
        }
        if (timeOver) return false;
        int v = seq[at];
        if (deg[v] == 0 && edges >= 2) {
            for (int dest = at + 1; dest < seq.length; ++dest) {
                int vv = seq[dest];
                if (adj[v][0] == vv || adj[v][1] == vv || deg[vv] >= 2) continue;
                ++deg[v];
                ++deg[vv];
                for (int d2 = dest + 1; d2 < seq.length; ++d2) {
                    int vvv = seq[d2];
                    if (adj[v][0] == vvv || adj[v][1] == vvv || deg[vvv] >= 2) continue;
                    ++deg[v];
                    ++deg[vvv];
                    if (rec(at + 1, edges - 2)) {
                        out.println((v + 1) + " " + (vv + 1));
                        out.println((v + 1) + " " + (vvv + 1));
                        return true;
                    }
                    if (timeOver) return false;
                    --deg[v];
                    --deg[vvv];
                }
                if (timeOver) return false;
                --deg[v];
                --deg[vv];
            }
        }
        if (deg[v] < 2) {
            for (int dest = at + 1; dest < seq.length; ++dest) {
                int vv = seq[dest];
                if (adj[v][0] == vv || adj[v][1] == vv || deg[vv] >= 2) continue;
                ++deg[v];
                ++deg[vv];
                if (rec(at + 1, edges - 1)) {
                    out.println((v + 1) + " " + (vv + 1));
                    return true;
                }
                if (timeOver) return false;
                --deg[v];
                --deg[vv];
            }
        }
        return rec(at + 1, edges);
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

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

    }

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;

public class ProblemC {

	static final Random Rnd = new Random(1000000009L);

	public static void main(String[] args) throws IOException {
		long end_time = System.currentTimeMillis() + 2500;
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

		String[] data = in.readLine().split(" ");
		int n = Integer.valueOf(data[0]);
		int m = Integer.valueOf(data[1]);

		Set<Integer>[] graph = new Set[n];
		for (int i = 0 ; i < n ; i++) {
			graph[i] = new HashSet<Integer>();
		}

		for (int i = 0 ; i < m ; i++) {
			String[] ln = in.readLine().split(" ");
			int a = Integer.valueOf(ln[0])-1;
			int b = Integer.valueOf(ln[1])-1;
			graph[a].add(b);
			graph[b].add(a);
		}

		int[] wry = new int[n];
		for (int i = 0 ; i < n ; i++) {
			wry[i] = i;
		}

		while (System.currentTimeMillis() < end_time) {
			for (int i = 0 ; i < n ; i++) {
				int t = Rnd.nextInt(n);
				int tmp = wry[t];
				wry[t] = wry[i];
				wry[i] = tmp;
			}

			boolean isok = true;
			for (int i = 0 ; i < m ; i++) {
				int a = wry[i];
				int b = wry[(i+1)%n];
				if (graph[a].contains(b)) {
					isok = false;
					break;
				}
			}
			if (isok) {
				for (int i = 0 ; i < m ; i++) {
					out.println((wry[i]+1) + " " + (wry[(i+1)%n]+1));
				}
				out.flush();
				return;
			}
		}
		out.println(-1);
		out.flush();
	}

	public static void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}
}

//package round192;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class C {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int n = ni(), m = ni();
		int[] from = new int[m];
		int[] to = new int[m];
		for(int i = 0;i < m;i++){
			from[i] = ni()-1; to[i] = ni()-1;
		}

		int[][] g = packU(n, from, to);
		if(n < 6){
			int all = n*(n-1)/2;

			// (i,j)=(i,i+1+k)
			// n-1 ,.., n-1-i+1
			// (2n-2-i+1)/2*i+j-(i+1)
			int ng = 0;
			for(int i = 0;i < n;i++){
				for(int j : g[i]){
					if(i < j){
						ng |= 1<<(2*n-2-i+1)*i/2+j-(i+1);
					}
				}
			}
			outer:
			for(int i = 0;i < 1<<all;i++){
				if((i&ng)==0 && Integer.bitCount(i) == m){
					int[] deg = new int[n];
					{
						int r = 0, c = 1;
						for(int j = 0;j < all;j++){
							if(i<<31-j<0){
								deg[r]++;
								deg[c]++;
							}
							c++;
							if(c >= n){
								r++;
								c = r+1;
							}
						}
						for(int j = 0;j < n;j++){
							if(deg[j] > 2)continue outer;
						}
					}
					{
						int r = 0, c = 1;
						for(int j = 0;j < all;j++){
							if(i<<31-j<0){
								out.println((r+1) + " " + (c+1));
							}
							c++;
							if(c >= n){
								r++;
								c = r+1;
							}
						}
					}
					return;
				}
			}
			out.println(-1);
		}else{
			for(int[] v : g){
				Arrays.sort(v);
			}
			int[] path = new int[n];
			boolean[] used = new boolean[n];
			path[0] = 0;
			used[0] = true;
			int[] rem = new int[n-1];
			for(int i = 1;i < n;i++)rem[i-1] = i;
			outer:
			for(int i = 1;i < n;i++){
				for(int j = 0;j < n-i;j++){
					if(Arrays.binarySearch(g[path[i-1]], rem[j]) < 0){
						path[i] = rem[j];
						rem[j] = rem[n-i-1];
						continue outer;
					}
				}

				// on
				for(int j = 1;j < i;j++){
					if(
							Arrays.binarySearch(g[rem[0]], path[j]) < 0 &&
							Arrays.binarySearch(g[path[j-1]], path[i-1]) < 0
							){
						for(int k = j, l = i-1;k < l;k++,l--){
							int d = path[k]; path[k] = path[l]; path[l] = d;
						}
						path[i] = rem[0];
						rem[0] = rem[n-i-1];
						continue outer;
					}
				}

				throw new AssertionError();
			}

			for(int i = 0;i < n-1;i++){
				if(
						Arrays.binarySearch(g[path[n-1]], path[i]) < 0 &&
						Arrays.binarySearch(g[path[0]], path[i+1]) < 0
						){
					for(int k = i+1, l = n-1;k < l;k++,l--){
						int d = path[k]; path[k] = path[l]; path[l] = d;
					}
					break;
				}
			}
			if(m == n){
				for(int i = 0;i < n;i++){
					out.println((path[i]+1) + " " + (path[(i+1)%n]+1));
				}
			}else{
				for(int i = 0;i < m;i++){
					out.println((path[i]+1) + " " + (path[i+1]+1));
				}
			}
		}
	}

	static int[][] packU(int n, int[] from, int[] to) {
		int[][] g = new int[n][];
		int[] p = new int[n];
		for(int f : from)
			p[f]++;
		for(int t : to)
			p[t]++;
		for(int i = 0;i < n;i++)
			g[i] = new int[p[i]];
		for(int i = 0;i < from.length;i++){
			g[from[i]][--p[from[i]]] = to[i];
			g[to[i]][--p[to[i]]] = from[i];
		}
		return g;
	}

	void run() throws Exception
	{
//		int n = 100000, m = 100000;
//		Random gen = new Random();
//		StringBuilder sb = new StringBuilder();
//		sb.append(n + " ");
//		sb.append(n + " ");
//		for(int i = 0;i < n;i++){
//			sb.append(gen.nextInt(100000)+1 + " ");
//			sb.append(gen.nextInt(100000)+1 + " ");
//		}
//		INPUT = sb.toString();
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new C().run(); }

	private byte[] inbuf = new byte[1024];
	private int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}

import java.io.*;
import java.util.*;

public class ProblemC {
    InputReader in; PrintWriter out;
    int n, m;
    List<Integer> p = new ArrayList();
    class Edge implements Comparable {
        int a; int b;
        Edge(int _a, int _b) {
            a = Math.min(_a, _b);
            b = Math.max(_a, _b);
        }
        @Override
        public int compareTo(Object arg0) {
            Edge second = (Edge)arg0;
            if (a < second.a)
                return -1;
            if (a == second.a) {
                if (b < second.b)
                    return -1;
                if (b == second.b)
                    return 0;
            }
            return 1;
        }
        @Override
        public boolean equals(Object obj) {
            return a == ((Edge)obj).a && b == ((Edge)obj).b;
        }
        @Override
        public int hashCode() {
            return a * 19 + b;
        }

    }
    Set<Edge> edges = new HashSet<Edge>();
    int[][] gr;
    boolean hasAns = false;
    void rec(int v1, int v2) {
//      System.out.println("rec " + v1 + " " + v2);
        if (v1 >= n - 1 && v2 >= n) {
            boolean ok = true;
            int k = 0;
            for (int i = 0; i < n && ok; i++)
                for (int j = i + 1; j < n && ok; j++) {
                    if (gr[i][j] == 1) {
                        k++;
                        if (edges.contains(new Edge(i, j))) {
                            ok = false;
                        }
                    }
                }
            if (k != m)
                ok = false;
            for (int i = 0; i < n; i++) {
                int k2 = 0;
                for (int j = 0; j < n; j++) {
                    if (gr[i][j] == 1 || gr[j][i] == 1)
                        k2++;
                }
                if (k2 > 2) {
                    ok = false;
                    break;
                }
            }
            if (ok) {
                for (int i = 0; i < n; i++)
                    for (int j = i + 1; j < n; j++) {
                        if (gr[i][j] == 1)
                            out.println((i + 1) + " " + (j + 1));
                    }
                hasAns = true;
            }
        }
        else {

            if (hasAns)
                return;

            int nv1 = v1;
            int nv2 = v2 + 1;
            if (nv2 == n) {
                nv1 = v1 + 1;
                nv2 = nv1 + 1;
            }
            gr[v1][v2] = 0;
            rec(nv1, nv2);
            gr[v1][v2] = 1;
            rec(nv1, nv2);
        }
    }
    void solve() {
        n = in.nextInt();
        m = in.nextInt();
        for (int i = 0; i < m; i++) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            edges.add(new Edge(a, b));
        }
        /*
        for (Edge e : edges) {
            out.println(e.a + " " + e.b);
        }
        */
        for (int i = 0; i < n; i++) {
            p.add(i);
        }
        if (n <= 7) {
            gr = new int[n][n];
            rec(0, 1);
        }
        else {
            for (int t = 0; t * n < 10000000; t++) {
                boolean ans = true;
                Collections.shuffle(p);
                for (int i = 0; i < m; i++) {
                    Edge e = new Edge(p.get(i), p.get((i + 1) % n));
                    if (edges.contains(e)) {
                        ans = false;
                        break;
                    }
                }
                if (ans) {
                    for (int i = 0; i < m; i++) {
                        out.println((p.get(i) + 1) + " " + (p.get((i + 1) % n) + 1));
                    }
                    hasAns = true;
                    break;
                }
            }
        }
        if (!hasAns)
            out.println("-1");
    }

    ProblemC(){
        boolean oj = System.getProperty("ONLINE_JUDGE") != null;
        try {
            if (oj) {
                in = new InputReader(System.in);
                out = new PrintWriter(System.out);
            }
            else {
                Writer w = new FileWriter("output.txt");
                in = new InputReader(new FileReader("input.txt"));
                out = new PrintWriter(w);
            }
        } catch(Exception e) {
            throw new RuntimeException(e);
        }
        solve();
        out.close();
    }
    public static void main(String[] args){
        new ProblemC();
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public InputReader(FileReader fr) {
        reader = new BufferedReader(fr);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }
    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() {
        return Long.parseLong(next());
    }
    public double nextDouble() {
        return Double.parseDouble(next());
    }

}

import java.io.*;
import java.util.StringTokenizer;

/**
 * Created with IntelliJ IDEA.
 * User: ali
 * Date: 7/20/13
 * Time: 7:47 PM
 * To change this template use File | Settings | File Templates.
 */
public class E
{
	public static void main(String [] args) throws IOException
	{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

		StringTokenizer tokenizer = new StringTokenizer(reader.readLine());

		int n = Integer.parseInt(tokenizer.nextToken());
		int m = Integer.parseInt(tokenizer.nextToken());
		long all = n*(n-1)/2;

		boolean [][] exist = new boolean[n][5];

		for(int i = 0 ; i < m ; i++)
		{
			tokenizer = new StringTokenizer(reader.readLine());
			int x = Integer.parseInt(tokenizer.nextToken()) - 1;
			int y = Integer.parseInt(tokenizer.nextToken()) - 1;
			if(x > y)
			{
				int t = x;
				x = y;
				y = t;
			}

			if(y < x+5)
				exist[x][y-x] = true;
		}

		if(2*m > all)
		{
			writer.println(-1);
			writer.flush();
			writer.close();
			return;
		}

		for(int i = 0 ; i < n ; i++)
		{
			int v = 0;
			for(int j = 1 ; j < 5 ; j++)
				if(exist[i][j])
					v++;
			for(int j = 1 ; v > 0 ; j++)
				if(!exist[i][j])
				{
					v--;
					writer.println((i+1)+" "+(i+j+1));
				}
		}

		writer.flush();
		writer.close();

	}
}

import java.io.*;
import java.util.*;

public class E
{
	public static void main(String [] args) throws IOException
	{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

		StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
		int nodes = Integer.parseInt(tokenizer.nextToken());
		int edges = Integer.parseInt(tokenizer.nextToken());

		int [][] graph = new int[nodes+1][2];
		int [] pointer = new int[nodes+1];
		for(int i = 0 ; i < edges ; i++)
		{
			tokenizer = new StringTokenizer(reader.readLine());
			int u = Integer.parseInt(tokenizer.nextToken());
			int v = Integer.parseInt(tokenizer.nextToken());

			graph[u][pointer[u]++] = v;
			graph[v][pointer[v]++] = u;
		}

		int [] res = new int[nodes];
		for(int i = 0 ; i < nodes ; i++)
			res[i] = i+1;

		outer : for(int time = 0 ; time < 100 ; time++)
		{
			shuffle(res);
			for(int i = 0 ; i < edges ; i++)
				if(edge(res[i], res[(i+1)%nodes], graph, pointer))
					continue outer;

			for(int i = 0 ; i < edges ; i++)
				writer.println(res[i]+" "+res[(i+1)%edges]);

			writer.flush();
			writer.close();
			return;
		}
		writer.println(-1);

		writer.flush();
		writer.close();
	}

	private static boolean edge(int a, int b, int [][] graph, int[] pointer)
	{
		for(int i = 0 ; i < pointer[a] ; i++)
			if(b == graph[a][i])
				return true;

		return false;
	}

	private static void shuffle(int[] array)
	{
		for(int i = 0 ; i < array.length/2 ; i++)
		{
			int u = (int) (Math.random()*array.length);
			int v = (int) (Math.random()*array.length);

			swap(array, u, v);
		}
	}

	private static void swap(int[] array, int u, int v)
	{
		int t = array[u];
		array[u] = array[v];
		array[v] = t;
	}
}

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.TreeSet;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskE {
  static final long mult = (long) 1e6;

  public void solve(int testNumber, FastScanner in, PrintWriter out) {
    int n = in.nextInt();
    int m = in.nextInt();

    TreeSet<Long> hs = new TreeSet<Long>();
    for (int i = 0; i < m; i++) {
      int a = in.nextInt() - 1;
      int b = in.nextInt() - 1;
      hs.add(key(a, b));
    }

    if (n <= 6) {
      int e = n * (n - 1) / 2;

      boolean works = false;
      int[] a = new int[m];
      int[] b = new int[m];
      for (int i = 0; i < (1 << e) && !works; i++) {
        if (Integer.bitCount(i) != m) continue;
        int[] deg = new int[n];
        int bit = 0;
        int ii = 0;
        boolean badFlag = false;
        for (int j = 0; j < n; j++) {
          for (int k = j + 1; k < n; k++) {
            if ((i & (1 << bit)) != 0) {
              deg[j]++;
              deg[k]++;
              a[ii] = j;
              b[ii] = k;

              ii++;
              if (deg[j] > 2 || deg[k] > 2 || hs.contains(key(j, k)))
                badFlag = true;
            }
            bit++;
          }
        }

        if (!badFlag) {
          works = true;
        }
      }

      if (!works) {
        out.printf("-1\n");
      } else {
        for (int i = 0; i < m; i++) {
          out.printf("%d %d\n", a[i] + 1, b[i] + 1);
        }
      }
    } else {
      Random r = new Random();
      for (int i = 0; i < 10; i++) {
        int[] p = new int[n];
        for (int j = 0; j < n; j++)
          p[j] = j;
        for (int j = 0; j < n - 1; j++) {
          int offSet = r.nextInt(n - j - 1) + 1;
          int k = j + offSet;
          int t = p[k];
          p[k] = p[j];
          p[j] = t;
        }
        int cnt = 0;
        for (int j = 0; j < n; j++) {
          if (!hs.contains(key(j, p[j])))
            cnt++;
        }

        if (cnt < m) continue;

        cnt = 0;
        for (int j = 0; j < n; j++) {
          if (!hs.contains(key(j, p[j]))) {
            cnt++;
            out.printf("%d %d\n", j + 1, p[j] + 1);
            if (cnt == m) return;
          }
        }
      }

      out.printf("-1\n");
    }
  }

  static long key(int a, int b) {
    if (a <= b) return a * mult + b;
    return key(b, a);
  }

}

class FastScanner {
  BufferedReader br;
  StringTokenizer st;

  public FastScanner(InputStream in) {
    br = new BufferedReader(new InputStreamReader(in));
    st = new StringTokenizer("");
  }

  public String next() {
    try {
      if (st.hasMoreTokens()) return st.nextToken();
      st = new StringTokenizer(br.readLine());
      return next();
    } catch (Exception e) {
      return "";
    }
  }

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

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.TreeSet;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskE {
  static final long mult = (long) 1e6;

  public void solve(int testNumber, FastScanner in, PrintWriter out) {
    int n = in.nextInt();
    int m = in.nextInt();

    TreeSet<Long> hs = new TreeSet<Long>();
    for (int i = 0; i < m; i++) {
      int a = in.nextInt() - 1;
      int b = in.nextInt() - 1;
      hs.add(key(a, b));
    }

    if (n <= 6) {
      int e = n * (n - 1) / 2;

      boolean works = false;
      int[] a = new int[m];
      int[] b = new int[m];
      for (int i = 0; i < (1 << e) && !works; i++) {
        if (Integer.bitCount(i) != m) continue;
        int[] deg = new int[n];
        int bit = 0;
        int ii = 0;
        boolean badFlag = false;
        for (int j = 0; j < n; j++) {
          for (int k = j + 1; k < n; k++) {
            if ((i & (1 << bit)) != 0) {
              deg[j]++;
              deg[k]++;
              a[ii] = j;
              b[ii] = k;

              ii++;
              if (deg[j] > 2 || deg[k] > 2 || hs.contains(key(j, k)))
                badFlag = true;
            }
            bit++;
          }
        }

        if (!badFlag) {
          works = true;
        }
      }

      if (!works) {
        out.printf("-1\n");
      } else {
        for (int i = 0; i < m; i++) {
          out.printf("%d %d\n", a[i] + 1, b[i] + 1);
        }
      }
    } else {
      Random r = new Random();
      int runs = (int) (1e6 / n);
      for (int i = 0; i < runs; i++) {
        int[] p = new int[n];
        for (int j = 0; j < n; j++)
          p[j] = j;
        for (int j = 0; j < n - 1; j++) {
          int offSet = r.nextInt(n - j - 1) + 1;
          int k = j + offSet;
          int t = p[k];
          p[k] = p[j];
          p[j] = t;
        }
        int cnt = 0;
        for (int j = 0; j < n; j++) {
          if (!hs.contains(key(j, p[j])))
            cnt++;
        }

        if (cnt < m) continue;

        cnt = 0;
        for (int j = 0; j < n; j++) {
          if (!hs.contains(key(j, p[j]))) {
            cnt++;
            out.printf("%d %d\n", j + 1, p[j] + 1);
            if (cnt == m) return;
          }
        }
      }

      out.printf("-1\n");
    }
  }

  static long key(int a, int b) {
    if (a <= b) return a * mult + b;
    return key(b, a);
  }

}

class FastScanner {
  BufferedReader br;
  StringTokenizer st;

  public FastScanner(InputStream in) {
    br = new BufferedReader(new InputStreamReader(in));
    st = new StringTokenizer("");
  }

  public String next() {
    try {
      if (st.hasMoreTokens()) return st.nextToken();
      st = new StringTokenizer(br.readLine());
      return next();
    } catch (Exception e) {
      return "";
    }
  }

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

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.BufferedWriter;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Writer;
import java.util.StringTokenizer;
import java.util.HashSet;
import java.io.InputStream;

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

class TaskE {
  static final long mult = (long) 1e6;

  public void solve(int testNumber, FastScanner in, FastWriter out) {
    int n = in.nextInt();
    int m = in.nextInt();

    HashSet<Long> hs = new HashSet<Long>();
    for (int i = 0; i < m; i++) {
      int a = in.nextInt() - 1;
      int b = in.nextInt() - 1;
      hs.add(key(a, b));
    }

    if (n <= 6) {
      int e = n * (n - 1) / 2;

      boolean works = false;
      int[] a = new int[m];
      int[] b = new int[m];
      for (int i = 0; i < (1 << e) && !works; i++) {
        if (Integer.bitCount(i) != m) continue;
        int[] deg = new int[n];
        int bit = 0;
        int ii = 0;
        boolean badFlag = false;
        for (int j = 0; j < n; j++) {
          for (int k = j + 1; k < n; k++) {
            if ((i & (1 << bit)) != 0) {
              deg[j]++;
              deg[k]++;
              a[ii] = j;
              b[ii] = k;

              ii++;
              if (deg[j] > 2 || deg[k] > 2 || hs.contains(key(j, k)))
                badFlag = true;
            }
            bit++;
          }
        }

        if (!badFlag) {
          works = true;
        }
      }

      if (!works) {
        out.printf("-1\n");
      } else {
        for (int i = 0; i < m; i++) {
          out.printf("%d %d\n", a[i] + 1, b[i] + 1);
        }
      }
    } else {
      int[] deg = new int[n];
      Random r = new Random();
      for (int i = 0; i < m; i++) {
        while (true) {
          int a = r.nextInt(n);
          int b = r.nextInt(n);
          if (a == b) continue;
          if (hs.contains(key(a, b))) continue;
          if (deg[a] >= 2 || deg[b] >= 2) continue;

          out.printf("%d %d\n", a + 1, b + 1);
          deg[a]++;
          deg[b]++;
          hs.add(key(a, b));
          break;
        }
      }
    }
  }

  static long key(int a, int b) {
    if (a <= b) return a * mult + b;
    return key(b, a);
  }

}

class FastScanner {
  BufferedReader br;
  StringTokenizer st;

  public FastScanner(InputStream in) {
    br = new BufferedReader(new InputStreamReader(in));
    st = new StringTokenizer("");
  }

  public String next() {
    try {
      if (st.hasMoreTokens()) return st.nextToken();
      st = new StringTokenizer(br.readLine());
      return next();
    } catch (Exception e) {
      return "";
    }
  }

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

class FastWriter extends PrintWriter {
  public FastWriter(OutputStream out) {
    super(new BufferedWriter(new OutputStreamWriter(out)));
    System.out.println("OS");
  }

//  public FastWriter(Writer out) {
//    super(new BufferedWriter(out));
//    System.out.println("W");
//  }
}

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.TreeSet;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskE {
  static final long mult = (long) 1e6;

  public void solve(int testNumber, FastScanner in, PrintWriter out) {
    int n = in.nextInt();
    int m = in.nextInt();

    TreeSet<Long> hs = new TreeSet<Long>();
    for (int i = 0; i < m; i++) {
      int a = in.nextInt() - 1;
      int b = in.nextInt() - 1;
      hs.add(key(a, b));
    }

    if (n <= 6) {
      int e = n * (n - 1) / 2;

      boolean works = false;
      int[] a = new int[m];
      int[] b = new int[m];
      for (int i = 0; i < (1 << e) && !works; i++) {
        if (Integer.bitCount(i) != m) continue;
        int[] deg = new int[n];
        int bit = 0;
        int ii = 0;
        boolean badFlag = false;
        for (int j = 0; j < n; j++) {
          for (int k = j + 1; k < n; k++) {
            if ((i & (1 << bit)) != 0) {
              deg[j]++;
              deg[k]++;
              a[ii] = j;
              b[ii] = k;

              ii++;
              if (deg[j] > 2 || deg[k] > 2 || hs.contains(key(j, k)))
                badFlag = true;
            }
            bit++;
          }
        }

        if (!badFlag) {
          works = true;
        }
      }

      if (!works) {
        out.printf("-1\n");
      } else {
        for (int i = 0; i < m; i++) {
          out.printf("%d %d\n", a[i] + 1, b[i] + 1);
        }
      }
    } else {
      Random r = new Random();
      for (int i = 0; i < 10; i++) {
        int[] p = new int[n];
        for (int j = 0; j < n; j++)
          p[j] = j;
        for (int j = 0; j < n - 1; j++) {
          int offSet = r.nextInt(n - j - 1);
          int k = j + offSet;
          int t = p[k];
          p[k] = p[j];
          p[j] = t;
        }
        int cnt = 0;
        for (int j = 0; j < n; j++) {
          if (!hs.contains(key(j, p[j])))
            cnt++;
        }

        if (cnt < m) continue;

        cnt = 0;
        for (int j = 0; j < n; j++) {
          if (!hs.contains(key(j, p[j]))) {
            cnt++;
            out.printf("%d %d\n", j + 1, p[j] + 1);
            if (cnt == m) return;
          }
        }
      }

      out.printf("-1\n");
    }
  }

  static long key(int a, int b) {
    if (a <= b) return a * mult + b;
    return key(b, a);
  }

}

class FastScanner {
  BufferedReader br;
  StringTokenizer st;

  public FastScanner(InputStream in) {
    br = new BufferedReader(new InputStreamReader(in));
    st = new StringTokenizer("");
  }

  public String next() {
    try {
      if (st.hasMoreTokens()) return st.nextToken();
      st = new StringTokenizer(br.readLine());
      return next();
    } catch (Exception e) {
      return "";
    }
  }

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

public class problemE {

	static void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		long[] edges = new long[m];
		for (int i = 0; i < m; i++) {
			int a = nextInt() - 1;
			int b = nextInt() - 1;
			if (a > b) {
				int t = a;
				a = b;
				b = t;
			}
			edges[i] = (long) a * n + b;
		}
		Arrays.sort(edges);
		int[] pos = new int[n];
		for (int i = 0; i < n; i++) {
			pos[i] = i;
		}
		int IT = 1000000 / n;
		for (int it = 0; it < IT; it++) {
			shuffle(pos);
			int cnt = 0;
			for (int z = 0; z < n; z++) {
				int i = pos[z];
				int j = pos[(z + 1) % n];
				if (i > j) {
					int t = i;
					i = j;
					j = t;
				}
				long id = (long) i * n + j;
				if (Arrays.binarySearch(edges, id) < 0) {
					++cnt;
				}
			}
			if (cnt >= m) {
				cnt = 0;
				for (int z = 0; cnt < m && z < n; z++) {
					int i = pos[z];
					int j = pos[(z + 1) % n];
					if (i > j) {
						int t = i;
						i = j;
						j = t;
					}
					long id = (long) i * n + j;
					if (Arrays.binarySearch(edges, id) < 0) {
						++cnt;
						out.println((i + 1) + " " + (j + 1));
					}
				}
				return ;
			}
		}
		out.println("-1");
	}

	static final Random rnd = new Random();

	static void shuffle(int[] a) {
		for (int i = 0; i < a.length; i++) {
			int j = rnd.nextInt(i + 1);
			int t = a[i];
			a[i] = a[j];
			a[j] = t;
		}
	}

	static BufferedReader br;
	static PrintWriter out;
	static StringTokenizer st;

	static boolean hasNextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return false;
			}
			st = new StringTokenizer(line);
		}
		return true;
	}

	static String nextToken() throws IOException {
		return hasNextToken() ? st.nextToken() : null;
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new OutputStreamWriter(System.out));
		solve();
		br.close();
		out.close();
	}
}

import javax.swing.*;
import java.io.*;
import java.util.*;

public class CodeForces {
    static boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    Random rand = new Random();

    void RandomShuffle(int[] nodes, int n) {
        for (int i = n - 1; i > 0; --i) {
            int j = rand.nextInt(i);
            int t = nodes[i];
            nodes[i] = nodes[j];
            nodes[j] = t;
        }
    }

    void runCase(int caseNum) throws IOException {
        int n = nextInt();
        int m = nextInt();
        int[][] edges = new int[n + 1][2];
        for (int i = 0; i < m; ++i) {
            int a = nextInt();
            int b = nextInt();
            if (edges[a][0] > 0)
                edges[a][1] = b;
            else
                edges[a][0] = b;
            if (edges[b][0] > 0)
                edges[b][1] = a;
            else
                edges[b][0] = a;
        }
        int[] nodes = new int[n + 1];
        for (int i = 0; i < n; ++i)
            nodes[i] = i + 1;
        for (int tt = 0; tt < 1000; ++tt) {
            RandomShuffle(nodes, n);
            nodes[n] = nodes[0];
            int cnt = 0;
            for (int i = 0; i < n; ++i) {
                if (edges[nodes[i]][0] != nodes[i + 1] && edges[nodes[i]][1] != nodes[i + 1])
                    ++cnt;
            }
            if (cnt >= m) {
                for (int i = 0; i < n; ++i) {
                    if (edges[nodes[i]][0] != nodes[i + 1] && edges[nodes[i]][1] != nodes[i + 1]) {
                        System.out.println(nodes[i] + " " + nodes[i + 1]);
                        --m;
                        //System.out.println("m: " + m);
                        if (m == 0)
                            break;
                    }
                }
                return;
            }
        }
        System.out.println("-1");
    }

    public static void main(String[] args) throws IOException {
        if (ONLINE_JUDGE){
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }else{
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
        new CodeForces().runIt();
        out.flush();
        out.close();
        return;
    }

    static BufferedReader in;
    private StringTokenizer st;
    static PrintWriter out;

    String next() throws IOException {
        while (!st.hasMoreTokens()) {
            String line = in.readLine();
            if (line == null) {
                return null;
            }
            st = new StringTokenizer(line, " ");
        }
        return st.nextToken();
    }

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

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

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

    void runIt() throws IOException {
        st = new StringTokenizer("");

//        int N = nextInt();
//        for (int i = 0; i < N; i++) {
//            runCase(i + 1);
//        }
        runCase(0);

        out.flush();
    }

}

import java.io.*;
import java.math.BigInteger;
import java.util.*;

import static java.util.Arrays.*;

public class C {
    private static final int mod = (int)1e9+7;

    IOFast io = new IOFast();

    int V, E;
    int[][] es;

    public void run() throws IOException {
        V = io.nextInt();
        E = io.nextInt();
        es = new int[E][2];
        for(int i = 0; i < E; i++) {
            for(int j = 0; j < es[i].length; j++) {
                es[i][j] = io.nextInt() - 1;
            }
        }

        if(V*(V-1L)/2 < 2*E) {
            io.out.println(-1);
            return;
        }

        if(V < 10000 / 2) {
            boolean[][] con = new boolean[V][V];
            for(int i = 0; i < E; i++) {
                con[es[i][0]][es[i][1]] = true;
                con[es[i][1]][es[i][0]] = true;
            }
            int rest = E;
            for(int i = 0; i < V; i++)
                for(int j = i + 1; j < V; j++)
                    if(!con[i][j]) {
                        io.out.println((i+1) + " " + (j+1));
                        if(--rest == 0) return;
                    }
        }

        int rest = E;
        Set<Long> used = new TreeSet<Long>();
        for(int[] e : es) {
            used.add(((long)Math.max(e[0], e[1])) << 32 | Math.min(e[0], e[1]));
        }
        Random random = new Random(0);
        while(rest != 0) {
            int a = random.nextInt(V);
            int b = random.nextInt(V);
            if(a == b) continue;
            if(a > b) { final int t = a; a = b; b = t; }
            if(used.contains(((long)b) << 32 | a)) {
                continue;
            }
            io.out.println((a+1) + " " + (b+1));
            used.add(((long)b) << 32 | a);
            rest--;
        }
    }

    void main() throws IOException {
        //      IOFast.setFileIO("rle-size.in", "rle-size.out");
        try {
            run();
        }
        catch (EndOfFileRuntimeException e) { }
        io.out.flush();
    }

    public static void main(String[] args) throws IOException {
        new C().main();
    }

    static class EndOfFileRuntimeException extends RuntimeException {
        private static final long serialVersionUID = -8565341110209207657L; }

    static
    public class IOFast {
        private BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        private PrintWriter out = new PrintWriter(System.out);

        void setFileIO(String ins, String outs) throws IOException {
            in = new BufferedReader(new FileReader(ins));
            out = new PrintWriter(new FileWriter(outs));
        }

        //      private static final int BUFFER_SIZE = 50 * 200000;
        private static int pos, readLen;
        private static final char[] buffer = new char[1024 * 8];
        private static final char[] str = new char[500000*8*2];
        private static boolean[] isDigit = new boolean[256];
        private static boolean[] isSpace = new boolean[256];
        private static boolean[] isLineSep = new boolean[256];

        static {
            for(int i = 0; i < 10; i++) { isDigit['0' + i] = true; }
            isDigit['-'] = true;
            isSpace[' '] = isSpace['\r'] = isSpace['\n'] = isSpace['\t'] = true;
            isLineSep['\r'] = isLineSep['\n'] = true;
        }

        public int read() throws IOException {
            if(pos >= readLen) {
                pos = 0;
                readLen = in.read(buffer);
                if(readLen <= 0) { throw new EndOfFileRuntimeException(); }
            }
            return buffer[pos++];
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(nextString());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(nextString());
        }

        public char nextChar() throws IOException {
            while(true) {
                final int c = read();
                if(!isSpace[c]) { return (char)c; }
            }
        }

        int reads(char[] cs, int len, boolean[] accept) throws IOException {
            try {
                while(true) {
                    final int c = read();
                    if(accept[c]) { break; }
                    str[len++] = (char)c;
                }
            }
            catch(EndOfFileRuntimeException e) { ; }

            return len;
        }

        public char[] nextLine() throws IOException {
            int len = 0;
            str[len++] = nextChar();
            len = reads(str, len, isLineSep);

            try {
                if(str[len-1] == '\r') { len--; read(); }
            }
            catch(EndOfFileRuntimeException e) { ; }

            return Arrays.copyOf(str, len);
        }

        public String nextString() throws IOException {
            return new String(next());
        }

        public char[] next() throws IOException {
            int len = 0;
            str[len++] = nextChar();
            len = reads(str, len, isSpace);
            return Arrays.copyOf(str, len);
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(nextString());
        }

    }

}

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;

public class ERedo {
	static StringBuilder sb;
	static List<Integer>[] edges;
	static int m;
	static int n;

	public static void main(String[] args) throws Exception{
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);

		n = in.nextInt();
		m = in.nextInt();

		edges = (List<Integer>[])Array.newInstance(List.class, n+1);
		for(int i = 1 ; i <edges.length; i++){
			edges[i] = new ArrayList<Integer>();
		}

		for(int i = 0; i < m;  i++){
			int a = in.nextInt();
			int b = in.nextInt();
			edges[a].add(b);
			edges[b].add(a);
		}

		if(n <= 6){
			//brute force
			boolean[][] bad = new boolean[n+1][n+1];
			for(int i = 1 ; i<= n; i++){
				for(int j = 1 ; j<= n; j++){
					bad[i][j] = edges[i].contains(j);
				}
			}

			List<List<Integer>> allPerms = new ArrayList<List<Integer>>();
			List<List<Integer>> allConfigs = new ArrayList<List<Integer>>();
			getAllPerms(new ArrayList<Integer>(), new boolean[n+1], allPerms);
			getAllConfigs(new ArrayList<Integer>(), n, allConfigs);

			//every configuration can be expressed as a permutation of nodes, and 3 states:
			final int CONTINUE = 0;
			final int CYCLE = 1;
			final int END = 2;

			StringBuilder ans = null;
			boolean good = false;
			for(List<Integer> perm : allPerms){
				for(List<Integer> config : allConfigs){
					ans = new StringBuilder();
					int numEdges = 0;
					//last start points to index right after last end / cycle
					int lastStart = perm.get(0);
					int lastStartIndex = 0;
					boolean isConfigGood = true;
					for(int i = 0; i < perm.size() && isConfigGood; i++){
						int curNode = perm.get(i);
						switch (config.get(i)){
							case CONTINUE:
								if(i == perm.size()-1){
									isConfigGood = false;
								}else{
									int nextNode = perm.get(i+1);
									if(bad[curNode][nextNode]){
										isConfigGood = false;
									}else{
										ans.append(curNode + " " + nextNode +"\n");
										numEdges++;
									}
								}
								break;
							case CYCLE:
								if(lastStartIndex < 0 || lastStartIndex+1 >= i){
									isConfigGood = false;
								}else{
									if(bad[curNode][lastStart]){
										isConfigGood = false;
									}else{
										ans.append(curNode + " " + lastStart + "\n");
										numEdges++;
										lastStartIndex = i+1;
										if(i < perm.size()-1)
											lastStart = perm.get(i+1);
									}
								}
								break;
							case END:
								lastStartIndex = i+1;
								if(i < perm.size()-1)
									lastStart = perm.get(i+1);
								break;
						}

						if(numEdges == m){
							good = true;
							break;
						}
					}
					if(good)
						break;
				}
				if(good)
					break;
			}

			if(good){
				out.println(ans);
			}else{
				out.println(-1);
			}
			out.close();
			return;
		}else{
			//n > 6
			//somebody's pro solution :<
			//we note that if bfs, i and i+3 will never be adjacent
			//if node i is distance d from root, then the worst possible case
			//,since each node has at most 2 outgoing edges, is that
			//node i+1 also has distance d, then i+2 must have distance d+1,
			//but touches i, due to bfs nature, and finally i+3 also has distance d+1
			//but touches node i+1, not i
			//if the condition is more relaxed, then i+3 distance >= i distance + 2,
			//which means it's trivially non touching
			//the other case is when i and i+3%n can be cyclic in the same component?
			//since n>6, we can eyeball that this will never happen

			boolean[] visit = new boolean[n+1];
			int[] order = new int[n];
			int index = 0;
			for(int i = 1 ; i < n; i ++){
				if(!visit[i]){
					visit[i] = true;
					Queue<Integer> q = new LinkedList<Integer>();
					q.add(i);
					while(!q.isEmpty()){
						int j = q.poll();
						order[index] = j;
						index++;
						for(int next : edges[j]){
							if(!visit[next]){
								visit[next] = true;
								q.add(next);
							}
						}
					}
				}
			}
			for(int i = 0; i < m ;i++){
				out.println(order[i]  + " " + order[(i+3)%n]);
			}
		}

		out.close();
	}

	static void getAllPerms(List<Integer> current, boolean[] used, List<List<Integer>> compilation){
		if(current.size() == used.length-1){
			compilation.add(new ArrayList<Integer>(current));
		}else{
			for(int i = 1 ; i < used.length; i++){
				if(!used[i]){
					current.add(i);
					used[i] = true;
					getAllPerms(current, used, compilation);
					used[i] = false;
					current.remove(current.size()-1);
				}
			}
		}
	}

	static void getAllConfigs(List<Integer> current, int n, List<List<Integer>> compilation){
		if(current.size() == n){
			compilation.add(new ArrayList<Integer>(current));
		}else{
			for(int i = 0; i< 3; i++){
				current.add(i);
				getAllConfigs(current, n, compilation);
				current.remove(current.size()-1);
			}
		}
	}

	public static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String nextToken() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return isWhitespace(c);
		}

		public static boolean isWhitespace(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

}

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Map;

public class ERedo {
	static StringBuilder sb;
	static List<Integer>[] edges;
	static int m;
	static int n;

	public static void main(String[] args) throws Exception{
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);

		n = in.nextInt();
		m = in.nextInt();

		edges = (List<Integer>[])Array.newInstance(List.class, n+1);
		for(int i = 1 ; i <edges.length; i++){
			edges[i] = new ArrayList<Integer>();
		}

		for(int i = 0; i < m;  i++){
			int a = in.nextInt();
			int b = in.nextInt();
			edges[a].add(b);
			edges[b].add(a);
		}

		if(n <= 6){
			//brute force
			boolean[][] bad = new boolean[n+1][n+1];
			for(int i = 1 ; i<= n; i++){
				for(int j = 1 ; j<= n; j++){
					bad[i][j] = edges[i].contains(j);
				}
			}

			List<List<Integer>> allPerms = new ArrayList<List<Integer>>();
			List<List<Integer>> allConfigs = new ArrayList<List<Integer>>();
			getAllPerms(new ArrayList<Integer>(), new boolean[n+1], allPerms);
			getAllConfigs(new ArrayList<Integer>(), n, allConfigs);

			//every configuration can be expressed as a permutation of nodes, and 3 states:
			final int CONTINUE = 0;
			final int CYCLE = 1;
			final int END = 2;

			StringBuilder ans = null;
			boolean good = false;
			for(List<Integer> perm : allPerms){
				for(List<Integer> config : allConfigs){
					ans = new StringBuilder();
					int numEdges = 0;
					//last start points to index right after last end / cycle
					int lastStart = perm.get(0);
					int lastStartIndex = 0;
					boolean isConfigGood = true;
					for(int i = 0; i < perm.size() && isConfigGood; i++){
						int curNode = perm.get(i);
						switch (config.get(i)){
							case CONTINUE:
								if(i == perm.size()-1){
									isConfigGood = false;
								}else{
									int nextNode = perm.get(i+1);
									if(bad[curNode][nextNode]){
										isConfigGood = false;
									}else{
										ans.append(curNode + " " + nextNode +"\n");
										numEdges++;
									}
								}
								break;
							case CYCLE:
								if(lastStartIndex < 0 || lastStartIndex+1 >= i){
									isConfigGood = false;
								}else{
									if(bad[curNode][lastStart]){
										isConfigGood = false;
									}else{
										ans.append(curNode + " " + lastStart + "\n");
										numEdges++;
										lastStartIndex = i+1;
										if(i < perm.size()-1)
											lastStart = perm.get(i+1);
									}
								}
								break;
							case END:
								lastStartIndex = i+1;
								if(i < perm.size()-1)
									lastStart = perm.get(i+1);
								break;
						}

						if(numEdges == m){
							good = true;
							break;
						}
					}
					if(good)
						break;
				}
				if(good)
					break;
			}

			if(good){
				out.println(ans);
			}else{
				out.println(-1);
			}
			out.close();
			return;
		}else{
			//n>6
			isComp = new boolean[n+1];
			//all the nodes stringed up together
			//note that there is always a way to string all the nodes together
			//each having degree = 2, just interleave in 2's, the only
			//annoying case is if the i+2 % n goes back to the first tail with cycle
			//to remedy this, just swap the last two tails for odd and even. This
			//is always possible since n>6
			int[] allNodes = new int[n];
			findConnectedComponents(allNodes);
			if(edges[allNodes.length-1].contains(allNodes.length-3)){
				swap(allNodes.length-1, allNodes.length-3, allNodes);
			}

			if(edges[allNodes.length-2].contains(allNodes.length-4)){
				swap(allNodes.length-2, allNodes.length-4, allNodes);
			}

			StringBuilder ans = new StringBuilder();
			List<Pair> pairs = new ArrayList<Pair>();

			for(int i = 0; i+2 < allNodes.length; i+=2){
				pairs.add(new Pair(allNodes[i],allNodes[i+2]));
			}

			for(int i = 1; i+2 < allNodes.length; i+=2){
				pairs.add(new Pair(allNodes[i],allNodes[i+2]));
			}

			pairs.add(new Pair(allNodes[allNodes.length-1], allNodes[1]));
			pairs.add(new Pair(allNodes[allNodes.length-2], allNodes[0]));

			for(int i = 0; i < m; i++){
				Pair p = pairs.get(i);
				ans.append(p.i1 + " " + p.i2 +" \n");
			}
			out.print(ans);
		}

		out.close();
	}

	static class Pair{
		public int i1;
		public int i2;
		public Pair(int i1, int i2) {
			this.i1 = i1;
			this.i2 = i2;
		}
	}

	static void swap(int i1, int i2, int[] arr){
		int temp = arr[i1];
		arr[i1] = arr[i2];
		arr[i2] = temp;
	}

	static void getAllPerms(List<Integer> current, boolean[] used, List<List<Integer>> compilation){
		if(current.size() == used.length-1){
			compilation.add(new ArrayList<Integer>(current));
		}else{
			for(int i = 1 ; i < used.length; i++){
				if(!used[i]){
					current.add(i);
					used[i] = true;
					getAllPerms(current, used, compilation);
					used[i] = false;
					current.remove(current.size()-1);
				}
			}
		}
	}

	static void getAllConfigs(List<Integer> current, int n, List<List<Integer>> compilation){
		if(current.size() == n){
			compilation.add(new ArrayList<Integer>(current));
		}else{
			for(int i = 0; i< 3; i++){
				current.add(i);
				getAllConfigs(current, n, compilation);
				current.remove(current.size()-1);
			}
		}
	}

	static boolean [] isComp;

	public static void findConnectedComponents(int[] allNodes){
		int nextIndex = 0;
		for(int vi=1; vi <= n; vi++){
			if(!isComp[vi]){
				int lastnode = dfs(vi);
				List<Integer> h = new ArrayList<Integer>();
				h.add(lastnode);
				Status compStatus = dfsStatus(lastnode, -1, 1, h);
				for(int i = 0; i < compStatus.history.size(); i++){
					allNodes[nextIndex] = compStatus.history.get(i);
					nextIndex++;
				}
			}
		}
	}

	public static Status dfsStatus(int v, int par, int count, List<Integer> history){
		for(int vout : edges[v]){
			if(vout != par && vout != history.get(0)){
				history.add(vout);
				return dfsStatus(vout, v, count+1, history);
			}
		}
		//deadend
		if(count == 1){
			return new Status(false, 1, history);
		}else{
			if(edges[v].contains(history.get(0)) && count != 2){
				//cycle
				return new Status(true, count, history);
			}else{
				//list
				return new Status(false, count, history);
			}
		}
	}

	public static int dfs(int vi){
		isComp[vi] = true;
		boolean dead = true;
		int deadend = -1;
		for(int vout : edges[vi]){
			if(!isComp[vout]){
				dead = false;
				deadend = dfs(vout);
			}
		}
		if(dead){
			return vi;
		}else{
			return deadend;
		}
	}

	static class Status{
		public boolean isCircle;
		public int size;
		public List<Integer> history;

		public Status(boolean isCircle, int size, List<Integer> history) {
			this.isCircle = isCircle;
			this.size = size;
			this.history = history;
		}
	}

	public static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String nextToken() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return isWhitespace(c);
		}

		public static boolean isWhitespace(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

}

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Map;

public class ERedo {
	static StringBuilder sb;
	static List<Integer>[] edges;
	static int m;
	static int n;

	public static void main(String[] args) throws Exception{
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);

		n = in.nextInt();
		m = in.nextInt();

		edges = (List<Integer>[])Array.newInstance(List.class, n+1);
		for(int i = 1 ; i <edges.length; i++){
			edges[i] = new ArrayList<Integer>();
		}

		for(int i = 0; i < m;  i++){
			int a = in.nextInt();
			int b = in.nextInt();
			edges[a].add(b);
			edges[b].add(a);
		}

		if(n <= 6){
			//brute force
			boolean[][] bad = new boolean[n+1][n+1];
			for(int i = 1 ; i<= n; i++){
				for(int j = 1 ; j<= n; j++){
					bad[i][j] = edges[i].contains(j);
				}
			}

			List<List<Integer>> allPerms = new ArrayList<List<Integer>>();
			List<List<Integer>> allConfigs = new ArrayList<List<Integer>>();
			getAllPerms(new ArrayList<Integer>(), new boolean[n+1], allPerms);
			getAllConfigs(new ArrayList<Integer>(), n, allConfigs);

			//every configuration can be expressed as a permutation of nodes, and 3 states:
			final int CONTINUE = 0;
			final int CYCLE = 1;
			final int END = 2;

			StringBuilder ans = null;
			boolean good = false;
			for(List<Integer> perm : allPerms){
				for(List<Integer> config : allConfigs){
					ans = new StringBuilder();
					int numEdges = 0;
					//last start points to index right after last end / cycle
					int lastStart = perm.get(0);
					int lastStartIndex = 0;
					boolean isConfigGood = true;
					for(int i = 0; i < perm.size() && isConfigGood; i++){
						int curNode = perm.get(i);
						switch (config.get(i)){
							case CONTINUE:
								if(i == perm.size()-1){
									isConfigGood = false;
								}else{
									int nextNode = perm.get(i+1);
									if(bad[curNode][nextNode]){
										isConfigGood = false;
									}else{
										ans.append(curNode + " " + nextNode +"\n");
										numEdges++;
									}
								}
								break;
							case CYCLE:
								if(lastStartIndex < 0 || lastStartIndex+1 >= i){
									isConfigGood = false;
								}else{
									if(bad[curNode][lastStart]){
										isConfigGood = false;
									}else{
										ans.append(curNode + " " + lastStart + "\n");
										numEdges++;
										lastStartIndex = i+1;
										if(i < perm.size()-1)
											lastStart = perm.get(i+1);
									}
								}
								break;
							case END:
								lastStartIndex = i+1;
								if(i < perm.size()-1)
									lastStart = perm.get(i+1);
								break;
						}

						if(numEdges == m){
							good = true;
							break;
						}
					}
					if(good)
						break;
				}
				if(good)
					break;
			}

			if(good){
				out.println(ans);
			}else{
				out.println(-1);
			}
			out.close();
			return;
		}else{
			//n>6
			isComp = new boolean[n+1];
			//all the nodes stringed up together
			//note that there is always a way to string all the nodes together
			//each having degree = 2, just interleave in 2's, the only
			//annoying case is if the i+2 % n goes back to the first tail with cycle
			//to remedy this, just swap the last two tails for odd and even. This
			//is always possible since n>6
			int[] allNodes = new int[n];
			findConnectedComponents(allNodes);
			swap(allNodes.length-1, allNodes.length-3, allNodes);
			swap(allNodes.length-2, allNodes.length-4, allNodes);

			StringBuilder ans = new StringBuilder();
			List<Pair> pairs = new ArrayList<Pair>();

			for(int i = 0; i+2 < allNodes.length; i+=2){
				pairs.add(new Pair(allNodes[i],allNodes[i+2]));
			}

			for(int i = 1; i+2 < allNodes.length; i+=2){
				pairs.add(new Pair(allNodes[i],allNodes[i+2]));
			}

			pairs.add(new Pair(allNodes[allNodes.length-1], allNodes[1]));
			pairs.add(new Pair(allNodes[allNodes.length-2], allNodes[0]));

			for(int i = 0; i < m; i++){
				Pair p = pairs.get(i);
				ans.append(p.i1 + " " + p.i2 +" \n");
			}
			out.print(ans);
		}

		out.close();
	}

	static class Pair{
		public int i1;
		public int i2;
		public Pair(int i1, int i2) {
			this.i1 = i1;
			this.i2 = i2;
		}
	}

	static void swap(int i1, int i2, int[] arr){
		int temp = arr[i1];
		arr[i1] = arr[i2];
		arr[i2] = temp;
	}

	static void getAllPerms(List<Integer> current, boolean[] used, List<List<Integer>> compilation){
		if(current.size() == used.length-1){
			compilation.add(new ArrayList<Integer>(current));
		}else{
			for(int i = 1 ; i < used.length; i++){
				if(!used[i]){
					current.add(i);
					used[i] = true;
					getAllPerms(current, used, compilation);
					used[i] = false;
					current.remove(current.size()-1);
				}
			}
		}
	}

	static void getAllConfigs(List<Integer> current, int n, List<List<Integer>> compilation){
		if(current.size() == n){
			compilation.add(new ArrayList<Integer>(current));
		}else{
			for(int i = 0; i< 3; i++){
				current.add(i);
				getAllConfigs(current, n, compilation);
				current.remove(current.size()-1);
			}
		}
	}

	static boolean [] isComp;

	public static void findConnectedComponents(int[] allNodes){
		int nextIndex = 0;
		for(int vi=1; vi <= n; vi++){
			if(!isComp[vi]){
				int lastnode = dfs(vi);
				List<Integer> h = new ArrayList<Integer>();
				h.add(lastnode);
				Status compStatus = dfsStatus(lastnode, -1, 1, h);
				for(int i = 0; i < compStatus.history.size(); i++){
					allNodes[nextIndex] = compStatus.history.get(i);
					nextIndex++;
				}
			}
		}
	}

	public static Status dfsStatus(int v, int par, int count, List<Integer> history){
		for(int vout : edges[v]){
			if(vout != par && vout != history.get(0)){
				history.add(vout);
				return dfsStatus(vout, v, count+1, history);
			}
		}
		//deadend
		if(count == 1){
			return new Status(false, 1, history);
		}else{
			if(edges[v].contains(history.get(0)) && count != 2){
				//cycle
				return new Status(true, count, history);
			}else{
				//list
				return new Status(false, count, history);
			}
		}
	}

	public static int dfs(int vi){
		isComp[vi] = true;
		boolean dead = true;
		int deadend = -1;
		for(int vout : edges[vi]){
			if(!isComp[vout]){
				dead = false;
				deadend = dfs(vout);
			}
		}
		if(dead){
			return vi;
		}else{
			return deadend;
		}
	}

	static class Status{
		public boolean isCircle;
		public int size;
		public List<Integer> history;

		public Status(boolean isCircle, int size, List<Integer> history) {
			this.isCircle = isCircle;
			this.size = size;
			this.history = history;
		}
	}

	public static class InputReader {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		public int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public String nextToken() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			if (filter != null)
				return filter.isSpaceChar(c);
			return isWhitespace(c);
		}

		public static boolean isWhitespace(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public interface SpaceCharFilter {
			public boolean isSpaceChar(int ch);
		}
	}

}

import java.util.List;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

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

class TaskC {
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        int n = in.nextInt();
        int m = in.nextInt();
        int[] p = new int[n];
        for (int i = 0; i < n; i++) {
            p[i] = i;
        }
        long[] edges = new long[m];
        for (int i = 0; i < m; i++) {
            int x = in.nextInt() - 1;
            int y = in.nextInt() -1 ;
            if (x > y) {
                int t = x;
                x = y;
                y = t;
            }
            edges[i] = (long) x * n + y;
        }
        ArrayUtils.sort(edges);
        int IT = 10000000 / n;
        for (int it = 0; it < IT; it++) {
            ArrayUtils.shuffle(p);
            int count = 0;
            for (int i = 0; i < n; i++) {
                int x = p[i];
                int y = p[(i + 1) % n];
                if (x > y) {
                    int t = x;
                    x = y;
                    y = t;
                }
                long ed = (long) x * n + y;
                if (Arrays.binarySearch(edges, ed) < 0) {
                    ++count;
                }
            }
            if (count >= m) {
                count = 0;
                for (int i = 0; count < m && i < n; i++) {
                    int x = p[i];
                    int y = p[(i + 1) % n];
                    if (x > y) {
                        int t = x;
                        x = y;
                        y = t;
                    }
                    long ed = (long) x * n + y;
                    if (Arrays.binarySearch(edges, ed) < 0) {
                        out.println((x + 1) + " " + (y + 1));
                    }
                }
                return;
            }
        }
        out.println(-1);
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}

class ArrayUtils {

    static final long seed = System.nanoTime();

    static final Random rand = new Random(seed);

    public static void shuffle(int[] a) {
        for (int i = 0; i < a.length; i++) {
            int j = rand.nextInt(i + 1);
            int t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    public static void sort(long[] a) {
        shuffle(a);
        Arrays.sort(a);
    }

    public static void shuffle(long[] a) {
        for (int i = 0; i < a.length; i++) {
            int j = rand.nextInt(i + 1);
            long t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    }

import java.util.List;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

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

class TaskC {
    public void solve(int testNumber, FastScanner in, FastPrinter out) {
        int n = in.nextInt();
        int m = in.nextInt();
        int[] p = new int[n];
        for (int i = 0; i < n; i++) {
            p[i] = i;
        }
        long[] edges = new long[m];
        for (int i = 0; i < m; i++) {
            int x = in.nextInt() - 1;
            int y = in.nextInt() -1 ;
            if (x > y) {
                int t = x;
                x = y;
                y = t;
            }
            edges[i] = (long) x * n + y;
        }
        ArrayUtils.sort(edges);
        for (int it = 0; it < 100; it++) {
            ArrayUtils.shuffle(p);
            int count = 0;
            for (int i = 0; i < n; i++) {
                int x = p[i];
                int y = p[(i + 1) % n];
                if (x > y) {
                    int t = x;
                    x = y;
                    y = t;
                }
                long ed = (long) x * n + y;
                if (Arrays.binarySearch(edges, ed) < 0) {
                    ++count;
                }
            }
            if (count >= m) {
                count = 0;
                for (int i = 0; count < m && i < n; i++) {
                    int x = p[i];
                    int y = p[(i + 1) % n];
                    if (x > y) {
                        int t = x;
                        x = y;
                        y = t;
                    }
                    long ed = (long) x * n + y;
                    if (Arrays.binarySearch(edges, ed) < 0) {
                        out.println((x + 1) + " " + (y + 1));
                    }
                }
                return;
            }
        }
        out.println(-1);
    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    }

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}

class ArrayUtils {

    static final long seed = System.nanoTime();

    static final Random rand = new Random(seed);

    public static void shuffle(int[] a) {
        for (int i = 0; i < a.length; i++) {
            int j = rand.nextInt(i + 1);
            int t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    public static void sort(long[] a) {
        shuffle(a);
        Arrays.sort(a);
    }

    public static void shuffle(long[] a) {
        for (int i = 0; i < a.length; i++) {
            int j = rand.nextInt(i + 1);
            long t = a[i];
            a[i] = a[j];
            a[j] = t;
        }
    }

    }

import java.io.*;
import java.util.*;

public class C {

	static void solve() throws IOException {
		int n = nextInt(), edgesCount = nextInt();
		@SuppressWarnings("unchecked")
		List<Integer>[] edges = new List[n];
		for (int i = 0; i < n; i++) {
			edges[i] = new ArrayList<>(2);
		}
		for (int i = 0; i < edgesCount; i++) {
			int u = nextInt() - 1, v = nextInt() - 1;
			edges[u].add(v);
			edges[v].add(u);
		}

		if (edgesCount <= n - 2) {
			int start = 0;
			for (int i = 0; i < n; i++) {
				if (edges[i].size() < edges[start].size()) {
					start = i;
				}
			}
			int current = start;
			Queue<Integer> free = new ArrayDeque<>();
			for (int i = 0; i < n; i++) {
				if (i != start) {
					free.add(i);
				}
			}
			for (int i = 0; i < edgesCount - 1; i++) {
				int next = -1;
				while (true) {
					Integer to = free.poll();
					if (!edges[current].contains(to)) {
						next = to;
						break;
					} else {
						free.add(to);
					}
				}
				out.println((current + 1) + " " + (next + 1));
				current = next;
			}
			for (Integer to : free) {
				if (!edges[start].contains(to)) {
					out.println((start + 1) + " " + (to + 1));
				}
			}
			return;
		}

		if (edgesCount == n - 1) {
			if (n == 3) {
				out.println(-1);
				return;
			}
			if (n == 4) {
				for (int u = 0; u < n; u++) {
					if (edges[u].size() == 0) {
						out.println(-1);
						return;
					}
				}
				for (int i = 0; i < n; i++) {
					for (int j = i + 1; j < n; j++) {
						if (!edges[i].contains(j)) {
							out.println((i + 1) + " " + (j + 1));
						}
					}
				}
				return;
			}
			for (int u = 0; u < n; u++) {
				if (edges[u].size() == 0) {
					boolean[] was = new boolean[n];
					was[u] = true;
					List<List<Integer>> cycles = getCycles(n, edges, was);
					if (n > 5) {
						output(solveForCycles(cycles));
					} else {
						List<Integer> list = cycles.get(0);
						out.println((list.get(2) + 1) + " " + (list.get(0) + 1));
						out.println((list.get(0) + 1) + " " + (u + 1));
						out.println((u + 1) + " " + (list.get(1) + 1));
						out.println((list.get(1) + 1) + " " + (list.get(3) + 1));
						return;
					}
				}
			}
			for (int u = 0; u < n; u++) {
				if (edges[u].size() == 1) {
					for (int v = u + 1; v < n; v++) {
						if (edges[v].size() == 1) {
							if (!edges[u].contains(v)) {
								edges[u].add(v);
								edges[v].add(u);
								++edgesCount;
								solveForGraphOfCycles(n, edges);
								return;
							} else {
								if (n == 5) {
									List<Integer> notij = new ArrayList<>();
									for (int k = 0; k < 5; k++) {
										if (k != u && k != v) {
											notij.add(k);
										}
									}
									out.println((notij.get(0) + 1) + " "
											+ (u + 1));
									out.println((u + 1) + " "
											+ (notij.get(1) + 1));
									out.println((notij.get(1) + 1) + " "
											+ (v + 1));
									out.println((v + 1) + " "
											+ (notij.get(2) + 1));
									return;
								} else {
									boolean[] was = new boolean[n];
									was[u] = was[v] = true;
									List<List<Integer>> cycles = getCycles(n,
											edges, was);
									List<Integer> answer = solveForCycles(cycles);
									answer.add(u);
									output(answer);
									return;
								}
							}
						}
					}
				}
			}
		}

		if (n < 5) {
			out.println(-1);
			return;
		} else {
			solveForGraphOfCycles(n, edges);
		}
	}

	private static void solveForGraphOfCycles(int n, List<Integer>[] edges) {
		boolean[] was = new boolean[n];
		List<List<Integer>> cycles = getCycles(n, edges, was);
		List<Integer> answer = solveForCycles(cycles);
		output(answer);
	}

	private static List<List<Integer>> getCycles(int n, List<Integer>[] edges,
			boolean[] was) {
		List<List<Integer>> cycles = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			if (was[i]) {
				continue;
			}
			List<Integer> curCycle = new ArrayList<>();
			curCycle.add(i);
			was[i] = true;
			int prev = i;
			int cur = edges[i].get(0);
			while (!was[cur]) {
				curCycle.add(cur);
				was[cur] = true;
				int next = edges[cur].get(0) ^ edges[cur].get(1) ^ prev;
				prev = cur;
				cur = next;
			}
			cycles.add(curCycle);
		}
		return cycles;
	}

	private static List<Integer> solveForCycles(List<List<Integer>> cycles) {
		int maxCycle = 0;
		for (int i = 0; i < cycles.size(); i++) {
			if (cycles.get(i).size() > cycles.get(maxCycle).size()) {
				maxCycle = i;
			}
		}
		List<Integer> what = cycles.remove(maxCycle);
		if (what.size() >= 5) {
			LinkedList<Integer> answer = new LinkedList<Integer>(
					reorderCycle(what));
			for (List<Integer> list : cycles) {
				insertListToAnswer(answer, list);
			}
			return (answer);
		} else {
			List<Integer> list1 = what;
			List<Integer> list2 = cycles.remove(cycles.size() - 1);
			LinkedList<Integer> answer = new LinkedList<>(uniteTwoSmall(list1,
					list2));
			for (List<Integer> list : cycles) {
				insertListToAnswer(answer, list);
			}
			return (answer);
		}
	}

	private static List<Integer> uniteTwoSmall(List<Integer> list1,
			List<Integer> list2) {
		List<Integer> result = new ArrayList<>();
		if (list1.size() == list2.size()) {
			for (int i = 0; i < list1.size(); i++) {
				result.add(list1.get(i));
				result.add(list2.get(i));
			}
		} else {
			if (list1.size() > list2.size()) {
				List<Integer> t = list1;
				list1 = list2;
				list2 = t;
			}
			if (list1.size() != 3 || list2.size() != 4) {
				throw new AssertionError();
			}
			result.add(list2.get(0));
			result.add(list1.get(0));
			result.add(list2.get(1));
			result.add(list1.get(1));
			result.add(list2.get(3));
			result.add(list1.get(2));
			result.add(list2.get(2));
		}
		return result;
	}

	private static void output(List<Integer> cycle) {
		Iterator<Integer> it = cycle.iterator();
		int first = it.next();
		int current = first;
		while (it.hasNext()) {
			int next = it.next();
			out.println((current + 1) + " " + (next + 1));
			current = next;
		}
		out.println((current + 1) + " " + (first + 1));
	}

	private static void outputPath(List<Integer> path) {
		Iterator<Integer> it = path.iterator();
		int first = it.next();
		int current = first;
		while (it.hasNext()) {
			int next = it.next();
			out.println((current + 1) + " " + (next + 1));
			current = next;
		}
	}

	private static void insertListToAnswer(LinkedList<Integer> answer,
			List<Integer> list) {
		ListIterator<Integer> it = answer.listIterator();
		for (Integer value : list) {
			it.add(value);
			it.next();
		}
	}

	private static List<Integer> reorderCycle(List<Integer> what) {
		if (what.size() == 6) {
			List<Integer> result = new ArrayList<>();
			result.add(what.get(0));
			result.add(what.get(3));
			result.add(what.get(1));
			result.add(what.get(5));
			result.add(what.get(2));
			result.add(what.get(4));
			return result;
		} else {
			int okStep = -1;
			for (int step = 2; step < what.size() - 1; step++) {
				if (gcd(what.size(), step) == 1) {
					okStep = step;
					break;
				}
			}
			if (okStep < 0) {
				throw new AssertionError();
			}
			List<Integer> result = new ArrayList<>();
			result.add(what.get(0));
			int pos = okStep;
			while (pos != 0) {
				result.add(what.get(pos));
				pos += okStep;
				if (pos >= what.size()) {
					pos -= what.size();
				}
			}
			return result;
		}
	}

	static int gcd(int a, int b) {
		while (a > 0 && b > 0) {
			if (a > b) {
				a %= b;
			} else {
				b %= a;
			}
		}
		return a | b;
	}

	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter out;

	public static void main(String[] args) throws IOException {
		InputStream input = System.in;
		PrintStream output = System.out;
		File file = new File("c.in");
		if (file.exists() && file.canRead()) {
			input = new FileInputStream(file);
		}
		br = new BufferedReader(new InputStreamReader(input));
		out = new PrintWriter(output);
		solve();
		out.close();
	}

	static long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	static String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return null;
			}
			st = new StringTokenizer(line);
		}
		return st.nextToken();
	}
}

import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Reader;
import java.io.InputStream;

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

class TaskC {
    public void solve(int testNumber, InputStreamReader inSt, PrintWriter out) {
        InputReader in = new InputReader(inSt);
        int n = in.nextInt();
        int m = in.nextInt();
        int[][] g = new int[n][2];
        for (int i = 0; i < n; i++) {
            g[i][0] = -1;
            g[i][1] = -1;
        }
        for (int i = 0; i < m; i++) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            if (g[a][0] >= 0) {
                g[a][1] = b;
            } else {
                g[a][0] = b;
            }

            if (g[b][0] >= 0) {
                g[b][1] = b;
            } else {
                g[b][0] = b;
            }
        }
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = i;
        }

        for (int i = 0; i < 20; i++) {
            shuffle(arr);
            boolean isOk = true;
            for (int j = 0; j < n; j++) {
                for (int k = 0; k < 2; k++) {
                    if (g[j][k] < 0) {
                        continue;
                    }
                    int from = arr[j];
                    int to = arr[g[j][k]];
                    if (g[from][0] == to || g[from][1] == to) {
                        isOk = false;
                        break;
                    }
                }
                if (!isOk) {
                    break;
                }
            }
            if (isOk) {
                for (int j = 0; j < n; j++) {
                    for (int k = 0; k < 2; k++) {
                        if (g[j][k] > 0) {
                            if (g[j][k] > j) {
                                int from = arr[j];
                                int to = arr[g[j][k]];

                                out.println((from + 1) + " " + (to + 1));
                            }
                        }
                    }
                }
                return;
            }

        }
        out.println(-1);
    }

    private void shuffle(int[] arr) {
        Random random = new Random();
        for (int i = 0; i < arr.length; i++) {
            int j = i + random.nextInt(arr.length - i);

            int tmp = arr[i];
            arr[i] = arr[j];
            arr[j] = tmp;
        }
    }

    class InputReader {
        public BufferedReader reader;
        private String[] currentArray;
        int curPointer;

        public InputReader(InputStreamReader inputStreamReader) {
            reader = new BufferedReader(inputStreamReader);
        }

        public String next() {
            try {
                currentArray = null;
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public void nextChars(char[] t) {
            try {
                currentArray = null;
                reader.read(t);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public char nextChar() {
            try {
                currentArray = null;
                return (char) reader.read();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            if ((currentArray == null) || (curPointer >= currentArray.length)) {
                try {
                    currentArray = reader.readLine().split(" ");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                curPointer = 0;
            }
            return Integer.parseInt(currentArray[curPointer++]);
        }

        public long nextLong() {
            if ((currentArray == null) || (curPointer >= currentArray.length)) {
                try {
                    currentArray = reader.readLine().split(" ");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                curPointer = 0;
            }
            return Long.parseLong(currentArray[curPointer++]);
        }

    }
}

import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Random;
import java.io.Reader;
import java.io.InputStream;

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

class TaskC {
    public void solve(int testNumber, InputStreamReader inSt, PrintWriter out) {
        InputReader in = new InputReader(inSt);
        int n = in.nextInt();
        int m = in.nextInt();
        int[][] g = new int[n][2];
        for (int i = 0; i < n; i++) {
            g[i][0] = -1;
            g[i][1] = -1;
        }
        for (int i = 0; i < m; i++) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            if (g[a][0] >= 0) {
                g[a][1] = b;
            } else {
                g[a][0] = b;
            }

            if (g[b][0] >= 0) {
                g[b][1] = a;
            } else {
                g[b][0] = a;
            }
        }
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = i;
        }

        for (int i = 0; i < 20; i++) {
            shuffle(arr);
            boolean isOk = true;
            for (int j = 0; j < n; j++) {
                for (int k = 0; k < 2; k++) {
                    if (g[j][k] < 0) {
                        continue;
                    }
                    int from = arr[j];
                    int to = arr[g[j][k]];
                    if (g[from][0] == to || g[from][1] == to) {
                        isOk = false;
                        break;
                    }
                }
                if (!isOk) {
                    break;
                }
            }
            if (isOk) {
                for (int j = 0; j < n; j++) {
                    for (int k = 0; k < 2; k++) {
                        if (g[j][k] > 0) {
                            if (g[j][k] > j) {
                                int from = arr[j];
                                int to = arr[g[j][k]];

                                out.println((from + 1) + " " + (to + 1));
                            }
                        }
                    }
                }
                return;
            }

        }
        out.println(-1);
    }

    private void shuffle(int[] arr) {
        Random random = new Random();
        for (int i = 0; i < arr.length; i++) {
            int j = i + random.nextInt(arr.length - i);

            int tmp = arr[i];
            arr[i] = arr[j];
            arr[j] = tmp;
        }
    }

    class InputReader {
        public BufferedReader reader;
        private String[] currentArray;
        int curPointer;

        public InputReader(InputStreamReader inputStreamReader) {
            reader = new BufferedReader(inputStreamReader);
        }

        public String next() {
            try {
                currentArray = null;
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public void nextChars(char[] t) {
            try {
                currentArray = null;
                reader.read(t);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public char nextChar() {
            try {
                currentArray = null;
                return (char) reader.read();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }

        public int nextInt() {
            if ((currentArray == null) || (curPointer >= currentArray.length)) {
                try {
                    currentArray = reader.readLine().split(" ");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                curPointer = 0;
            }
            return Integer.parseInt(currentArray[curPointer++]);
        }

        public long nextLong() {
            if ((currentArray == null) || (curPointer >= currentArray.length)) {
                try {
                    currentArray = reader.readLine().split(" ");
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                curPointer = 0;
            }
            return Long.parseLong(currentArray[curPointer++]);
        }

    }
}

import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskC {
    int[][] adj;
    int[] nadj;
    int[] seq;
    int[] deg;
    long finish;
    int checkEach;
    boolean timeOver;
    PrintWriter out;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        this.out = out;
        long start = System.currentTimeMillis();
        int nodes = in.nextInt();
        int edges = in.nextInt();
        adj = new int[nodes][2];
        for (int[] x : adj) Arrays.fill(x, -1);
        nadj = new int[nodes];
        for (int i = 0; i < edges; ++i) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            adj[a][nadj[a]++] = b;
            adj[b][nadj[b]++] = a;
        }
        Random random = new Random(5346543531L + System.currentTimeMillis());
        seq = new int[nodes];
        deg = new int[nodes];
        for (int attempt = 0; attempt < 10; ++attempt) {
            finish = start + (attempt + 1) * 200;
            checkEach = 0;
            timeOver = false;
            for (int i = 0; i < nodes; ++i) {
                seq[i] = i;
            }
            for (int i = 0; i < nodes; ++i) {
                int j = i + random.nextInt(nodes - i);
                int tmp = seq[i];
                seq[i] = seq[j];
                seq[j] = tmp;
            }
            Arrays.fill(deg, 0);
            if (rec(0, edges)) return;
        }
        out.println(-1);
    }

    private boolean rec(int at, int edges) {
        if (edges == 0) {
            return true;
        }
        if (at >= seq.length) return false;
        --checkEach;
        if (checkEach < 0) {
            if (System.currentTimeMillis() > finish) timeOver = true;
            checkEach = 1000000;
        }
        if (timeOver) return false;
        int v = seq[at];
        if (deg[v] == 0 && edges >= 2) {
            for (int dest = at + 1; dest < seq.length; ++dest) {
                int vv = seq[dest];
                if (adj[v][0] == vv || adj[v][1] == vv) continue;
                ++deg[v];
                ++deg[vv];
                for (int d2 = seq.length - 1; d2 > dest; --d2) {
                    int vvv = seq[d2];
                    if (adj[v][0] == vvv || adj[v][1] == vvv) continue;
                    ++deg[v];
                    ++deg[vvv];
                    if (rec(at + 1, edges - 2)) {
                        out.println((v + 1) + " " + (vv + 1));
                        out.println((v + 1) + " " + (vvv + 1));
                        return true;
                    }
                    if (timeOver) return false;
                    --deg[v];
                    --deg[vvv];
                }
                if (timeOver) return false;
                --deg[v];
                --deg[vv];
            }
        }
        if (deg[v] < 2) {
            for (int dest = at + 1; dest < seq.length; ++dest) {
                int vv = seq[dest];
                if (adj[v][0] == vv || adj[v][1] == vv) continue;
                ++deg[v];
                ++deg[vv];
                if (rec(at + 1, edges - 1)) {
                    out.println((v + 1) + " " + (vv + 1));
                    return true;
                }
                if (timeOver) return false;
                --deg[v];
                --deg[vv];
            }
        }
        return rec(at + 1, edges);
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

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

    }

import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskC {
    int[][] adj;
    int[] nadj;
    int[] seq;
    int[] deg;
    long finish;
    int checkEach;
    boolean timeOver;
    PrintWriter out;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        this.out = out;
        long start = System.currentTimeMillis();
        int nodes = in.nextInt();
        int edges = in.nextInt();
        adj = new int[nodes][2];
        for (int[] x : adj) Arrays.fill(x, -1);
        nadj = new int[nodes];
        for (int i = 0; i < edges; ++i) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            adj[a][nadj[a]++] = b;
            adj[b][nadj[b]++] = a;
        }
        Random random = new Random(5346543531L + System.currentTimeMillis());
        seq = new int[nodes];
        deg = new int[nodes];
        for (int attempt = 0; attempt < 10; ++attempt) {
            finish = start + (attempt + 1) * 200;
            checkEach = 10000000;
            timeOver = false;
            for (int i = 0; i < nodes; ++i) {
                seq[i] = i;
            }
            for (int i = 0; i < nodes; ++i) {
                int j = i + random.nextInt(nodes - i);
                int tmp = seq[i];
                seq[i] = seq[j];
                seq[j] = tmp;
            }
            Arrays.fill(deg, 0);
            if (rec(0, edges)) return;
        }
        out.println(-1);
    }

    private boolean rec(int at, int edges) {
        if (edges == 0) {
            return true;
        }
        if (at >= seq.length) return false;
        --checkEach;
        if (checkEach < 0) {
            /*if (System.currentTimeMillis() > finish) timeOver = true;*/
            timeOver = true;
            checkEach = 1000000;
        }
        if (timeOver) return false;
        int v = seq[at];
        if (deg[v] == 0 && edges >= 2) {
            for (int dest = at + 1; dest < seq.length; ++dest) {
                int vv = seq[dest];
                if (adj[v][0] == vv || adj[v][1] == vv) continue;
                ++deg[v];
                ++deg[vv];
                for (int d2 = dest + 1; d2 < seq.length; ++d2) {
                    int vvv = seq[d2];
                    if (adj[v][0] == vvv || adj[v][1] == vvv) continue;
                    ++deg[v];
                    ++deg[vvv];
                    if (rec(at + 1, edges - 2)) {
                        out.println((v + 1) + " " + (vv + 1));
                        out.println((v + 1) + " " + (vvv + 1));
                        return true;
                    }
                    if (timeOver) return false;
                    --deg[v];
                    --deg[vvv];
                }
                if (timeOver) return false;
                --deg[v];
                --deg[vv];
            }
        }
        if (deg[v] < 2) {
            for (int dest = at + 1; dest < seq.length; ++dest) {
                int vv = seq[dest];
                if (adj[v][0] == vv || adj[v][1] == vv) continue;
                ++deg[v];
                ++deg[vv];
                if (rec(at + 1, edges - 1)) {
                    out.println((v + 1) + " " + (vv + 1));
                    return true;
                }
                if (timeOver) return false;
                --deg[v];
                --deg[vv];
            }
        }
        return rec(at + 1, edges);
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

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

    }

import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskC {
    int[][] adj;
    int[] nadj;
    int[] seq;
    int[] deg;
    long finish;
    int checkEach;
    boolean timeOver;
    PrintWriter out;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        this.out = out;
        long start = System.currentTimeMillis();
        int nodes = in.nextInt();
        int edges = in.nextInt();
        adj = new int[nodes][2];
        for (int[] x : adj) Arrays.fill(x, -1);
        nadj = new int[nodes];
        for (int i = 0; i < edges; ++i) {
            int a = in.nextInt() - 1;
            int b = in.nextInt() - 1;
            adj[a][nadj[a]++] = b;
            adj[b][nadj[b]++] = a;
        }
        Random random = new Random(5346543531L + System.currentTimeMillis());
        seq = new int[nodes];
        deg = new int[nodes];
        for (int attempt = 0; attempt < 10; ++attempt) {
            finish = start + (attempt + 1) * 200;
            checkEach = 10000000;
            timeOver = false;
            for (int i = 0; i < nodes; ++i) {
                seq[i] = i;
            }
            for (int i = 0; i < nodes; ++i) {
                int j = i + random.nextInt(nodes - i);
                int tmp = seq[i];
                seq[i] = seq[j];
                seq[j] = tmp;
            }
            Arrays.fill(deg, 0);
            if (rec(0, edges)) return;
        }
        out.println(-1);
    }

    private boolean rec(int at, int edges) {
        if (edges == 0) {
            return true;
        }
        if (at >= seq.length) return false;
        --checkEach;
        if (checkEach < 0) {
            /*if (System.currentTimeMillis() > finish) timeOver = true;*/
            timeOver = true;
            checkEach = 1000000;
        }
        if (timeOver) return false;
        int v = seq[at];
        if (deg[v] == 0 && edges >= 2) {
            for (int dest = at + 1; dest < seq.length; ++dest) {
                int vv = seq[dest];
                if (adj[v][0] == vv || adj[v][1] == vv) continue;
                ++deg[v];
                ++deg[vv];
                for (int d2 = seq.length - 1; d2 > dest; --d2) {
                    int vvv = seq[d2];
                    if (adj[v][0] == vvv || adj[v][1] == vvv) continue;
                    ++deg[v];
                    ++deg[vvv];
                    if (rec(at + 1, edges - 2)) {
                        out.println((v + 1) + " " + (vv + 1));
                        out.println((v + 1) + " " + (vvv + 1));
                        return true;
                    }
                    if (timeOver) return false;
                    --deg[v];
                    --deg[vvv];
                }
                if (timeOver) return false;
                --deg[v];
                --deg[vv];
            }
        }
        if (deg[v] < 2) {
            for (int dest = at + 1; dest < seq.length; ++dest) {
                int vv = seq[dest];
                if (adj[v][0] == vv || adj[v][1] == vv) continue;
                ++deg[v];
                ++deg[vv];
                if (rec(at + 1, edges - 1)) {
                    out.println((v + 1) + " " + (vv + 1));
                    return true;
                }
                if (timeOver) return false;
                --deg[v];
                --deg[vv];
            }
        }
        return rec(at + 1, edges);
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

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

    }

import java.util.*;
import java.io.*;
public class a {
    static long mod = 1000000007;
public static void main(String[] args) throws IOException
{
    //Scanner input = new Scanner(new File("input.txt"));
    //PrintWriter out = new PrintWriter(new File("output.txt"));

  input.init(System.in);
  PrintWriter out  = new PrintWriter((System.out));

  int n = input.nextInt(), m = input.nextInt();
  ArrayList<Integer>[] g = new ArrayList[n];
  for(int i = 0; i<n; i++) g[i] = new ArrayList<Integer>();
  for(int i = 0; i<m; i++)
  {
      int a = input.nextInt()-1, b = input.nextInt()-1;
      g[a].add(b);
      g[b].add(a);
  }
  int[] data = new int[n];
  for(int i = 0; i<n; i++) data[i] = i;
  Random r = new Random();
  boolean found = false;
  for(int i = 0; i<10000000/n; i++)
  {
      for(int j = 0; j<n; j++)
      {
          int a = r.nextInt(n), b = r.nextInt(n);
          int temp = data[a];
          data[a] = data[b];
          data[b] = temp;
      }
      int count = 0;
      boolean[] valid = new boolean[n];
      for(int j =0; j<n; j++)
      {
          int to = data[j], from = data[((j+1)%n)];
          if(!g[to].contains(from))
          {
              valid[j] = true;
              count++;
          }
      }
      if(count < m) continue;
      found = true;
      int x = 0;
      for(int j = 0; j<n; j++)
      {
          if(valid[j]&& x<count) {x++;out.println((data[j]+1)+" "+(data[(j+1)%n]+1));}
      }

      break;
  }
  if(!found) out.println(-1);
  out.close();
}
public static long[] gcd(long p, long q)
{
    if(q==0)
        return new long[] {p, 1, 0};
    long[] vals = gcd(q, p%q);
    return new long[] {vals[0], vals[2], vals[1] - (p/q)*vals[2]};
}
static long pow (long a, long p)
{
    if(p==0) return 1;
    if((p&1) == 0)
    {
        long sqrt = pow(a, p/2);
        return (sqrt*sqrt)%mod;
    }
    return (a*pow(a,p-1))%mod;
}
static class input {
  static BufferedReader reader;
  static StringTokenizer tokenizer;

  /** call this method to initialize reader for InputStream */
  static void init(InputStream input) {
      reader = new BufferedReader(
                   new InputStreamReader(input) );
      tokenizer = new StringTokenizer("");
  }

  /** get next word */
  static String next() throws IOException {
      while ( ! tokenizer.hasMoreTokens() ) {
          //TODO add check for eof if necessary
          tokenizer = new StringTokenizer(
                 reader.readLine() );
      }
      return tokenizer.nextToken();
  }

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

  static double nextDouble() throws IOException {
      return Double.parseDouble( next() );
  }
  static long nextLong() throws IOException {
      return Long.parseLong( next() );
  }
  static String nextLine() throws IOException {
    return reader.readLine();
  }
}
public static int oo = 987654321;
public static ArrayList<Integer>[] g;
public static int a, b, x;
public static int [] match, dist;
public static boolean bfs()
{
    Queue<Integer> q = new LinkedList<Integer>();
    for(int i=0; i<a; i++)
    {
        if(match[i]==-1)
        {
            dist[i] = 0;
            q.add(i);
        }
        else dist[i] = oo;
    }
    boolean found = false;
    while(!q.isEmpty())
    {
        int u = q.poll();
        if(u!=-1)
        {
            int len = g[u].size();
            for(int i=0; i<len; i++)
            {
                int v = g[u].get(i);
                if(match[v] == -1)
                {
                    found = true;
                    x = dist[u] + 1;
                }
                else if(dist[match[v]]==oo)
                {
                    dist[match[v]] = dist[u] + 1;
                    q.add(match[v]);
                }
            }
        }
    }
    return found;
}

public static boolean dfs(int u)
{
    if(u==-1)
        return true;
    for(int i=0; i<g[u].size(); i++)
    {
        int v = g[u].get(i);
        int d = match[v] > -1 ? dist[match[v]] : x;
        if(d==dist[u]+1 && dfs(match[v]))
        {
            match[v] = u;
            match[u] = v;
            return true;
        }
    }
    dist[u] = oo;
    return false;
}
public static int hopcroft_karp(int n, int m)
{
    a = n; b = m;
    int res = 0;
    match = new int[a+b];
    dist = new int[a+b];
    Arrays.fill(match, -1);
    while(bfs())
        for(int i=0; i<a; i++)
            if(match[i]==-1 && dfs(i))
                res++;
    return res;
}
}

//package round192;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class C {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int n = ni(), m = ni();
		int[] from = new int[m];
		int[] to = new int[m];
		for(int i = 0;i < m;i++){
			from[i] = ni()-1; to[i] = ni()-1;
		}

		int[][] g = packU(n, from, to);
		if(n < 6){
			int all = n*(n-1)/2;

			// (i,j)=(i,i+1+k)
			// n-1 ,.., n-1-i+1
			// (2n-2-i+1)/2*i+j-(i+1)
			int ng = 0;
			for(int i = 0;i < n;i++){
				for(int j : g[i]){
					if(i < j){
						ng |= 1<<(2*n-2-i+1)*i/2+j-(i+1);
					}
				}
			}
			for(int i = 0;i < 1<<all;i++){
				if((i&ng)==0 && Integer.bitCount(i) == m){
					int r = 0, c = 1;
					for(int j = 0;j < all;j++){
						if(i<<31-j<0){
							out.println((r+1) + " " + (c+1));
						}
						c++;
						if(c >= n){
							r++;
							c = r+1;
						}
					}
					return;
				}
			}
			out.println(-1);
		}else{
			for(int[] v : g){
				Arrays.sort(v);
			}
			int[] path = new int[n];
			boolean[] used = new boolean[n];
			path[0] = 0;
			used[0] = true;
			int[] rem = new int[n-1];
			for(int i = 1;i < n;i++)rem[i-1] = i;
			outer:
			for(int i = 1;i < n;i++){
				for(int j = 0;j < n-i;j++){
					if(Arrays.binarySearch(g[path[i-1]], rem[j]) < 0){
						path[i] = rem[j];
						rem[j] = rem[n-i-1];
						continue outer;
					}
				}

				// on
				for(int j = 1;j < i;j++){
					if(
							Arrays.binarySearch(g[rem[0]], path[j]) < 0 &&
							Arrays.binarySearch(g[path[j-1]], path[i-1]) < 0
							){
						for(int k = j, l = i-1;k < l;k++,l--){
							int d = path[k]; path[k] = path[l]; path[l] = d;
						}
						path[i] = rem[0];
						rem[0] = rem[n-i-1];
						continue outer;
					}
				}

				throw new AssertionError();
			}

			for(int i = 0;i < n-1;i++){
				if(
						Arrays.binarySearch(g[path[n-1]], path[i]) < 0 &&
						Arrays.binarySearch(g[path[0]], path[i+1]) < 0
						){
					for(int k = i+1, l = n-1;k < l;k++,l--){
						int d = path[k]; path[k] = path[l]; path[l] = d;
					}
					break;
				}
			}
			if(m == n){
				for(int i = 0;i < n;i++){
					out.println((path[i]+1) + " " + (path[(i+1)%n]+1));
				}
			}else{
				for(int i = 0;i < m;i++){
					out.println((path[i]+1) + " " + (path[i+1]+1));
				}
			}
		}
	}

	static int[][] packU(int n, int[] from, int[] to) {
		int[][] g = new int[n][];
		int[] p = new int[n];
		for(int f : from)
			p[f]++;
		for(int t : to)
			p[t]++;
		for(int i = 0;i < n;i++)
			g[i] = new int[p[i]];
		for(int i = 0;i < from.length;i++){
			g[from[i]][--p[from[i]]] = to[i];
			g[to[i]][--p[to[i]]] = from[i];
		}
		return g;
	}

	void run() throws Exception
	{
//		int n = 100000, m = 100000;
//		Random gen = new Random();
//		StringBuilder sb = new StringBuilder();
//		sb.append(n + " ");
//		sb.append(n + " ");
//		for(int i = 0;i < n;i++){
//			sb.append(gen.nextInt(100000)+1 + " ");
//			sb.append(gen.nextInt(100000)+1 + " ");
//		}
//		INPUT = sb.toString();
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new C().run(); }

	private byte[] inbuf = new byte[1024];
	private int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}