#include <bits/stdc++.h>
using namespace std;
int N;
double a, d;
pair<double, double> get(double l, int k) {
  if (k == 0) {
    return make_pair(l, 0.0);
  }
  if (k == 1) {
    return make_pair(a, l);
  }
  if (k == 2) {
    return make_pair(a - l, a);
  }
  return make_pair(0.0, a - l);
}
int main() {
  scanf("%lf %lf", &a, &d);
  cin >> N;
  double r = 0.0;
  for (int i = 0; i < N; i++) {
    double s = (d + r);
    int m = (int)(s / a);
    r = s - (m * a);
    pair<double, double> p = get(r, m % 4);
    printf("%.10lf %.10lf\n", p.first, p.second);
    r = (m % 4) * a + r;
  }
  return 0;
}
