#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAX = 300010;
vector<int> primes, p;
int main() {
  double a, d;
  int n;
  cin >> a >> d >> n;
  double perimeter = 4 * a;
  double x = 0, y = 0;
  int pos = 1;
  int dd = d / perimeter;
  double per = d - (dd * perimeter);
  cout << fixed << setprecision(10);
  for (size_t i = 0; i < n; i++) {
    if (pos == 1) {
      x += per;
      if (x >= a) {
        y = x - a;
        x = a;
        pos = 2;
        if (y >= a) {
          x = a - (y - a);
          y = a;
          pos = 3;
          if (x <= 0) {
            x = -x;
            y = a - x;
            x = 0;
            pos = 4;
            if (y <= 0) {
              y = -y;
              x = y;
              y = 0;
              pos = 1;
            }
          }
        }
      }
    } else if (pos == 2) {
      y += per;
      if (y >= a) {
        x = a - (y - a);
        y = a;
        pos = 3;
        if (x <= 0) {
          x = -x;
          y = a - x;
          x = 0;
          pos = 4;
          if (y <= 0) {
            y = -y;
            x = y;
            y = 0;
            pos = 1;
            if (x >= a) {
              y = x - a;
              x = a;
              pos = 2;
            }
          }
        }
      }
    } else if (pos == 3) {
      x -= per;
      if (x <= 0) {
        x = -x;
        y = a - x;
        x = 0;
        pos = 4;
        if (y <= 0) {
          y = -y;
          x = y;
          y = 0;
          pos = 1;
          if (x >= a) {
            y = x - a;
            x = a;
            pos = 2;
            if (y >= a) {
              x = a - (y - a);
              y = a;
              pos = 3;
            }
          }
        }
      }
    } else if (pos == 4) {
      y -= per;
      if (y <= 0) {
        y = -y;
        x = y;
        y = 0;
        pos = 1;
        if (x >= a) {
          y = x - a;
          x = a;
          pos = 2;
          if (y >= a) {
            x = a - (y - a);
            y = a;
            pos = 3;
            if (x <= 0) {
              x = -x;
              y = a - x;
              x = 0;
              pos = 4;
            }
          }
        }
      }
    }
    cout << x << " " << y << endl;
  }
}
