Problem: In Storia Kingdom, there is an artifact called "Perfect Sphere" made by a great meister Es. This is handed down for generations in the royal palace as a treasure. Es left a memo and filled mysterious values in it. Within achievements of researches, it has been revealed that the values denote coordinate values. However it is still unknown the definition of the coordinate system.

By the way, you are a person who lived in age of Es lived. The values which meister Es left are defined by following. Es set an moving object in the artifact sphere. Surprisingly, that is rigid body and perpetual organization. The object rotates inside the sphere and it is always touching the inside surface of the sphere. This value is a coordinate of the tangent point by the object and the sphere, but it is not a three dimensional value. The object is a plate and this is a simple polygon. Here, "simple" means "non self-intersected". This rotates while touching a great circle of the sphere. Here, assume that the great circle is a circle O centered in the origin in the xy plane. (It is two-dimensional Cartesian coordinate system, the direction of positive x-value is right and the direction of positive y-value is up). This plate touches the circle O with a single point at the beginning of the movement. And it rotates in counterclockwise as the current touching point is the rotation fulcrum. When another point X of the plate touches the circle O newly, the plate continue to rotate as described above, but in the next rotation, the rotation fulcrum point is changed. This will be the point X. If two or more points can be interpreted as the point X, the point X is a most distant point from the currently touching point X'. Here, that distance is the length of the arc of the circle O from the point X' to the point X in clockwise.

Es asked you, an excellent assistant, to write a program that enumerates Q tangent points (fulcrum points while the movement) by the plate and the circle O while the movement of the plate described above in the chronological order. Of course, one and the previous one must be distinct points. Following figures show you examples of the movement of the plate inside the circle O.
1
<image>
2
<image>
3
<image>
4
<image>

Constraints

The number of datasets is less than or equal to 400.
3≤N≤25
1≤R≤1000
0≤Q≤100

Input

Input consists of multiple datasets.
A dataset is given in a following format.


N R Q
x1 y1
x2 y2
...
xN yN


N, R, Q are integers that represent the number of points of the plate, the radius of the circle, and the number of points Es needs respectively.
Following N lines contain 2N integers that represent coordinates of the plate's points ( xk , yk ) in the circle.(1≤k≤N)


You can assume following conditions.
* Points of the plate are given in counterclockwise.
* No three points are co-linear.
* N-1 points of the plate are given inside of the circle (distances between the center of the circle and these points are less than R). And 1 point is on the circle edge.
N=R=Q=0 shows the end of input.

Output

For each dataset, output (Px Py:real number) in Q in the following format.


Px1 Px1
Px2 Py2
...
PxN+1 PyN+1


These answers must satisfy |Txi-Pxi|≤0.0001 and |Tyi-Pyi|≤0.0001.
Here, Pxi, Pyi(1≤i≤Q) are your output and Txi,Tyi(1≤i≤Q) are judge's output.

Example

Input

4 10 8
0 -10
3 -7
0 -4
-3 -7
0 0 0


Output

-4.146082488326 -9.100000000000
-7.545870128753 -6.562000000000
-9.587401146004 -2.842840000000
-9.903199956975 1.388031200000
-8.436422775690 5.369056784000
-5.451089494781 8.383652146880
-1.484560104812 9.889190123322
2.749190104024 9.614673877565

Solution (in CPP):

Solution:
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int,int> pint;

#define DE 1
#define FI first
#define SE second
#define PB push_back
#define MP make_pair
#define ALL(s) (s).begin(),(s).end()
#define REP(i,n) for (int i = 0; i < (int)(n); ++i)
#define EACH(i,s) for (typeof((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl

template<class T1, class T2> ostream& operator<<(ostream &s, pair<T1,T2> P){return s<<'<'<<P.first<<", "<<P.second<<'>';}
template<class T> ostream& operator<<(ostream &s, vector<T> P) {s<<"{ ";for(int i=0;i<P.size();++i){if(i>0)s<<", ";s<<P[i];}return s<<" }"<<endl;}
template<class T1, class T2> ostream& operator<<(ostream &s, map<T1,T2> P) {s<<"{ ";for(typeof(P.begin()) it=P.begin();it!=P.end();++it){if(it!=P.begin())s<<", ";s<<'<'<<it->first<<"->"<<it->second<<'>';}return s<<" }"<<endl;}



const double INF = 1e10;
const double EPS = 1e-4;
const double PI = acos(-1.0);
double torad(int deg) {return (double)(deg) * PI / 180;}
double todeg(double ang) {return ang * 180 / PI;}

struct Point {
    double x, y;
    Point(double x = 0.0, double y = 0.0) : x(x), y(y) {}
    friend ostream& operator << (ostream &s, const Point &p) {return s << '(' << p.x << ", " << p.y << ')';}
};

