#include <bits/stdc++.h>
#pragma GCC optimize "O2"
using namespace std;
const unsigned long long int MOD = 1000000007;
const long double PI = 2 * acos(0.0);
vector<long long int> ga(long long int n) {
  vector<long long int> a;
  for (long long int i = 0; i < n; i++) {
    long long int p;
    cin >> p;
    a.push_back(p);
  }
  return move(a);
}
vector<unsigned long long int> gau(unsigned long long int n) {
  vector<unsigned long long int> a;
  for (unsigned long long int i = 0; i < n; i++) {
    unsigned long long int p;
    cin >> p;
    a.push_back(p);
  }
  return move(a);
}
vector<string> gas(unsigned long long int n) {
  vector<string> a;
  for (unsigned long long int i = 0; i < n; i++) {
    string p;
    cin >> p;
    a.push_back(p);
  }
  return move(a);
}
template <typename T, typename A>
void pa(vector<T, A> const &a) {
  for (T p : a) {
    cout << p << " ";
  }
  cout << "\n";
}
void yes() { cout << "YES\n"; }
void no() { cout << "NO\n"; }
void yesno(int f) {
  if (f)
    yes();
  else
    no();
}
void printpos(long double dist, unsigned long long int mode, long double a) {
  switch (mode) {
    case 0:
      cout << fixed << setprecision(10) << dist << " 0";
      break;
    case 1:
      cout << fixed << setprecision(10) << a << " " << dist;
      break;
    case 2:
      cout << fixed << setprecision(10) << (a - dist) << " " << a;
      break;
    case 3:
      cout << fixed << setprecision(10) << "0 " << (a - dist);
      break;
  }
  cout << endl;
}
void solve() {
  long double a, d;
  cin >> a >> d;
  unsigned long long int n;
  cin >> n;
  unsigned long long int mode = 0;
  while (d > 4 * a) {
    d -= 4 * a;
  }
  long double d2 = d;
  while (d2 > a) {
    d2 -= a;
    mode++;
    mode %= 4;
  }
  for (unsigned long long int i = 1; i <= n; i++) {
    printpos(d2, mode, a);
    d2 += d;
    while (d2 > a) {
      d2 -= a;
      mode++;
      mode %= 4;
    }
  }
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
