/* This solution precomputes all answers.
 *
 * Author: Matt Eastman
 */

#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

#define MAX_SQUARES 1000000
#define MAX_ANSWERS 1005    // at least sqrt(MAX_SQUARES)

int answers[MAX_ANSWERS];

void BuildAnswers() {
  uint16_t* num_factors = (uint16_t*)calloc(MAX_SQUARES + 1, sizeof(uint16_t));
  assert(num_factors != NULL);
  int factor, i;
  for (factor = 1; factor * factor <= MAX_SQUARES; factor++) {
    for (i = factor * factor; i <= MAX_SQUARES; i += factor) {
      num_factors[i]++;
    }
  }
  for (i = 1; i <= MAX_SQUARES; i++) {
    if (answers[num_factors[i]] == 0)
      answers[num_factors[i]] = i;
  }
  free(num_factors);
}

int main(int argc, char** argv) {
  BuildAnswers();

  int num_inputs, i, num;
  assert(scanf(" %d", &num_inputs) == 1);

  for (i = 0; i < num_inputs; i++) {
    assert(scanf(" %d", &num) == 1);
    if (num < MAX_ANSWERS && answers[num])
      printf("%d\n", answers[num]);
    else
      printf("Too big\n");
  }

  return 0;
}
