#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-12;
int main() {
  double a, d;
  scanf("%lf%lf", &a, &d);
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    double res = fmod(i * d, 4 * a);
    if (res > 0 - eps && res < a + eps)
      printf("%.10f %.10f\n", res, (double)0);
    else if (res > a - eps && res < 2 * a + eps)
      printf("%.10f %.10f\n", a, res - a);
    else if (res > 2 * a - eps && res < 3 * a + eps)
      printf("%.10f %.10f\n", a - (res - 2 * a), a);
    else
      printf("%.10f %.10f\n", (double)0, a - (res - 3 * a));
  }
  return 0;
}
