#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 5;
int n, okt, dv;
double d, a, tl = 0., cr;
void inc(int cnt = 1) {
  okt += cnt;
  okt %= 4;
}
int main() {
  scanf("%lf%lf%d", &a, &d, &n);
  for (int i = 1; i <= (n); i++) {
    cr = (tl + d);
    if (cr > a) {
      dv = cr / a;
      cr -= dv * a;
      inc(dv);
    }
    tl = cr;
    switch (okt) {
      case 0:
        printf("%.4lf %.4lf\n", tl, 0.0);
        break;
      case 1:
        printf("%.4lf %.4lf\n", a, tl);
        break;
      case 2:
        printf("%.4lf %.4lf\n", a - tl, a);
        break;
      case 3:
        printf("%.4lf %.4lf\n", 0.0, a - tl);
        break;
      default:
        break;
    }
  }
  return 0;
}
