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 <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

constexpr double EPS = 1e-9;

struct point {
	double x, y;
	point(double x_ = 0.0, double y_ = 0.0):x(x_), y(y_) {}
	point(const point& p):x(p.x), y(p.y) {}

	point operator+ (const point& p) const {
		return point(x + p.x, y + p.y);
	}

	point operator- (const point& p) const {
		return point(x - p.x, y - p.y);
	}

	point operator* (double s) const {
		return point(x * s, y * s);
	}

	point operator* (const point& p) const {
		return point(x * p.x - y * p.y, x * p.y + y * p.x);
	}

	point operator/ (double s) const {
		return point(x / s, y / s);
	}

	bool operator< (const point& p) const {
		return x + EPS < p.x || (abs(x - p.x) < EPS && y + EPS < p.y);
	}

	bool operator== (const point& p) const {
		return abs(x - p.x) < EPS && abs(y - p.y) < EPS;
	}
};

point rotate(const point& p, double theta) {
	const double s = sin(theta), c = cos(theta);
	return point(c * p.x - s * p.y, s * p.x + c * p.y);
}

double angle(const point& p) {
	return atan2(p.y, p.x);
}

double norm(const point& p) {
	return p.x * p.x + p.y * p.y;
}

double abs(const point& p) {
	return sqrt(norm(p));
}

double dot(const point& a, const point& b) {
	return a.x * b.x + a.y * b.y;
}

double cross(const point& a, const point& b) {
	return a.x * b.y - a.y * b.x;
}

struct circle {
	point c;
	double r;
	circle(point c_, double r_):c(c_), r(r_){}
};

typedef vector<point> polygon;

int ccw(const point& a, point b, point c) {
	b = b - a;
	c = c - a;
	const double tmp = cross(b, c);
	if(tmp > EPS) return 1; // ccw
	if(tmp < -EPS) return -1; // cw
	if(dot(b, c) < 0) return 2; // c, a, b 順に一直線上
	if(norm(b) < norm(c)) return -2; // a, b, c 順に一直線上
	return 0; //a, c, b 順で一直線上
}

bool intersect(const circle& c, const circle& d) {
	return abs(c.c - d.c) < c.r + d.r + EPS && abs(c.c - d.c) + EPS > abs(c.r - d.r);
}

double dist(const point& a, const point& b) {
	return abs(a - b);
}

//先に，intersectを用いて交差判定を行うこと
vector<point> crosspoint(const circle &c, const circle& d) {
	vector<point> res;
	if(abs(c.c - d.c) < EPS) return res; // 中心の座標が同じ

	const double tmp = abs(c.c - d.c);
	const double rc = (tmp * tmp + c.r * c.r - d.r * d.r) / (tmp + tmp);
	const double rs = sqrt(c.r * c.r - rc * rc);
	const point diff = (d.c - c.c) / tmp;
	res.emplace_back(c.c + diff * point(rc, rs));
	res.emplace_back(c.c + diff * point(rc, -rs));
	return res;
}

// 点集合 pointsの凸包を求める．
polygon convex_hull(vector<point> points) {
	const int n = points.size();
	if(n <= 3) return points;

	sort(points.begin(), points.end());
	int k = 0;
	polygon res;
	res.resize(2 * n);
	for(int i = 0; i < n; res[k++] = points[i++]) {
		while(k >= 2 && ccw(res[k - 2], res[k - 1], points[i]) <= 0) --k;
	}

	const int t = k + 1;
	for(int i = n - 2; i >= 0; res[k++] = points[i--]) {
		while(k >= t && ccw(res[k - 2], res[k - 1], points[i]) <= 0) --k;
	}

	res.resize(k - 1);
	return res;
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout.precision(12);
	cout.setf(ios::fixed);

	const point O(0, 0);
	for(int n, r, q; cin >> n >> r >> q && n;) {
		const circle c(O, r);

		polygon plate;
		plate.reserve(n);
		for(int i = 0; i < n; ++i) {
			int x, y;
			cin >> x >> y;
			plate.emplace_back(x, y);
		}

		int tp;
		for(tp = 0; tp < n; ++tp) {
			if(abs(dist(plate[tp], O) - r) < EPS) break;
		}

		while(q--) {
			int next_tp;
			double theta = INT_MAX;

			for(int i = 0; i < n; ++i) {
				if(i == tp) continue;
				const auto cp = crosspoint(c, circle(plate[tp], dist(plate[tp], plate[i])));
				for(const auto &p : cp) {
					if(ccw(plate[tp], O, p) == 1) {
						double phi = angle(p - plate[tp]) - angle(plate[i] - plate[tp]);
						if(phi < EPS) phi += 2 * M_PI;
						if(theta > phi + EPS) {
							next_tp = i;
							theta = phi;
						}
						break;
					}
				}
			}

			for(int i = 0; i < n; ++i) {
				if(i == tp) continue;
				plate[i] = rotate(plate[i] - plate[tp], theta) + plate[tp];
			}

			tp = next_tp;
			cout << plate[tp].x << " " << plate[tp].y << endl;
		}
	}

	return EXIT_SUCCESS;
}