#include <bits/stdc++.h>
double a, d;
int n;
int equal(double a, double b) { return (a - b) < 1e-5 && (b - a) < 1e-5; }
double cx, cy;
void move(double &cx, double &cy, double dt) {
  if (dt <= a) {
    cx = dt;
    cy = 0;
    return;
  }
  if (dt <= 2 * a) {
    cx = a;
    cy = dt - a;
    return;
  }
  if (dt <= 3 * a) {
    cx = a - (dt - 2 * a);
    cy = a;
    return;
  }
  cx = 0;
  cy = a - (dt - 3 * a);
  return;
}
int main() {
  scanf("%lf %lf", &a, &d);
  scanf("%d", &n);
  if (d > 4 * a) {
    d = d - (long)(d / (4 * a)) * (4 * a);
  }
  cx = cy = 0;
  for (int i = 1; i <= n; i++) {
    double dt = d * i;
    dt = dt - (long)(dt / (4 * a)) * (4 * a);
    move(cx, cy, dt);
    printf("%.10lf %.10lf\n", cx, cy);
  }
  return 0;
}
