#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;

int main() {
  int L, N;
  cin >> L >> N;
  int sum = 0;
  for ( int i = 0; i < N; i++ ) {
    int x, w;
    cin >> x >> w;
    sum += x*w;
  }

  if ( sum == 0 ) cout << 0 << endl;
  else {
    cout << 1 << endl;
    if ( sum > 0 ) cout << -1 << " " << sum << endl;
    else cout << 1 << " " << -1*sum << endl;
  }
  return 0;
}

