#include <bits/stdc++.h>
using namespace std;
const int MOD(1000000007);
const int INF((1 << 30) - 1);
const int MAXN();
int main() {
  int n;
  string A, D;
  cin >> A >> D >> n;
  int chk = 0, cnt = 0;
  long long a = 0, d = 0;
  for (int i = 0; i < A.size(); i++) {
    if (chk) cnt++;
    if (A[i] == '.')
      chk = 1;
    else
      a = a * 10ll + (A[i] - '0');
  }
  while (cnt < 4) {
    a *= 10ll;
    cnt++;
  }
  chk = 0, cnt = 0;
  for (int i = 0; i < D.size(); i++) {
    if (chk) cnt++;
    if (D[i] == '.')
      chk = 1;
    else
      d = d * 10ll + (D[i] - '0');
  }
  while (cnt < 4) {
    d *= 10ll;
    cnt++;
  }
  long long now = 0;
  for (int i = 0; i < n; i++) {
    now += d;
    now %= 4 * a;
    if (now < a)
      printf("%lf 0.000000", (double)(now) / 10000.0);
    else if (now < 2 * a)
      printf("%lf %lf", (double)(a) / 10000.0, (double)(now - a) / 10000.0);
    else if (now < 3 * a)
      printf("%lf %lf", (double)(a - (now - 2 * a)) / 10000.0,
             (double)(a) / 10000.0);
    else
      printf("0.000000 %lf", (double)(a - (now - 3 * a)) / 10000.0);
    printf("\n");
  }
}
