import java.util.*

class Edge(a: Int, b: Int, num: Int) {
    var a = a
    var b = b
    var num = num

}

class Connection(node: Int, num: Int) {
    val node = node
    val num = num
}

fun tra(node: Int, save: Array<Int>, children: Array<MutableList<Int>>): Int {
    for (i in children[node]) {
        save[node] += tra(i, save, children)
    }
    return save[node]
}

fun main(args: Array<String>){
	val cin = Scanner(System.`in`)
    val n = cin.nextInt()
    val m = cin.nextInt()

    val connect = Array<MutableList<Int>>(n, {mutableListOf()})
    val edges = Array<Edge>(m, { i -> Edge(cin.nextInt() - 1, cin.nextInt() - 1, i)})

    if (m % 2 == 1) {
        println(-1)
        return
    }

    for (i in 0..m-1) {
        val a = edges[i].a
        val b = edges[i].b
        connect[a].add(b)
        connect[b].add(a)
    }

    val queue: MutableList<Int> = mutableListOf(0)
    val parent = Array<Int>(n, { -1 })
    val save = Array<Int>(n, { 0 })
    val exist = Array<Boolean>(n, { false })
    val children = Array<MutableList<Int>>(n, { mutableListOf()})
    exist[0] = true

    while (queue.size != 0) {
        val now = queue.removeAt(0)
        for (c in connect[now]) {
            if (c != parent[now] && (c > now || exist[c] == false)) {
                save[now] += 1
                if (exist[c] == false) {
                    parent[c] = now
                    children[now].add(c)
                    exist[c] = true
                    queue.add(c)
                }
            }
        }
    }

    tra(0, save, children)

    for (e in edges) {
        if (parent[e.a] == e.b) {
            if (save[e.a] % 2 == 0) {
                print(e.b+1)
                print(" ")
                println(e.a+1)
            } else {
                print(e.a+1)
                print(" ")
                println(e.b+1)
            }
        } else if (parent[e.b] == e.a) {
            if (save[e.b] % 2 == 0) {
                print(e.a+1)
                print(" ")
                println(e.b+1)
            } else {
                print(e.b+1)
                print(" ")
                println(e.a+1)
            }
        } else {
            if (e.a > e.b) {
                print(e.b+1)
                print(" ")
                println(e.a+1)
            } else {
                print(e.a+1)
                print(" ")
                println(e.b+1)
            }
        }
    }
}