#include <bits/stdc++.h>
using namespace std;
void print(long double x, long double y) {
  cout << fixed << setprecision(15) << x << " " << y << endl;
}
void solve() {
  long double a, d;
  cin >> a >> d;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long double rem = fmod((i + 1) * d, 4 * a);
    if (rem >= 3 * a) {
      print(0, a - (rem - 3 * a));
    } else if (rem >= 2 * a) {
      print(a - (rem - 2 * a), a);
    } else if (rem >= 1 * a) {
      print(a, rem - a);
    } else if (rem >= 0) {
      print(rem, 0);
    }
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
