#include <bits/stdc++.h>
using namespace std;
int a[1000][1000];
int main() {
  double a, d;
  int n, fl = 1;
  scanf("%lf%lf", &a, &d);
  scanf("%i", &n);
  while (d > a * 4) d -= a * 4;
  double x = 0, y = 0;
  for (int i = 1; i <= n; i++) {
    double dl = d;
    while (dl > 0) {
      if (fl == 1) {
        if (x + dl > a) {
          dl -= a - x;
          x = a;
          y = 0;
          fl = 2;
        } else {
          x += dl;
          dl = 0;
        }
      }
      if (fl == 2) {
        if (y + dl > a) {
          dl -= a - y;
          y = a;
          fl = 3;
        } else {
          y += dl;
          dl = 0;
        }
      }
      if (fl == 3) {
        if (x - dl < 0) {
          dl -= x;
          x = 0;
          fl = 4;
        } else {
          x -= dl;
          dl = 0;
        }
      }
      if (fl == 4) {
        if (y - dl < 0) {
          dl -= y;
          y = 0;
          fl = 1;
        } else {
          y -= dl;
          dl = 0;
        }
      }
    }
    printf("%lf %lf\n", x, y);
  }
  return 0;
}
