#include <bits/stdc++.h>
int main() {
  double a, d, posx, posy, dd;
  int n, con;
  while (scanf("%lf%lf%d", &a, &dd, &n) != EOF) {
    con = 1;
    posx = posy = 0;
    while (dd >= 4 * a) dd -= 4 * a;
    d = dd;
    while (n--) {
      switch (con) {
        case 1: {
          if (posx + d <= a) {
            posx += d;
            printf("%.10f %.10f\n", posx, posy);
            d = dd;
          } else {
            d -= a - posx;
            posx = a;
            n++;
            con++;
          }
          break;
        }
        case 2: {
          if (posy + d <= a) {
            posy += d;
            printf("%.10f %.10f\n", posx, posy);
            d = dd;
          } else {
            d -= a - posy;
            posy = a;
            n++;
            con++;
          }
          break;
        }
        case 3: {
          if (posx - d >= 0) {
            posx -= d;
            printf("%.10f %.10f\n", posx, posy);
            d = dd;
          } else {
            d -= posx;
            posx = 0;
            n++;
            con++;
          }
          break;
        }
        case 4: {
          if (posy - d >= 0) {
            posy -= d;
            printf("%.10f %.10f\n", posx, posy);
            d = dd;
          } else {
            d -= posy;
            posy = 0;
            n++;
            con = 1;
          }
          break;
        }
      }
    }
  }
  return 0;
}
