#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e12;
const double PI = acos(-1);
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
struct C{
    P p;
    double r;
    C(const P& p, const double& r) : p(p), r(r) {}
    C(){}
};

P unit(const P &a){
    return a/abs(a);
}
double getangle(P a, P b){
    return abs(arg(a/b));
}
VP crosspointCC(C a, C b){
    VP ret;
    double dist = abs(b.p-a.p);
    P dir = a.r*unit(b.p-a.p);
    double cos = (a.r*a.r +dist*dist -b.r*b.r)/(2*a.r*dist);
    double sin = sqrt(1 -cos*cos);
    ret.push_back(a.p +dir*P(cos, sin));
    ret.push_back(a.p +dir*P(cos, -sin));
    return ret;
}

int main(){
    while(1){
        int n,q;
        double r;
        cin >> n >> r >> q;
        if(n==0) break;

        VP p(n);
        for(int i=0; i<n; i++){
            double x,y;
            cin >> x >> y;
            p[i] = P(x, y);
        }
        int st=-1;
        for(int i=0; i<n; i++){
            if(EQ(abs(p[i]), r)){
                st = i;
                break;
            }
        }

        for(int i=0; i<q; i++){
            double minangle = INF;
            int minidx = -1;
            P center = p[st];
            for(int j=0; j<n; j++){
                if(j == st) continue;
                VP cp = crosspointCC(C(center, abs(p[j] -center)), C(P(0,0), r));
                double angle = getangle(cp[0] -center, p[j] -center);
                if(angle < minangle){
                    minangle = angle;
                    minidx = j;
                }
            }
            P rot = P(cos(minangle), sin(minangle));
            st = minidx;
            for(int j=0; j<n; j++){
                p[j] -= center;
                p[j] *= rot;
                p[j] += center;
            }
            cout << fixed << setprecision(10);
            cout << p[st].X << " " << p[st].Y << endl;
        }
    }
    return 0;
}
