#include <bits/stdc++.h>
static int solve(const int tc);
using ll = long long;
int main(int argc, char* argv[]) {
  int tc = 1;
  for (int ic = 1; ic <= tc; ++ic) {
    solve(ic);
  }
  return 0;
}
static constexpr int MOD = 998244353;
static int solve(const int tc) {
  std::vector<std::vector<int> > divs(1 << 18);
  for (int d = 1; d < (1 << 18); ++d) {
    for (int p = d; p < (1 << 18); p += d) divs[p].push_back(d);
  }
  int N, M;
  scanf("%d %d", &N, &M);
  long long L, R;
  scanf("%lld %lld", &L, &R);
  std::set<int> curDivs;
  std::vector<int> cnt(M + 1);
  std::vector<int> id(M + 1, -1);
  long long Lf = M + 1, Rf = M;
  struct answer_t {
    int x1, y1, x2, y2;
  };
  std::vector<answer_t> ans(N + 1, answer_t{-1, -1, -1, -1});
  for (int x1 = 1; x1 <= N; ++x1) {
    long long newLf = (L + x1 - 1) / x1;
    long long newRf = R / x1;
    while (Lf > newLf) {
      --Lf;
      for (int d : divs[Lf]) {
        if (cnt[d] == 0) {
          curDivs.insert(d);
        }
        ++cnt[d];
        id[d] = Lf;
      }
    }
    while (Rf > newRf) {
      for (int d : divs[Rf]) {
        --cnt[d];
        if (cnt[d] == 0) {
          curDivs.erase(d);
        }
      }
      --Rf;
    }
    for (int a : divs[x1]) {
      auto it = curDivs.upper_bound(a);
      if (it == curDivs.end()) continue;
      int b = *it;
      if (x1 / a * 1LL * b <= N) {
        int y1 = id[b];
        ans[x1] = {x1, y1, x1 / a * b, y1 / b * a};
        break;
      }
    }
  }
  for (int i = 1; i <= N; ++i) {
    if (ans[i].x1 == -1) {
      printf("-1\n");
    } else {
      printf("%d %d %d %d\n", ans[i].x1, ans[i].y1, ans[i].x2, ans[i].y2);
    }
  }
  return 0;
}
