Language: C++

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

using ll=long long;
#define rng(i,l,r) for(int i=int(l);i<int(r);i++)
#define rep(i,r) rng(i,0,r)
#define rrng(i,l,r) for(int i=int(r)-1;i>=int(l);i--)
#define rrep(i,r) rrng(i,0,r)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
#define inf INT_MAX/2-100
#define infl LLONG_MAX/3
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<' '<<#x<<' '<<x<<endl
#else
#define dmp(x) void(0)
#endif
 
template<class t,class u>bool chmax(t&a,u b){if(a<b)a=b;return a<b;}
template<class t,class u>bool chmin(t&a,u b){if(b<a)a=b;return b<a;}
 
template<class t>using vc=vector<t>;
template<class t>using vvc=vector<vector<t>>;
 
using pi=pair<int,int>;
using pl=pair<ll,ll>;
using vi=vc<int>;
using vl=vc<ll>;
 
 
ll readl(void){
	ll x;
	cin>>x;
	return x;
}
int readi(void){
	int x;
	cin>>x;
	return x;
}
 
string readstr(){
	string s;
	cin>>s;
	return s;
}
vi readvi(int n,int off=0){
	vi v(n);
	rep(i,n)v[i]=readi(),v[i]+=off;
	return v;
}
 
vl readvl(int n,int off=0){
	vl v(n);
	rep(i,n)v[i]=readl(),v[i]+=off;
	return v;
}
 
template<class t>
void print(t x,int suc=1){
	cout<<x;
	if(suc==1)cout<<"\n";
	if(suc==2)cout<<" ";
}
 
template<class t>
void print(const vc<t>&v,int suc=1){
	rep(i,si(v))print(v[i],i==int(si(v))-1?1:suc);
}
 
template<class t>
bool inc(t a,t b,t c){
	return !(c<b||b<a);
}
 
template<class t>
void compress(vc<t>&v){
	sort(all(v));
	v.erase(unique(all(v)),v.ed);
}
 
template<class t>
int lwb(const vc<t>&v,const t&a){
	return lower_bound(all(v),a)-v.bg;
}
 
template<class t>
struct Compress{
	vc<t>v;
	Compress()=default;
	Compress(const vc<t>&x){
		add(x);
	}
	Compress(const initializer_list<vc<t> >&x){
		for(auto &p:x)add(p);
	}
	void add(const t&x){
		v.eb(x);
	}
	void add(const vc<t>&x){
		copy(all(x),back_inserter(v));
	}
	void build(){
		compress(v);
	}
	int get(const t&x)const{
		return lwb(v,x);
	}
	vc<t>get(const vc<t>&x)const{
		vc<t>res(x);
		for(auto &p:res)p=get(p);
		return res;
	}
	const t &operator[](int x)const{
		return v[x];
	}
};
void Yes(bool ex=true){
	cout<<"Yes\n";
	if(ex)exit(0);
}
void YES(bool ex=true){
	cout<<"YES\n";
	if(ex)exit(0);
}
void No(bool ex=true){
	cout<<"No\n";
	if(ex)exit(0);
}
void NO(bool ex=true){
	cout<<"NO\n";
	if(ex)exit(0);
}
void orYes(bool x,bool ex=true){
	if(x)Yes(ex);
	else No(ex);
}
void orYES(bool x,bool ex=true){
	if(x)YES(ex);
	else NO(ex);
}
void Possible(bool ex=true){
	cout<<"Possible\n";
	if(ex)exit(0);
}
void POSSIBLE(bool ex=true){
	cout<<"POSSIBLE\n";
	if(ex)exit(0);
}
void Impossible(bool ex=true){
	cout<<"Impossible\n";
	if(ex)exit(0);
}
void IMPOSSIBLE(bool ex=true){
	cout<<"IMPOSSIBLE\n";
	if(ex)exit(0);
}
void orPossible(bool x,bool ex=true){
	if(x)Possible(ex);
	else Impossible(ex);
}
void orPOSSIBLE(bool x,bool ex=true){
	if(x)POSSIBLE(ex);
	else IMPOSSIBLE(ex);
}
int cl(int x,int y){
	if((x+y)%2==0)return 0;
	if(x==1)return 1;
	return 2;
}
void printe(int a,int b){
	print(a,2);
	print(b);
}
vvc<int>g;
vc<bool>o,vis,s;
vc<int>a,b;
void dfs(int v,int p){
	vis[v]=true;
	for(auto &i:g[v]){
		if(i==p)continue;
		int u=a[i];
		if(u==v)u=b[i];
		if(!vis[u])dfs(u,i);
		else if(!o[i]){
			o[i]=true;
			s[a[i]]=!s[a[i]];
			print(a[i],2);
			print(b[i]);
		}
	}
	if(p!=-1){
		if(v==b[p])swap(a[p],b[p]);
		if(s[v]){
			print(a[p],2);
			print(b[p]);
			s[a[p]]=!s[a[p]]:
		}else{
			print(b[p],2);
			print(a[p]);
			s[b[p]]=!s[b[p]]:
		}
		o[p]=true;
	}
}
int main(void){
	int n=readi(),m=readi();
	if(m%2==1){
		print(-1);
		return 0;
	}
	g.resize(n+1);
	o.resize(m);
	vis.resize(n+1);
	a.resize(m);
	b.resize(m);
	s.resize(n+1);
	fill(all(o),false);
	fill(all(vis),false);
	rep(i,m){
		a[i]=readi();
		b[i]=readi();
		g[a[i]].eb(i);
		g[b[i]].eb(i);
	}
	dfs(1,-1);

}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:205:41: error: expected ';' before ':' token
  205 |                         s[a[p]]=!s[a[p]]:
      |                                         ^
      |                                         ;
a.cc:209:41: error: expected ';' before ':' token
  209 |                         s[b[p]]=!s[b[p]]:
      |                                         ^
      |                                         ;