#include <bits/stdc++.h>
int main() {
  double a, d;
  long long n;
  scanf("%lf %lf %lld", &a, &d, &n);
  for (long long i = 1; i <= n; i++) {
    long long cycle = (i * d) / (4 * a);
    double cover = (i * d) - (4 * a * cycle);
    if (cover <= a)
      printf("%.10lf 0.0000000000\n", cover);
    else if (cover <= 2 * a)
      printf("%.10lf %.10lf\n", a, cover - a);
    else if (cover <= 3 * a)
      printf("%.10lf %.10lf\n", 3 * a - cover, a);
    else
      printf("0.0000000000 %.10lf\n", 4 * a - cover);
  }
  return 0;
}
