import scala.io.StdIn.{readInt,readLine}

object Main {
  def main(args:Array[String]) = {
    var n = readLine.toInt
    while( n != 0 ) {
      var sum = 0
      val cnt = readLine.toInt
      for(i<-1 to cnt) {
        val s = readLine.trim.split(" ").map(_.toInt)
        sum += s(1)-s(0)
      }
      if(sum >= n) println("OK")
      else println(n-sum)
      n = readLine.toInt
    }
  }
}