#include <bits/stdc++.h>
using namespace std;
double a, d;
void work(double &x, double &y, int &p) {
  int c = (d / (a * 4.0));
  double dis = d - c * (4.0 * a);
  while (dis > 1e-8) {
    if (p == 0) {
      double g = min(x + dis, a);
      dis -= (g - x);
      x = g;
      if (g == a) p++;
    } else if (p == 1) {
      double g = min(y + dis, a);
      dis -= (g - y);
      y = g;
      if (g == a) p++;
    } else if (p == 2) {
      double g = max(0.0, x - dis);
      dis -= (x - g);
      x = g;
      if (g == 0) p++;
    } else {
      double g = max(0.0, y - dis);
      dis -= (y - g);
      y = g;
      if (g == 0) p++;
    }
    while (p >= 4) p -= 4;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  double x = 0, y = 0;
  int p = 0;
  scanf("%lf %lf", &a, &d);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    work(x, y, p);
    printf("%f %f\n", x, y);
  }
  return 0;
}
