#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-9;
int main() {
  double a, d, res, div;
  int n;
  cin >> a >> d >> n;
  double act = 0.0;
  for (int i = 0; i < n; i++) {
    act += d;
    div = floor(act / (4.0 * a));
    res = act - div * a * 4.0;
    if (res - a < EPS)
      printf("%.6lf %.6lf\n", res, 0.0);
    else if (res - 2.0 * a < EPS)
      printf("%.6lf %.6lf\n", a, res - a);
    else if (res - 3.0 * a < EPS)
      printf("%.6lf %.6lf\n", a - (res - 2.0 * a), a);
    else
      printf("%.6lf %.6lf\n", 0.0, a - (res - 3.0 * a));
    act = res;
  }
  return 0;
}
