#include <bits/stdc++.h>
double a, d;
int n;
int main() {
  scanf("%lf %lf", &a, &d);
  scanf("%d", &n);
  double x = 0, y = 0, dis = fmod(d, 4 * a);
  int dir = 0;
  for (int i = 1; i <= n; i++) {
    double tdis = dis;
    while (tdis > 10e-6) {
      if (dir == 0) {
        if (tdis - (a - x) > 10e-6) {
          tdis -= (a - x);
          x = a;
          dir++;
        } else {
          x += tdis;
          tdis = 0.0;
        }
      } else if (dir == 1) {
        if (tdis - (a - y) > 10e-6) {
          tdis -= (a - y);
          y = a;
          dir++;
        } else {
          y += tdis;
          tdis = 0.0;
        }
      } else if (dir == 2) {
        if ((tdis - x) > 10e-6) {
          tdis -= x;
          x = 0;
          dir++;
        } else {
          x -= tdis;
          tdis = 0.0;
        }
      } else {
        if ((tdis - y) > 10e-6) {
          tdis -= y;
          y = 0;
          dir = 0;
        } else {
          y -= tdis;
          tdis = 0.0;
        }
      }
    }
    printf("%.10lf %.10lf\n", x, y);
  }
}
