#include <bits/stdc++.h>
using namespace std;
const int INF = 999999999;
const double eps = 1e-8;
double ch[100010];
int main() {
  double a, d;
  int n;
  while (~scanf("%lf %lf", &a, &d)) {
    scanf("%d", &n);
    double sum = 0.0;
    long long x;
    for (int i = 1; i <= n; i++) {
      ch[i] = d * i;
      if (ch[i] > 4 * a) {
        x = (long long)(ch[i] / (4 * a));
        ch[i] = ch[i] - x * 1.0 * 4 * a;
      }
    }
    for (int i = 1; i <= n; i++) {
      if (ch[i] >= 0 && ch[i] <= a)
        printf("%.9lf %.9lf\n", ch[i], sum);
      else if (ch[i] > a && ch[i] <= 2 * a)
        printf("%.9lf %.9lf\n", a, ch[i] - a);
      else if (ch[i] > 2 * a && ch[i] <= 3 * a)
        printf("%.9lf %.9lf\n", 3 * a - ch[i], a);
      else if (ch[i] > 3 * a && ch[i] <= 4 * a)
        printf("%.9lf %.9lf\n", sum, 4 * a - ch[i]);
    }
  }
  return 0;
}
