#include using namespace std; typedef long long ll; #define int ll #define pii pair #define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define pb emplace_back #define pii pair #define F first #define S second #define M_PI 3.14159265358979323846 const int mod = 1000000007; const int MAXX = 1e2 + 5; int t , n; int gcd(int a , int b){ return (a ? gcd(b % a , a) : b); } signed main() { _FastIO; cin >> t; while(t--){ cin >> n; cout << (n % 4) << endl; } return 0; }