#include<iostream>
#include<vector>
#define endl '\n'
using namespace std;
int t[100005],p1[100005],p2[100005];
vector< pair<int,int> > v;
bool isn[100005];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n,m,a,b;
    cin>>n>>m;

    for(int i=1;i<=m;i++)
    {
        cin>>p1[i]>>p2[i];
        isn[p1[i]]=!isn[p1[i]];
    }

    for(int i=1;i<=m;i++)
    {
        a=p1[i];
        b=p2[i];

        if(isn[p2[i]]) {swap(a,b);isn[p2[i]]=0;isn[p1[i]]=!isn[p1[i]];}

        if(t[a]==0) {t[a]=i;continue;}
        v.push_back({t[a],i});
        t[a]=0;
    }
cout<<v.size()<<endl;

    for(int i=0;i<v.size();i++)
    {
        cout<<v[i].first<<" "<<v[i].second<<endl;
    }
}
