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

int main() {
    for(int T; cin >> T, T; ) {
        int N; cin >> N;
        while(N--) {
            int a, b; cin >> a >> b;
            T -= b - a;
        }
        if(T <= 0) cout << "OK" << endl;
        else cout << T << endl;
    }
}