data class Edge(var a: Int, var b: Int) {
    constructor(v: List<Int>): this(v[0], v[1])
}
fun tra(node: Int, save: Array<Int>, children: Array<MutableList<Int>>): Int {
    children[node].forEach { save[node] += tra(it, save, children) }
    return save[node]
}

fun main(args: Array<String>){
    val (N, M) = listOfInt()
    val connect = Array<MutableList<Int>>(N, {mutableListOf()})
    val edges = Array<Edge>(M, { it -> Edge(listOfInt(-1))})
    if (M % 2 == 1) { println(-1); return }

    for (n in 0 until M) {
        val a = edges[n].a
        val b = edges[n].b
        connect[a].add(b)
        connect[b].add(a)
    }

    val queue = mutableListOf<Int>(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])) {
                save[now] += 1
                if (!exist[c]) {
                    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) {
                println("${e.b+1} ${e.a+1}")
            } else {
                println("${e.a+1} ${e.b+1}")
            }
        } else if (parent[e.b] == e.a) {
            if (save[e.b] % 2 == 0) {
                println("${e.a+1} ${e.b+1}")
            } else {
                println("${e.b+1} ${e.a+1}")
            }
        } else {
            if (e.a > e.b) {
                println("${e.b+1} ${e.a+1}")
            } else {
                println("${e.a+1} ${e.b+1}")
            }
        }
    }
}
fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt(delta: Int = 0) = listOfString().map { Integer.parseInt(it) + delta }
