#include <bits/stdc++.h>
using namespace std;
int main(void) {
  double a, b;
  scanf("%lf%lf", &a, &b);
  double c = b - int(b / (4 * a)) * (4 * a);
  int n;
  scanf("%d", &n);
  double x = 0.0;
  double y = 0.0;
  double tmp = c;
  for (int i = 0; i < n; ++i) {
    while (c) {
      double add = c;
      if (y == 0.0 && x != a) {
        add = min(a - x, add);
        x += add;
      } else if (x == a && y != a) {
        add = min(a - y, add);
        y += add;
      } else if (y == a && x != 0) {
        add = min(x, add);
        x -= add;
      } else if (x == 0) {
        add = min(y, add);
        y -= add;
      }
      c -= add;
    }
    c = tmp;
    printf("%f %f\n", x, y);
  }
  return 0;
}
