#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b void vprint(T &V){ for(auto v : V){ cout << v << " "; } cout << endl; } ll ll_pow(ll a, ll n){ ll ans = 1; FOR(i, 0, n){ ans *= a; } return ans; } int main(){ cin.tie(0); ios::sync_with_stdio(false); // input ll N; cin >> N; FOR(i, 0, N){ ll A, B; cin >> A >> B; double a = B * log10(A); ll Z = a; a -= Z; double b = pow(10, a); string s = to_string(b); cout << s[0] << ' ' << s[2] << ' ' << Z << endl; } return 0; }