import scala.annotation.tailrec
object Main extends App {
  import scala.io.StdIn._

  val l = readInt
  val n = readInt
  var bias = 0
  for (_ ← 0 until n){
    val Array(x, w) = readLine.trim.split(' ').map(_.toInt)
    bias += x * w
  }
  if (bias == 0){
    println(0)
  }else if (bias > 0){
    val weights = additionalWeight(bias)
    println(weights.length)
    println(weights.map(it ⇒ s"-${it._1} ${it._2}").mkString("\n"))
  }else {
    val weights = additionalWeight(math.abs(bias))
    println(weights.length)
    println(weights.map(it ⇒ s"${it._1} ${it._2}").mkString("\n"))
  }

  @tailrec
  def additionalWeight(bias: Int, result: List[(Int, Int)] = Nil, weightMax: Int = 500000): List[(Int, Int)] = {
    if (bias == 0) result
    else if (weightMax >= bias) (1 , bias)::result
    else additionalWeight(bias - weightMax, (1, weightMax)::result)
  }

  implicit class Scope[T](val value: T) extends AnyVal {
    @inline def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline def let[A](@inline func: T ⇒ A): A = func(value)
  }
}
