#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <cstring>

#define rep(i, n) for(int i = 0; i < (n); i++)

using namespace std;

const int MOD = 100000;
int dp[101][101][3][3];
int main(){
	int w, h;
	while(cin >> w >> h, w|h){
		memset(dp, 0, sizeof(dp));
		dp[0][0][0][0] = 1;
		rep(i, h){
			rep(j, w){
				rep(l, 3){
					rep(m, 3){
						if(l != 2 || m != 1) (dp[i][j+1][1][l] += dp[i][j][l][m]) %= MOD; 
						if(l != 1 || m != 2) (dp[i+1][j][2][l] += dp[i][j][l][m]) %= MOD;
					}
				}
			}
		}
	
		int ans = 0;
		rep(i, 3) rep(j, 3) ans += dp[h-1][w-1][i][j];
		cout << ans%MOD << endl;
	}

	return 0;
}