import java.util.*; 

public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    int test = scn.nextInt();
    while(test-- != 0) {
      int n = scn.nextInt();
      int sum = 0;
      for(int i = 1; i * i <= n; i++) {

        if((n % i) == 0) {
          if(i == (n / i)) sum += i;
          else sum += (i + (n / i));
        }

      }

      System.out.println(sum);
    }

  }
}