#include <bits/stdc++.h>
#define LOCAL
using std::to_string;
auto to_string(std::string s) -> std::string {
  return '"' + s + '"';
}
auto to_string(char c) -> std::string {
  return "'" + std::string{c} + "'";
}
auto to_string(const char* s) -> std::string {
  return to_string((std::string) s);
}
auto to_string(bool b) -> std::string {
  return (b ? "true" : "false");
}
template <typename T, typename U>
auto to_string(std::pair<T, U> p) -> std::string {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <int N>
auto to_string(std::bitset<N> bs) -> std::string {
  std::string res{};
  for (int i = 0; i < N; i++)
    res.insert(res.begin(), bs.test(i) ? '1' : '0');
  return res;
}
template <typename T>
auto to_string(T v) -> std::string {
  bool flg = false;
  std::string res = "{";
  for (auto const&x : v) {
    if (flg) res += ", ";
    else flg = true;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  std::cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) std::cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
template<typename T>
class fixed_point : T {
  public:
    explicit constexpr fixed_point (T&& t) noexcept
      : T(std::forward<T>(t)) {}
    template<typename... Args>
    constexpr decltype(auto) operator()(Args&&... args) const
      {return T::operator()(*this, std::forward<Args>(args)...);}
};
template<typename T>
static inline constexpr decltype(auto) fix (T&& t) noexcept {
  return fixed_point<T>{std::forward<T>(t)};
}
int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  int n, m; std::cin >> n >> m;
  auto err = [&] {
    std::cout << -1 << std::endl;
    exit(0);
  };
  if (m % 2 == 1) err();
  std::vector<std::vector<int>> graph(n);
  std::vector<int> out_deg(n, 0);
  for (int _ = 0; _ < m; _++) {
    int a, b; std::cin >> a >> b;
    a--, b--;
    graph.at(a).push_back(b);
    graph.at(b).push_back(a);
  }
  std::vector<int> ckd(n, false);
  std::vector<std::vector<int>> tree(n);
  std::vector<std::pair<int, int>> ret;
  auto insert = [&] (int a, int b) {
    ret.emplace_back(a, b);
  };
  constexpr int root = 0;
  fix ([&](auto dfs, int crr, int p) -> void {
    ckd.at(crr) = true;
    for (auto const& nxt : graph.at(crr)) {
      if (nxt == p) continue;
      if (ckd.at(nxt)) {
        if (crr < nxt) {
          out_deg.at(crr)++;
          insert(crr, nxt);
        }
        continue;
      }
      tree.at(crr).push_back(nxt);
      dfs(nxt, crr);
    }
  })(root, root);
  fix ([&](auto dfs, int crr, int p) -> void {
    for (auto const& nxt : tree.at(crr)) {
      if (nxt == p) continue;
      dfs(nxt, crr);
    }
    if (crr == root) return;
    if (out_deg.at(crr) % 2 == 0) {
      out_deg.at(p)++;
      insert(p, crr);
    } else {
      out_deg.at(crr)++;
      insert(crr, p);
    }
  })(root, root);
  std::for_each(out_deg.begin(), out_deg.end(), [](auto x){
    assert(x % 2 == 0);
  });
  assert((int)ret.size() == m);
  std::for_each(ret.begin(), ret.end(), [](auto p){
    std::cout << p.first + 1 << " " << p.second + 1 << std::endl;
  });
  return 0;
}

Measured memory_bytes: 23800