#include <bits/stdc++.h>
using namespace std;
double a, d;
int n;
void add(int &id, double &dis) {
  int ret = (int)(d / a) % 4;
  double num = ((d / a) - (int)(d / a)) * a;
  id = (id + ret) % 4;
  dis += num;
  if (dis > a) {
    id = (id + 1) % 4;
    dis -= a;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  while (cin >> a >> d) {
    cin >> n;
    int id = 0;
    double dis = 0.0;
    for (int i = (1); i <= (n); i++) {
      add(id, dis);
      if (id == 0) printf("%.6f %.6f\n", dis, 0.0);
      if (id == 1) printf("%.6f %.6f\n", a, dis);
      if (id == 2) printf("%.6f %.6f\n", a - dis, a);
      if (id == 3) printf("%.6f %.6f\n", 0.0, a - dis);
    }
  }
  return 0;
}
