#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, d, t, c1 = 0, c2 = 0;
  int i, j, k = 1, p = 1, n, x = 1;
  scanf("%lf%lf%d", &a, &d, &n);
  while (d - 4 * a >= 0) d -= 4 * a;
  for (i = 1; i <= n; ++i) {
    t = d;
    while (1) {
      if (x) {
        if (p) {
          if (a - c1 >= t) {
            c1 += t;
            break;
          } else {
            p = 0;
            t -= (a - c1);
            c1 = a;
            x = 0;
          }
        } else {
          if (c1 >= t) {
            c1 -= t;
            break;
          } else {
            p = 1;
            t -= c1;
            c1 = 0;
            x = 0;
          }
        }
      } else {
        if (k) {
          if (a - c2 >= t) {
            c2 += t;
            break;
          } else {
            k = 0;
            t -= (a - c2);
            c2 = a;
            x = 1;
          }
        } else {
          if (c2 >= t) {
            c2 -= t;
            break;
          } else {
            k = 1;
            t -= c2;
            c2 = 0;
            x = 1;
          }
        }
      }
    }
    printf("%lf %lf\n", c1, c2);
  }
  return 0;
}
