#include <bits/stdc++.h>
using namespace std;
const int inf = 0x1f1f1f1f;
int main() {
  int i, n;
  double a, d, b, t;
  while (scanf("%lf%lf%d", &a, &d, &n) != -1) {
    b = a * 4;
    while (d >= b) d -= b;
    t = 0;
    for (i = 1; i <= n; i++) {
      t += d;
      while (t >= b) t -= b;
      if (t <= a)
        printf("%.10f 0.0000000000\n", t);
      else if (t <= a * 2)
        printf("%.10f %.10f\n", a, t - a);
      else if (t <= 3 * a)
        printf("%.10f %.10f\n", a - (t - 2 * a), a);
      else
        printf("0.0000000000 %.10f\n", a - (t - a * 3));
    }
  }
  return 0;
}
