using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static string InputPattern = "InputX";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("3 4");
WillReturn.Add("15 15");
WillReturn.Add("0 0");
//5
//43688
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
static void Main()
{
List<string> InputList = GetInputList();
int[] wkArr = { };
Action<string> SplitAct = pStr =>
wkArr = pStr.Split(' ').Select(pX => int.Parse(pX)).ToArray();
foreach (string EachStr in InputList) {
SplitAct(EachStr);
int Width = wkArr[0];
int Height = wkArr[1];
if (Width == 0 && Height == 0) break;
Solve(Width, Height);
}
}
const int Hou = 100000;
static void Solve(int pWidth, int pHeight)
{
int UB_X = pWidth - 1;
int UB_Y = pHeight - 1;
// 移動パターン0 移動なし
// 移動パターン1 右に移動
// 移動パターン2 上に移動
// 場合の数[X,Y,1つ前の移動パターン,2つ前の移動パターン]
int[, , ,] BanArr = new int[UB_X + 1, UB_Y + 1, 3, 3];
BanArr[0, 0, 0, 0] = 1;
for (int X = 0; X <= UB_X; X++) {
for (int Y = 0; Y <= UB_Y; Y++) {
for (int I = 0; I <= 2; I++) {
for (int J = 0; J <= 2; J++) {
if (BanArr[X, Y, I, J] == 0) continue;
Action<int, int, int> SendAct = (pNewX, pNewY, pMovePattern) =>
{
if (UB_X < pNewX) return;
if (UB_Y < pNewY) return;
if (pMovePattern == 2) {
if (I == 1 && J == 2) return;
}
if (pMovePattern == 1) {
if (I == 2 && J == 1) return;
}
BanArr[pNewX, pNewY, pMovePattern, I] += BanArr[X, Y, I, J];
BanArr[pNewX, pNewY, pMovePattern, I] %= Hou;
};
SendAct(X + 1, Y, 1);
SendAct(X, Y + 1, 2);
}
}
}
}
int Answer = 0;
for (int I = 0; I <= 2; I++) {
for (int J = 0; J <= 2; J++) {
Answer += BanArr[UB_X, UB_Y, I, J];
Answer %= Hou;
}
}
Console.WriteLine(Answer);
}
}