#!/bin/python3 import sys q = int(input().strip()) for a0 in range(q): n = int(input().strip()) # your code goes here print(n%663224321)