Point operator + (Point p, Point q) {return Point(p.x + q.x, p.y + q.y);}
Point operator - (Point p, Point q) {return Point(p.x - q.x, p.y - q.y);}
Point operator * (Point p, double a) {return Point(p.x * a, p.y * a);}
Point operator * (double a, Point p) {return Point(a * p.x, a * p.y);}
Point operator * (Point p, Point q) {return Point(p.x * q.x - p.y * q.y, p.x * q.y + p.y * q.x);}
Point operator / (Point p, double a) {return Point(p.x / a, p.y / a);}
Point conj(Point p) {return Point(p.x, -p.y);}
Point rot(Point p, double ang) {return Point(cos(ang) * p.x - sin(ang) * p.y, sin(ang) * p.x + cos(ang) * p.y);}
Point rot90(Point p) {return Point(-p.y, p.x);}
double cross(Point p, Point q) {return p.x * q.y - p.y * q.x;}
double dot(Point p, Point q) {return p.x * q.x + p.y * q.y;}
double norm(Point p) {return dot(p, p);}
double abs(Point p) {return sqrt(dot(p, p));}
bool eq(Point p, Point q) {return abs(p - q) < EPS;}
Point operator / (Point p, Point q) {return p * conj(q) / norm(q);}
double amp(Point p) {double res = atan2(p.y, p.x); if (res < 0) res += PI*2; return res;}

    

struct Line : vector<Point> {
    Line(Point a = Point(0.0, 0.0), Point b = Point(0.0, 0.0)) {
        this->push_back(a);
        this->push_back(b);
    }
};


struct Circle : Point{
    double r;
    Circle(Point p = Point(0.0, 0.0), double r = 0.0) : Point(p), r(r) {}
};


typedef vector<Point> Polygon;
Point next(const Polygon &a, int x) {return a[(x+1)%a.size()];}
Point prev(const Polygon &a, int x) {return a[(x-1+a.size())%a.size()];}

vector<Point> crosspoint(Circle e, Circle f) {
    vector<Point> res;
    double d = abs(e - f);
    if (d < EPS) return vector<Point>();
    double rcos = (d * d + e.r * e.r - f.r * f.r) / (2.0 * d);
    double rsin = sqrt(e.r * e.r - rcos * rcos);
    Point dir = (f - e) / d;
    Point p1 = e + dir * Point(rcos, rsin);
    Point p2 = e + dir * Point(rcos, -rsin);
    res.push_back(p1);
    if (!eq(p1, p2)) res.push_back(p2);
    return res;
}


int main() {
    //freopen( "/Users/macuser/Documents/Programming/Contest/input.in", "r", stdin );
    
    int N, Q;
    double R;
    while (cin >> N >> R >> Q) {
        if (N == 0) break;
        
        Polygon pol(N);
        Circle C(Point(0,0), R);
        
        double x, y;
        int ind = -1;
        
        for (int i = 0; i < N; ++i) {
            cin >> x >> y;
            pol[i].x = x;
            pol[i].y = y;
            
            double dis = abs(pol[i]);
            
            if (eq(dis,R)) ind = i;
        }
        
        int nind = -1, pind = -1;
        for (int id = 0; id < Q; ++id) {
            double nindang = INF;
            
            for (int i = 0; i < N; ++i) {
                if (i == ind) continue;
                double dis = abs(pol[i] - pol[ind]);
                
                Circle alt(pol[ind], dis);
                vector<Point> res = crosspoint(alt, C);
                
                for (int j = 0; j < res.size(); ++j) {
                    Point rot = (res[j] - pol[ind]) / (pol[i] - pol[ind]);
                    double ang = amp(rot);
                
                    //cout << i << ", " << pol[i] << " , " << dis << ", " << res[j] << ", " << rot << ", " << todeg(ang) << endl;
                
                    if (ang < nindang + EPS && ang < torad(180) - EPS && ang > EPS) {
                        if (abs(ang - nindang) < EPS) {
                            if ((i-ind+N)%N < (nind-ind+N)%N) {
                                nind = i;
                                nindang = ang;
                            }
                        }
                        else {
                            nind = i;
                            nindang = ang;
                        }
                    }
                }
                
            }
             
            for (int i = 0; i < N; ++i) {
                pol[i] = pol[ind] + rot(pol[i] - pol[ind], nindang);
            }
            pind = ind;
            ind = nind;
            
//            COUT(pol);
//            COUT(pind);
//            COUT(ind);
//            COUT(todeg(nindang));
            
            cout << fixed << setprecision(6);
            cout << pol[ind].x << " " << pol[ind].y << endl;
        }
        //cout << endl;
    }
    
    return 0;
}