#include <stdio.h>
 
void Shuffle(int [],int,int);
 
int main(void)
{
    int fuda[50];
    int r,n,c,i,p,j;
    while(1){
    do {
        scanf("%d %d",&n,&r);
        if(n == 0 && r == 0) goto LOOP;
    }while((0 > n) || (n > 51) || (0 > r) || ( r > 51));
    for(i = n - 1;i >= 0;i--){
        fuda[i] = n - i;
    }
     
    while(r > 0){
        do{
        scanf("%d %d",&p,&c);
        }while(!((p + c) <= (n + 1)));
        Shuffle(fuda,p,c);
        r--;
    }
    printf("%d\n",fuda[0]);
    }
    LOOP:
    return 0;
}
 
void Shuffle(int FUDA[],int p,int c){
    int wark[50],i,j;
    for(i = p - 1,j = 0;i < p + c - 1 ;i++,j++){
    wark[j] = FUDA[i];
    }
    for(i = p - 2;i >= 0;i--){
        FUDA[i + c] = FUDA[i];
    }
    for(i = 0;i < c;i++){
        FUDA[i] = wark[i];
    }
    return 0;
}