Language: C++

#include <bits/stdc++.h>
using namespace std;

int main ()
	int n,m,i,a[100005],b[100005],d[100005]={0},s[100005];
	vector v[100005];
	cin >> n >> m;
	for(i=1;i<=m;i++){
		cin >> a[i] >> b[i];
		v[a[i]].push_back(b[i]);
		v[b[i]].push_back(a[i]);
	}
	if(m%2==1){
		cout << "-1" << endl;
		return 0;
	}
	for(i=1;i<=n;i++) s[i]=v[i].size()
	
	for(i=1;i<=m;i++){
		if(d[a[i]]==1&&s[a[i]]==1){
			cout << a[i] << " " << b[i] << endl;
			s[b[i]]--;
		} else if(d[b[i]]==1&&s[b[i]]==1){
			cout << b[i] << " " << a[i] << endl;
			s[a[i]]--;
		} else {
			cout << a[i] << " " << b[i] << endl;
			s[a[i]]--;
			s[b[i]]--;
			d[a[i]]=(d[a[i]]+1)%2;
			d[b[i]]=(d[b[i]]+1)%2;
		}
	}
	return 0;
}

Compiler output:
a.cc:5:9: error: expected initializer before 'int'
    5 |         int n,m,i,a[100005],b[100005],d[100005]={0},s[100005];
      |         ^~~
a.cc:5:52: error: expected unqualified-id before ',' token
    5 |         int n,m,i,a[100005],b[100005],d[100005]={0},s[100005];
      |                                                    ^
a.cc:5:62: error: expected constructor, destructor, or type conversion before ';' token
    5 |         int n,m,i,a[100005],b[100005],d[100005]={0},s[100005];
      |                                                              ^
a.cc:6:9: error: missing template argument list after 'std::vector'; for deduction, template placeholder must be followed by a simple declarator-id
    6 |         vector v[100005];
      |         ^~~~~~
      |               <>
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:428:11: note: 'template<class _Tp, class _Alloc> class std::vector' declared here
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:7:9: error: 'cin' does not name a type
    7 |         cin >> n >> m;
      |         ^~~
a.cc:8:9: error: expected unqualified-id before 'for'
    8 |         for(i=1;i<=m;i++){
      |         ^~~
a.cc:8:17: error: 'i' does not name a type
    8 |         for(i=1;i<=m;i++){
      |                 ^
a.cc:8:22: error: 'i' does not name a type
    8 |         for(i=1;i<=m;i++){
      |                      ^
a.cc:13:9: error: expected unqualified-id before 'if'
   13 |         if(m%2==1){
      |         ^~
a.cc:17:9: error: expected unqualified-id before 'for'
   17 |         for(i=1;i<=n;i++) s[i]=v[i].size()
      |         ^~~
a.cc:17:17: error: 'i' does not name a type
   17 |         for(i=1;i<=n;i++) s[i]=v[i].size()
      |                 ^
a.cc:17:22: error: 'i' does not name a type
   17 |         for(i=1;i<=n;i++) s[i]=v[i].size()
      |                      ^
a.cc:19:17: error: 'i' does not name a type
   19 |         for(i=1;i<=m;i++){
      |                 ^
a.cc:19:22: error: 'i' does not name a type
   19 |         for(i=1;i<=m;i++){
      |                      ^
a.cc:34:9: error: expected unqualified-id before 'return'
   34 |         return 0;
      |         ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^