#include <bits/stdc++.h>
#pragma comment(linker, "/stack:30000000")
using namespace std;
const int Direct[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}};
const int Nmax = 203330;
double a, d;
int n;
pair<double, double> GetNext(pair<double, double> T) {
  double dd = d;
  int Id;
  if (T.first > 1e-7 && T.first < a - 1e-7) {
    if (abs(T.second) < 1e-7)
      Id = 2;
    else
      Id = 0;
  } else if (abs(T.first) < 1e-7) {
    if (abs(T.second) < 1e-7)
      Id = 2;
    else
      Id = 3;
  } else if (abs(T.second - a) < 1e-7)
    Id = 0;
  else
    Id = 1;
  while (abs(dd) > 1e-7) {
    T.first += Direct[Id][0] * dd;
    T.second += Direct[Id][1] * dd;
    dd = 0;
    if (T.first < -1e-7)
      dd = abs(T.first), T.first = 0;
    else if (T.second < -1e-7)
      dd = abs(T.second), T.second = 0;
    else if (T.first > a + 1e-7)
      dd = abs(T.first - a), T.first = a;
    else if (T.second > a + 1e-7)
      dd = abs(T.second - a), T.second = a;
    Id--;
    if (Id < 0) Id = 3;
  }
  return T;
}
int main() {
  cin >> a >> d >> n;
  double FullLen = 4 * a;
  int kol = (int)(d / FullLen);
  d -= kol * FullLen;
  pair<double, double> Coords = make_pair(0, 0);
  cout.precision(7);
  for (int i = 1; i <= n; i++) {
    Coords = GetNext(Coords);
    printf("%0.7lf %0.7lf\n", Coords.first, Coords.second);
  }
  return 0;
}
