#include using namespace std; using ll=long long; unordered_mapM; ll S(ll N){ if(M.count(N))return M[N]; M[N]=S(N/2)+S((N-1)/4)+S((N+1)/4)+(N+1)/2; return M[N]; } int main() { ll T; cin>>T; assert(T<1e+1); M[0]=0; while(T--) { ll N; cin>>N; cout<