Problem: Archith loves to play with number series. Archith asked his girlfriend to a date. But she was busy in solving the homework on triangular series which stated that find the least number which has higher divisors than n in a triangular series. His girlfriend made a condition that if he solves this assignment for her she will come for date. Archith dont want to waste time he is developing a code. Put yourself in the position of archith and solve this problem.(#projecteuler 13)

INPUT:
T test cases
every t lines consists of a number n which specifies the no of divisors.
OUTPUT:
output the least triangular number which has higher no of divisors than n.

1<T<11
1<n<10^2

example:

triangular series will be as follows 1,3,6,10........
if n =2
6 has 4 divisors.So 6 will be the least number to have more than n divisors.

SAMPLE INPUT
4
1
2
3
4

SAMPLE OUTPUT
3
6
6
28

Solution (in PYTHON):

Solution:
t=[1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465, 496, 528, 561, 595, 630, 666, 703, 741, 780, 820, 861, 903, 946, 990, 1035, 1081, 1128, 1176, 1225, 1275, 1326, 1378, 1431, 1485, 1540, 1596, 1653, 1711, 1770, 1830, 1891, 1953, 2016, 2080, 2145, 2211, 2278, 2346, 2415, 2485, 2556, 2628, 2701, 2775, 2850, 2926, 3003, 3081, 3160, 3240, 3321, 3403, 3486, 3570, 3655, 3741, 3828, 3916, 4005, 4095, 4186, 4278, 4371, 4465, 4560, 4656, 4753, 4851, 4950, 5050, 5151, 5253, 5356, 5460, 5565, 5671, 5778, 5886, 5995, 6105, 6216, 6328, 6441, 6555, 6670, 6786, 6903, 7021, 7140, 7260, 7381, 7503, 7626, 7750, 7875, 8001, 8128, 8256, 8385, 8515, 8646, 8778, 8911, 9045, 9180, 9316, 9453, 9591, 9730, 9870, 10011, 10153, 10296, 10440, 10585, 10731, 10878, 11026, 11175, 11325, 11476, 11628, 11781, 11935, 12090, 12246, 12403, 12561, 12720, 12880, 13041, 13203, 13366, 13530, 13695, 13861, 14028, 14196, 14365, 14535, 14706, 14878, 15051, 15225, 15400, 15576, 15753, 15931, 16110, 16290, 16471, 16653, 16836, 17020, 17205, 17391, 17578, 17766, 17955, 18145, 18336, 18528, 18721, 18915, 19110, 19306, 19503, 19701, 19900, 20100, 20301, 20503, 20706, 20910, 21115, 21321, 21528, 21736, 21945, 22155, 22366, 22578, 22791, 23005, 23220, 23436, 23653, 23871, 24090, 24310, 24531, 24753, 24976, 25200, 25425, 25651, 25878, 26106, 26335, 26565, 26796, 27028, 27261, 27495, 27730, 27966, 28203, 28441, 28680, 28920, 29161, 29403, 29646, 29890, 30135, 30381, 30628, 30876, 31125, 31375, 31626, 31878, 32131, 32385, 32640, 32896, 33153, 33411, 33670, 33930, 34191, 34453, 34716, 34980, 35245, 35511, 35778, 36046, 36315, 36585, 36856, 37128, 37401, 37675, 37950, 38226, 38503, 38781, 39060, 39340, 39621, 39903, 40186, 40470, 40755, 41041, 41328, 41616, 41905, 42195, 42486, 42778, 43071, 43365, 43660, 43956, 44253, 44551, 44850, 45150, 45451, 45753, 46056, 46360, 46665, 46971, 47278, 47586, 47895, 48205, 48516, 48828, 49141, 49455, 49770, 50086, 50403, 50721, 51040, 51360, 51681, 52003, 52326, 52650, 52975, 53301, 53628, 53956, 54285, 54615, 54946, 55278, 55611, 55945, 56280, 56616, 56953, 57291, 57630, 57970, 58311, 58653, 58996, 59340, 59685, 60031, 60378, 60726, 61075, 61425, 61776, 62128, 62481, 62835, 63190, 63546, 63903, 64261, 64620, 64980, 65341, 65703, 66066, 66430, 66795, 67161, 67528, 67896, 68265, 68635, 69006, 69378, 69751, 70125, 70500, 70876, 71253, 71631, 72010, 72390, 72771, 73153, 73536, 73920, 74305, 74691, 75078, 75466, 75855, 76245, 76636, 77028, 77421, 77815, 78210, 78606, 79003, 79401, 79800, 80200, 80601, 81003, 81406, 81810, 82215, 82621, 83028, 83436, 83845, 84255, 84666, 85078, 85491, 85905, 86320, 86736, 87153, 87571, 87990, 88410, 88831, 89253, 89676, 90100, 90525, 90951, 91378, 91806, 92235, 92665, 93096, 93528, 93961, 94395, 94830, 95266, 95703, 96141, 96580, 97020, 97461, 97903, 98346, 98790, 99235, 99681, 100128, 100576, 101025, 101475, 101926, 102378, 102831, 103285, 103740, 104196, 104653, 105111, 105570, 106030, 106491, 106953, 107416, 107880, 108345, 108811, 109278, 109746, 110215, 110685, 111156, 111628, 112101, 112575, 113050, 113526, 114003, 114481, 114960, 115440, 115921, 116403, 116886, 117370, 117855, 118341, 118828, 119316, 119805, 120295, 120786, 121278, 121771, 122265, 122760, 123256, 123753, 124251, 124750, 125250]
div=[1, 2, 4, 4, 4, 4, 6, 9, 6, 4, 8, 8, 4, 8, 16, 8, 6, 6, 8, 16, 8, 4, 12, 18, 6, 8, 16, 8, 8, 8, 10, 20, 8, 8, 24, 12, 4, 8, 24, 12, 8, 8, 8, 24, 12, 4, 16, 24, 9, 12, 16, 8, 8, 16, 24, 24, 8, 4, 16, 16, 4, 12, 36, 24, 16, 8, 8, 16, 16, 8, 18, 18, 4, 12, 24, 16, 16, 8, 16, 40, 10, 4, 16, 32, 8, 8, 24, 12, 12, 24, 16, 16, 8, 8, 40, 20, 6, 18, 36, 12, 8, 8, 12, 48, 16, 4, 16, 16, 8, 16, 32, 16, 8, 16, 16, 24, 12, 8, 48, 36, 6, 8, 16, 16, 24, 12, 14, 28, 16, 8, 16, 32, 8, 16, 48, 12, 8, 8, 16, 32, 8, 8, 48, 48, 8, 12, 24, 8, 12, 12, 12, 36, 24, 16, 32, 16, 4, 8, 40, 40, 20, 10, 8, 32, 16, 4, 24, 36, 12, 24, 24, 8, 8, 24, 48, 32, 8, 4, 24, 24, 8, 16, 24, 24, 16, 16, 16, 32, 32, 8, 24, 24, 4, 16, 48, 12, 12, 12, 18, 36, 8, 8, 32, 32, 8, 12, 48, 32, 32, 16, 8, 16, 8, 8, 48, 48, 8, 8, 32, 32, 16, 8, 20, 90, 18, 4, 16, 16, 8, 32, 48, 12, 12, 24, 16, 16, 16, 8, 32, 32, 6, 18, 24, 24, 24, 16, 24, 24, 16, 8, 24, 48, 8, 16, 64, 16, 8, 16, 32, 48, 12, 4, 24, 48, 16, 16, 16, 8, 16, 16, 16, 64, 16, 12, 48, 16, 4, 12, 72, 24, 8, 8, 8, 32, 32, 16, 60, 45, 12, 16, 16, 8, 12, 24, 24, 48, 16, 8, 48, 48, 8, 8, 32, 32, 24, 12, 16, 32, 16, 8, 24, 24, 4, 24, 48, 8, 8, 16, 48, 48, 16, 16, 40, 60, 12, 8, 24, 24, 32, 16, 8, 24, 12, 8, 64, 32, 6, 12, 32, 32, 24, 24, 24, 48, 16, 4, 16, 16, 12, 48, 80, 20, 8, 16, 16, 32, 16, 4, 36, 54, 6, 12, 48, 32, 16, 8, 16, 48, 24, 16, 32, 16, 8, 32, 48, 24, 32, 16, 16, 32, 8, 4, 28, 112, 16, 12, 24, 8, 16, 32, 36, 36, 8, 8, 48, 24, 4, 16, 96, 24, 8, 16, 16, 40, 40, 16, 48, 24, 8, 16, 16, 16, 24, 24, 40, 40, 16, 8, 32, 32, 4, 12, 36, 36, 24, 16, 16, 32, 32, 8, 32, 32, 8, 32, 32, 16, 16, 8, 24, 108, 36, 8, 16, 32, 8, 8, 48, 24, 18, 36, 16, 16, 8, 16, 96, 24, 4, 16, 64, 16, 16, 16, 16, 64, 16, 4, 24, 48, 16, 16, 24, 24, 16, 24, 48, 48, 12, 4, 40, 80, 8, 16, 48, 24, 24, 12, 12, 24, 24, 12, 16, 32, 16, 48, 96, 32, 16, 8, 16, 32]

tc=int(raw_input())
for case in range(tc):
	n=int(raw_input())
	for i in range(500):
		if div[i]>n:
			break
	print t[i]