#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int l,n,ans=0;
    cin >> l >> n;
    vector<int> a(n),b(n);
    for (int i=0;i<n;i++){
        cin >> a.at(i) >> b.at(i);
        ans+=a.at(i)*b.at(i);
    }
    if (ans==0) cout << 0 << endl;
    if (ans>0) cout << 1 << endl << -1 << " " << ans << endl;
    if (ans<0) cout << 1 << endl << 1 << " " << (-1)*ans << endl;
}

