#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, d;
  int n, i, j, k;
  cin >> a >> d;
  cin >> n;
  double dist, x, y;
  x = y = dist = 0.0;
  i = 1;
  dist = d;
  while (i <= n) {
    dist = fmod(dist, 4 * a);
    if (dist <= a && i <= n) {
      y = 0;
      x = dist;
    } else if (dist <= 2 * a) {
      x = a;
      y = dist - a;
    } else if (dist <= 3 * a) {
      y = a;
      x = 3 * a - dist;
    } else {
      x = 0.0;
      y = 4 * a - dist;
    }
    printf("%0.10lf %0.10lf\n", x, y);
    dist += d;
    i++;
  }
  return 0;
}
