#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-9;
double a, n, d;
pair<double, double> first(double second) {
  long long k = (long long)(second / (4.0 * a));
  second -= k * 4.0 * a;
  if (second < a + eps) {
    return make_pair(second, 0);
  } else if (second < a + a + eps) {
    return make_pair(a, second - a);
  } else if (second < a + a + a + eps) {
    return make_pair(a + a + a - second, a);
  } else
    return make_pair(0, a + a + a + a - second);
}
int main() {
  cin >> a >> d >> n;
  for (int i = 1; i <= n; i++) {
    pair<double, double> p = first(i * d);
    printf("%.6lf %.6lf\n", p.first, p.second);
  }
  return 0;
}
