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