#include <bits/stdc++.h>
using namespace std;
const int rx[] = {0, -1, 0, 1, -1, 1, 1, -1};
const int cy[] = {1, 0, -1, 0, 1, 1, -1, -1};
double a, d;
int n;
int chk(double x, double y) {
  if ((x >= 0 && x <= a) && (y == 0))
    return 1;
  else if ((x == a) && (y >= 0 && y <= a))
    return 2;
  else if ((x >= 0 && x <= a) && (y == a))
    return 3;
  else if (x == 0 && (y >= 0 && y <= a))
    return 4;
  else if ((x > a) && (y == 0))
    return 5;
  else if (x == a && y > a)
    return 6;
  else if (y == a && x < 0)
    return 7;
  else if (x == 0 && y < 0)
    return 8;
  return 0;
}
int main() {
  cin >> a >> d >> n;
  while (d >= 4 * a) {
    d -= (4 * a);
  }
  double x = 0, y = 0;
  double nx, ny;
  int dir;
  for (int i = 0; i < n; i++) {
    dir = chk(x, y);
    if (dir == 1) {
      nx = x + d;
      ny = y;
    } else if (dir == 2) {
      nx = x;
      ny = y + d;
    } else if (dir == 3) {
      nx = x - d;
      ny = y;
    } else {
      nx = x;
      ny = y - d;
    }
    x = nx, y = ny;
    while (1) {
      dir = chk(x, y);
      if (dir > 0 && dir < 5) {
        printf("%.10lf %.10lf\n", x, y);
        break;
      }
      if (dir == 5) {
        ny = 0 + (x - a);
        nx = a;
      } else if (dir == 6) {
        ny = a;
        nx = a - (y - a);
      } else if (dir == 7) {
        nx = 0;
        ny = a - (0 - x);
      } else {
        ny = 0;
        nx = 0 + (0 - y);
      }
      x = nx;
      y = ny;
    }
  }
  return 0;
}
