#include using namespace std; typedef long long ll; typedef vector VI; #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) #define in(T,V) T V;cin>>V; const int MOD = int(1e9+7); int main(){ in(int,N); REP(i,N){ in(ll,A); in(ll,B); double l = log10(A+0.) * B; ll Z = (ll)l; double d = pow(10, l-Z+1); while(d < 10.){ d *= 10; Z--; } ll X = (ll)d / 10; ll Y = (ll)d % 10; cout << X << " " << Y << " " << Z << endl; } }