#include <bits/stdc++.h>
using namespace std;
const int eps = 1e-8;
double a, d;
int n;
void out(double x, double y) {
  printf("%8f %8f\n", x, y);
  return;
}
void dfs(int &now, double &x, double &y, double lef) {
  if (now == 0) {
    if (x + lef > a + eps) {
      lef -= a - x;
      x = a;
      dfs(now = 1, x, y, lef);
    } else {
      x += lef;
      out(x, y);
    }
    return;
  }
  if (now == 1) {
    if (y + lef > a + eps) {
      lef -= a - y;
      y = a;
      dfs(now = 2, x, y, lef);
    } else {
      y += lef;
      out(x, y);
    }
    return;
  }
  if (now == 2) {
    if (lef > x + eps) {
      lef -= x;
      x = 0;
      dfs(now = 3, x, y, lef);
    } else {
      x -= lef;
      out(x, y);
    }
    return;
  }
  if (now == 3) {
    if (lef > y + eps) {
      lef -= y;
      y = 0;
      dfs(now = 0, x, y, lef);
    } else {
      y -= lef;
      out(x, y);
    }
  }
}
int main() {
  cin >> a >> d >> n;
  d -= 4 * a * ((int)floor(d / (a * 4)));
  int now = 0;
  double x = 0, y = 0;
  while (n--) {
    dfs(now, x, y, d);
  }
  return 0;
}
