/home/toolbox/public_html/solutions/115/11547/x.c
1
2 #include <stdio.h>
3 #include <string.h>
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <fcntl.h>
7 #include <stdlib.h>
8 #include <math.h>
9 #include <stdint.h>
10
11 #define TRUE (1 == 1)
12 #define FALSE (1 != 1)
13
14 #define DEBUG if (FALSE)
15
16
17 int main()
18 {
19 int tc;
20 long long n;
21 scanf("%d", &tc);
22 while (tc--)
23 {
24 scanf("%lld", &n);
25 n = abs((((n * 63 + 7492) * 5 - 498)/10)%10);
26 printf("%lld\n", n);
27 }
28 return 0;
29 }
30