#include <bits/stdc++.h>
using namespace std;
double a, d;
double nowx = 0, nowy = 0;
int pos = 0;
int n;
int dcmp(double x) {
  if (fabs(x) < 1e-8)
    return 0;
  else
    return x > 0 ? 1 : -1;
}
void Run(double len) {
  while (len > 0) {
    if (pos == 0) {
      double tmp = min(a - nowx, len);
      nowx += tmp;
      len -= tmp;
      if (dcmp(nowx - a) == 0) pos = 1;
      continue;
    }
    if (pos == 1) {
      double tmp = min(a - nowy, len);
      nowy += tmp;
      len -= tmp;
      if (dcmp(nowy - a) == 0) pos = 2;
      continue;
    }
    if (pos == 2) {
      double tmp = min(nowx, len);
      nowx -= tmp;
      len -= tmp;
      if (dcmp(nowx) == 0) pos = 3;
      continue;
    }
    if (pos == 3) {
      double tmp = min(nowy, len);
      nowy -= tmp;
      len -= tmp;
      if (dcmp(nowy) == 0) pos = 0;
      continue;
    }
  }
}
int main() {
  scanf("%lf%lf", &a, &d);
  scanf("%d", &n);
  int cut = d / (4 * a);
  d -= cut * 4 * a;
  for (int i = 1; i <= n; ++i) {
    Run(d);
    printf("%lf %lf\n", nowx, nowy);
  }
  return 0;
}
