#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MN = 2e6 + 7;
const double eps = 1e-8;
const int e[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
double n, d;
int tt;
int main() {
  scanf("%lf%lf", &n, &d);
  scanf("%d", &tt);
  double x = 0, y = 0;
  d = fmod(d, 4 * n);
  int di = 0;
  while (tt--) {
    double left = d;
    double u = x + d * e[di][0];
    double v = y + d * e[di][1];
    while (!(0 <= u && u <= n && 0 <= v && v <= n)) {
      if (u > n) {
        left -= n - x;
        u = n;
        di = (di + 1) % 4;
      }
      if (u < 0) {
        left -= x - 0;
        u = 0;
        di = (di + 1) % 4;
      }
      if (v > n) {
        left -= n - y;
        v = n;
        di = (di + 1) % 4;
      }
      if (v < 0) {
        left -= y - 0;
        v = 0;
        di = (di + 1) % 4;
      }
      if (left < eps) break;
      x = u;
      y = v;
      u += left * e[di][0];
      v += left * e[di][1];
    }
    printf("%.6lf %.6lf\n", u, v);
    x = u;
    y = v;
  }
  return 0;
}
