#include <bits/stdc++.h>
int main() {
  double a, d, p, q, r, s, dist, p1, q1, r1, s1;
  double x, y;
  int n;
  unsigned long long int z, k, z1;
  int i, j;
  scanf("%lf %lf", &a, &d);
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    dist = i * d;
    p = dist / a;
    z1 = dist / a;
    r1 = dist - (z1 * a);
    z = p / 4;
    r = p - (4 * z);
    s = ceil(r);
    k = s;
    if (k == 1) {
      y = 0;
      if (r1 == 0)
        x = a;
      else
        x = r1;
    } else if (k == 2) {
      x = a;
      if (r1 == 0)
        y = a;
      else
        y = r1;
    } else if (k == 3) {
      y = a;
      if (r1 == 0)
        x = 0;
      else
        x = a - r1;
    } else {
      x = 0;
      if (r1 == 0)
        y = 0;
      else
        y = a - r1;
    }
    printf("%.10lf %.10lf\n", x, y);
  }
  return 0;
}
