#include <bits/stdc++.h>
const int INF = 1e9 + 7;
const double EPS = 1e-9;
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int N = 2e5 + 9;
const int maxn = 1e6 + 7;
using namespace std;
inline void time() { cerr << (clock() * 1.0 / CLOCKS_PER_SEC * 1.0); }
int n, A, B;
int main() {
  int u = 0, v = 0;
  cin >> n >> A >> B;
  for (int k = 0; k <= n; ++k) {
    if (n < k * A) break;
    if (!((n - k * A) % B)) {
      u = k;
      v = (n - k * A) / B;
      break;
    }
  }
  if (u == 0 && v == 0)
    cout << "-1";
  else {
    for (int i = 1; i <= u; i++)
      for (int j = 1; j <= A; j++) cout << (i - 1) * A + j % A + 1 << " ";
    for (int i = 1; i <= v; i++)
      for (int j = 1; j <= B; j++)
        cout << u * A + (i - 1) * B + j % B + 1 << " ";
  }
  return 0;
}
