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

int main(int argc, char const *argv[])
{
	int l, n;
	cin >> l >> n;
	int tx, tw, lw=0, rw=0;
	for (int i = 0; i < n; ++i)
	{
		cin >> tx >> tw;
		if (tx>0)
		{
			rw += tw * tx;
		}
		else if (tx<0)
		{
			lw += tw * abs(tx);
		}
	}
	if (lw == rw)
	{
		cout << 0 << endl;
	}
	else if(lw > rw)
	{
		cout << abs(lw-rw) << endl;
		for (int i = 0; i < abs(lw-rw); ++i)
		{
			printf("1 1\n");
		}
	}
	else
	{
		cout << abs(lw-rw) << endl;
		for (int i = 0; i < abs(lw-rw); ++i)
		{
			printf("-1 1\n");
		}
	}
	return 0;
}
