#include <bits/stdc++.h>
using namespace std;
double a, d;
int n;
double x, y;
int main() {
  cin >> a >> d >> n;
  int m = 1;
  double len = 0;
  while (m <= n) {
    len += d;
    int p = (int)(len / (4 * a));
    len -= p * 4 * a;
    int s = (int)(len / a);
    int k = (int)(len / a) % 4;
    if (k == 0) {
      x = len - s * a;
      y = 0;
    } else if (k == 1) {
      x = a;
      y = len - s * a;
    } else if (k == 2) {
      x = a - len + s * a;
      y = a;
    } else {
      x = 0;
      y = a - len + s * a;
    }
    printf("%.10lf %.10lf\n", x, y);
    m++;
  }
  return 0;
}
