#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, m;
  while (~scanf("%lf%lf", &n, &m)) {
    int i, t, q = 0;
    double d = 0;
    scanf("%d", &t);
    while (t--) {
      double x, y;
      double p = (d + m) / n;
      q = ((int)p + q) % 4;
      if (q == 0) {
        x = d + m - (n * (int)p);
        y = 0;
        d = x;
      } else if (q == 1) {
        y = d + m - (n * (int)p);
        x = n;
        d = y;
      } else if (q == 2) {
        x = n - ((d + m) - (n * (int)p));
        y = n;
        d = n - x;
      } else {
        y = n - ((d + m) - (n * (int)p));
        x = 0;
        d = n - y;
      }
      printf("%lf %lf\n", x, y);
    }
  }
  return 0;
}
