#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, d, x = 0.0, y = 0.0, dx = 1.0, dy = 0.0;
  int n;
  scanf("%lf%lf%d", &a, &d, &n);
  d -= 4. * a * floor(.25 * d / a);
  for (int i = 0; i < n; ++i) {
    x += dx * d;
    y += dy * d;
    if (x > a) {
      dx = 0;
      dy = 1;
      y += x - a;
      x = a;
    }
    if (y > a) {
      dy = 0;
      dx = -1;
      x -= y - a;
      y = a;
    }
    if (x < 0) {
      dx = 0;
      dy = -1;
      y += x;
      x = 0;
    }
    if (y < 0) {
      dy = 0;
      dx = 1;
      x -= y;
      y = 0;
    }
    if (x > a) {
      dx = 0;
      dy = 1;
      y += x - a;
      x = a;
    }
    if (y > a) {
      dy = 0;
      dx = -1;
      x -= y - a;
      y = a;
    }
    if (x < 0) {
      dx = 0;
      dy = -1;
      y += x;
      x = 0;
    }
    if (y < 0) {
      dy = 0;
      dx = 1;
      x -= y;
      y = 0;
    }
    printf("%.5lf %.5lf\n", x, y);
  }
  return 0;
}
