#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
vector<int> br[1000003];
pair<int,int> callme[1000003];
int used[1000003], bra = 0;
int a, b;
int main()
{
    int n, m, k;
    cin >> n >> m;
    for(int i = 1; i <= m; i ++)
    {
        cin >> a >> b;
        br[a].push_back(i);
        br[b].push_back(i);
    }
    for(int i = 1; i <= m; i ++)
    {
        k = br[i].size();
        if(k == 1) continue;
        for(int j=1; j < k; j ++)
        {
            if(used[br[i][j]] == 0 && used[br[i][j-1]] == 0)
            {
                bra ++;
                callme[bra].first = br[i][j-1];
                callme[bra].second = br[i][j];
                used[br[i][j]] = 1;
                used[br[i][j-1]] = 1;
            }
        }
    }
    cout << bra << endl;
    for(int j=1; j <= bra; j ++)
    {
        cout << callme[j].first<< " " << callme[j].second << endl;
    }
    return 0;
}
