#include #include #include #include #include #include #include using namespace std; int main() { long long a, b; int n; int x, y; long long z; cin >> n; double loglog, tmp; for (int i = 0; i < n; i++) { cin >> a >> b; loglog = 1.0 * b * log10(a); z = loglog; tmp = pow(10, loglog - z); x = tmp; y = (tmp - x) * 10; printf("%d %d %lld\n", x, y, z); } return 0; }