#include <bits/stdc++.h>
using namespace std;
double a, d;
int n;
void print_coord(double s) {
  if (s <= a) {
    printf("%.8lf %.8lf", s, 0.0);
  } else if (s <= 2.0 * a) {
    printf("%.8lf %.8lf", a, s - a);
  } else if (s <= 3.0 * a) {
    printf("%.8lf %.8lf", a - (s - 2.0 * a), a);
  } else if (s <= 4.0 * a + 1e-6) {
    printf("%.8lf %.8lf", 0.0, a - (s - 3.0 * a));
  } else {
    assert(false);
  }
}
void solve(double start, int n) {
  while (n > 0) {
    start += d;
    start = fmod(start, 4.0 * a);
    print_coord(start);
    printf("\n");
    --n;
  }
}
int main() {
  cin >> a >> d;
  cin >> n;
  solve(0.0, n);
}
