#include<iostream>
#include<algorithm>
#include<vector>
#define endl '\n'
using namespace std;
int t[100005];
pair<int,int> p[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>>p[i].first>>p[i].second;
        if(p[i].first>p[i].second) swap(p[i].first,p[i].second);
       // isn[p[i].first]=!isn[p[i].first];
    }
    sort(p,p+m);

    for(int i=1;i<=m;i++)
    {
        a=p[i].first;isn[a]=!isn[a];
        b=p[i].second;

        if(isn[p[i].first]) {swap(a,b);isn[p[i].first]=0;isn[p[i].second]=!isn[p[i].second];}
        else if(isn[p[i].second]) {swap(a,b);isn[p[i].second]=0;isn[p[i].first]=!isn[p[i].first];}



        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;
    }
}
