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