#define _USE_MATH_DEFINES
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>
using namespace std;



int main(){
	
	int a,b;
	while(1){
		cin>>a>>b;
		if(!a&&!b)return 0;
		int p[105][105][5]={};
		for(int i=0;i<=b;i++){
			p[i][1][0]=1;
		}
		for(int i=0;i<=a;i++){
			p[1][i][2]=1;
		}
		for(int i=2;i<=b;i++){
			for(int j=2;j<=a;j++){
				p[i][j][0]+=(p[i-1][j][0]+p[i-1][j][1])%100000;
				p[i][j][1]+=(p[i-1][j][2])%100000;
				p[i][j][2]+=(p[i][j-1][2]+p[i][j-1][3])%100000;
				p[i][j][3]+=(p[i][j-1][0])%100000;
				

			}
		}
		cout<<(p[b][a][1]+p[b][a][2]+p[b][a][3]+p[b][a][0])%100000<<endl;

	}
	return 0;
}