#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 ;
}
