#include<bits/stdc++.h>
#define EPS 1e-9
using namespace std ;
const double pi = acos(-1.0);
struct point
{
double x, y;
point() { x = y = 0.0; }
point(double _x, double _y) : x(_x), y(_y) {}
bool operator < (point other) const
{
if (fabs(x - other.x) > EPS)
return x < other.x;
else
return y < other.y;
}
bool operator == (point other) const {
return (fabs(x - other.x) < EPS && (fabs(y - other.y) < EPS)); }
};
double dist(point p1, point p2)
{
return (hypot(p1.x - p2.x, p1.y - p2.y));
}
struct vec { double x, y;
vec(double _x, double _y) : x(_x), y(_y) {} };
vec toVec(point a, point b) {
return vec(b.x - a.x, b.y - a.y); }
vec scale(vec v, double s) {
return vec(v.x * s, v.y * s); }
point rotate_point(float cx,float cy,float angle,point p)
{
float s = sin(angle);
float c = cos(angle);
p.x -= cx;
p.y -= cy;
float xnew = p.x * c - p.y * s;
float ynew = p.x * s + p.y * c;
p.x = xnew + cx;
p.y = ynew + cy;
return p;
}
int main()
{
std::cout << std::setprecision(6) << std::fixed;
int T;
cin >> T ;
while(T--)
{
double x,y,r ;
cin >> x >> y >> r ;
point C(x,y) ;
point O ;
double ang1 = asin(r/dist(O,C)) ;
point rot_pt = rotate_point(0,0,ang1,C) ;
cout<< rot_pt.x*cos(ang1)<<" "<<rot_pt.y*cos(ang1)<<"\n" ;
}
return 0 ;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBFUFMgMWUtOQp1c2luZyBuYW1lc3BhY2Ugc3RkIDsKY29uc3QgZG91YmxlIHBpID0gYWNvcygtMS4wKTsKc3RydWN0IHBvaW50CnsKZG91YmxlIHgsIHk7CnBvaW50KCkgeyB4ID0geSA9IDAuMDsgfQpwb2ludChkb3VibGUgX3gsIGRvdWJsZSBfeSkgOiB4KF94KSwgeShfeSkge30KCmJvb2wgb3BlcmF0b3IgPCAocG9pbnQgb3RoZXIpIGNvbnN0CnsKaWYgKGZhYnMoeCAtIG90aGVyLngpID4gRVBTKQpyZXR1cm4geCA8IG90aGVyLng7CmVsc2U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