#include <bits/stdc++.h>
using namespace std;
double a, d;
void calc2(double &x, double &y, double h, int i) {
  switch (i) {
    case 0:
      x = h;
      y = 0.0;
      break;
    case 1:
      y = h;
      x = a;
      break;
    case 2:
      x = a - h;
      y = a;
      break;
    case 3:
      y = a - h;
      x = 0.0;
      break;
  }
  return;
}
double calc1(double v, int &i) {
  int fl = (int)floor((v + d) / a);
  i = (i + fl) % 4;
  double ret = (((v + d) / a) - (double)fl) * a;
  return ret;
}
int main() {
  int n, m, fl;
  double x, y, h;
  scanf("%lf%lf%d", &a, &d, &n);
  int i = 0;
  x = y = 0.0;
  for (int j = 0; j < n; ++j) {
    switch (i) {
      case 0:
        h = calc1(x, i);
        calc2(x, y, h, i);
        break;
      case 1:
        h = calc1(y, i);
        calc2(x, y, h, i);
        break;
      case 2:
        h = calc1(a - x, i);
        calc2(x, y, h, i);
        break;
      case 3:
        h = calc1(a - y, i);
        calc2(x, y, h, i);
        break;
    }
    printf("%.10f %.10f\n", x, y);
  }
  return 0;
}
