# 2019牛客暑期多校训练营（第四场）----D-triples I

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
vector<ll> vec1, vec2;
int t;
ll a;
int main(){
scanf("%d", &t);
while(t--){
vec1.clear();
vec2.clear();
scanf("%lld", &a);
if(a % 3 == 0){
printf("1 %lld\n", a);
continue;
}
for(int i = 0; i <= 60; i++){
ll tmp = (1ll << i);
if(a & tmp){
if(tmp % 3 == 1)	vec1.push_back(tmp);
if(tmp % 3 == 2)	vec2.push_back(tmp);
}
}
if(a % 3 == 1){
if(vec1.size() >= 2){
printf("2 %lld %lld\n", a - vec1[0], a - vec1[1]);
} else if(vec1.size() == 1){
printf("2 %lld %lld\n", a - vec1[0], vec1[0] + vec2[0]);
} else if(vec1.size() == 0){
ll tmp1 = vec2[0] + vec2[1], tmp2 = vec2[1] + vec2[2], tmp3 = vec2[2] + vec2[0];
printf("3 %lld %lld %lld\n", a - tmp1, a - tmp2, a - tmp3);
}
}else{
if(vec2.size() >= 2){
printf("2 %lld %lld\n", a - vec2[0], a - vec2[1]);
} else if(vec2.size() == 1){
printf("2 %lld %lld\n", a - vec2[0], vec1[0] + vec2[0]);
} else if(vec2.size() == 0){
ll tmp1 = vec1[0] + vec1[1], tmp2 = vec1[1] + vec1[2], tmp3 = vec1[2] + vec1[0];
printf("3 %lld %lld %lld\n", a - tmp1, a - tmp2, a - tmp3);
}
}
}
return 0;
}

07-30 386

08-20 47
07-27 340