Design a Tree

No attempts yetTime limit3sMemory limit256 MB

Problem

You are a garden designer. You want to grow a new style of tree called the Left-Right Tree. A Left-Right Tree satisfies all of the following.

  1. A Left-Right Tree is a binary tree.
  2. A Left-Right Tree has exactly one root node.
  3. A Left-Right Tree has exactly NN left sticks and MM right sticks.

A left stick is the edge joining a node to its left child, and a right stick is the edge joining a node to its right child. A Left-Right Tree therefore has N+M+1N + M + 1 nodes. Two Left-Right Trees whose shapes differ count as different trees.

Drawing every Left-Right Tree is impossible because there are too many of them, so count them instead. Print the number of possible Left-Right Trees modulo 99999919999991.

Input

The first line has the number of queries TT. (1T100001 \le T \le 10000)

Each of the next TT lines has the number of left sticks NN and the number of right sticks MM, separated by a space. (0N,M1250 \le N, M \le 125)

Output

Print TT lines. On line ii, print the answer to query ii modulo 99999919999991.

Hint

When N=1N = 1 and M=1M = 1 there are three Left-Right Trees: the root with one left child and one right child, the root with a left child that has a right child, and the root with a right child that has a left child.

The Left-Right Trees for N=2N = 2 and M=1M = 1 are shown below.

Left-Right Trees for N = 2, M = 1