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