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