#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, d;
  int n;
  int ar[4][2];
  double v[4][2];
  memset(ar, 0, sizeof(ar));
  while (cin >> a >> d >> n) {
    ar[0][1] = 1, v[0][0] = a, v[0][1] = 0;
    ar[1][0] = 1, v[1][0] = a, v[1][1] = a;
    ar[2][1] = 1, v[2][0] = 0, v[2][1] = a;
    ar[3][0] = 1;
    v[3][0] = 0, v[3][1] = 0;
    double sum = 0;
    double a1 = a * 4;
    for (int i = 0; i < n; ++i) {
      sum += d;
      double x = (sum / a);
      long long x1 = (long long)floor(x);
      x -= (double)x1;
      int mx = (int)(sum / a1);
      sum -= mx * a1;
      x1 %= 4;
      for (int i = 0; i < 2; ++i) {
        if (i) printf(" ");
        if (x1 <= 1) {
          if (ar[x1][i])
            printf("%lf", v[x1][i]);
          else
            printf("%lf", x * a);
        } else {
          if (ar[x1][i])
            printf("%lf", v[x1][i]);
          else
            printf("%lf", a - x * a);
        }
      }
      printf("\n");
    }
  }
  return 0;
}
