#include using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,a,b) for(int i=(a);i<(b);i++) #define pb push_back #define all(v) (v).begin(),(v).end() typedef vectorvi; void solve(){ int A,B; cin>>A>>B; double la=log10(A)*B; int t=floor(la); int x=floor(pow(10,(la-t)+1)); printf("%lld %lld %lld\n",x/10,x%10,t); } signed main(){ int N; cin>>N; while(N--)solve(); return 0; }