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