#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
using namespace std;

int l;
int n;
int x, w;

int main(){
	int i;
	int mo = 0;
	
	cin >> l >> n;
	for( i = 0; i < n; i++ ){
		cin >> x >> w;
		mo += x * w;
	}
	if( mo == 0 ){ cout << 0 << endl; return 0; }
	
	cout << 1 << endl;
	int pos = (mo < 0) ? 1 : -1;
	cout << pos << " " << abs(mo) << endl;
	return 0;
}