Rohan bought new book Puzzleria in which he has to solve the puzzle.
So,now he need your help to solve one of the puzzle were he is given X consonant
and Y vowels to make a word from it whose length is equals to X + Y.
So now your are given the number of consonant and vowels and has to tell how many words can be formed out of it. 

INPUT

First line will be T Testcase (T<50) followed by T lines with two number in each line ,first number is for consonant(consonants ≤ 7)and second is for vowels(vowels ≤ 5).

OUTPUT

It should contain number of words which can be made with given combination.

Repetition of alphabets is not allowed

SAMPLE INPUT
1
5 2

SAMPLE OUTPUT
1058400

Explanation

Here we have 1 testcase  with 5 consonant and 2 vowels and when we made  words for these combination we get 1058400
t = int(raw_input())
def fact(n, m):
    if m == 0:
	    return 1
    else:
	    return n*fact(n-1, m-1)
while(t):
    c, v= map(int, raw_input().split()) 
    res = c+v 
    print fact(res, res) * (fact(7, c)/fact(c, c)) * (fact(5, v) / fact(v, v))
    t -= 1