#include<iostream>
using namespace std;
int main(void)
{
    int t,n,s,f,A;
    while(1){
        cin>>t;
        if(t==0)break;
        A=0;
        cin>>n;
        for(int i=0;i<n;i++){
            cin>>s>>f;
            A+=f-s;
        }
        if(t<=A)cout<<"OK\n";
        else cout<<t-A<<"\n";
    }
}