#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>


using namespace std;
typedef long long ll;

#define mod 1000000007
#define INF 2000000000
#define LLINF 4000000000000000000
#define SIZE 100


void calc(int w,int h){
    int dp[4][110][110]={0}; //0?????????,1?????????,2?????????,3?????????
    
    dp[2][1][1] = 1;
    dp[3][1][1] = 1;

    
    for(int i=1;i<=w;i++){
        for(int j=1;j<=h;j++){
            dp[0][i][j+1] += dp[2][i][j] + dp[0][i][j]; //up
            dp[1][i+1][j] += dp[3][i][j] + dp[1][i][j]; //right
            dp[2][i][j+1] += dp[1][i][j]; //right-up
            dp[3][i+1][j] += dp[0][i][j]; //up-right
            
            for(int k=0;k<4;k++)
                dp[k][i+(k%2)][j+((k+1)%2)]%=100000;
        }
    }
    
    
    printf("%d\n",(dp[0][w][h]+dp[1][w][h]+dp[2][w][h]+dp[3][w][h])%100000);
    
    return;
}

int main(){
    int w,h;
    
    while(1){
        scanf("%d%d",&w,&h);
        if(w==0) break;
        calc(w,h);
    }
    
    return 0;
}