#include <bits/stdc++.h>
using namespace std;
int n, a, b;
int main() {
  ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  cin >> n >> a >> b;
  if (a == 1 || b == 1) {
    for (int i = 1; i <= n; ++i) cout << i << " ";
    cout << "\n";
    return 0;
  }
  int f = -1;
  for (int i = 0; i * a <= n; ++i)
    if ((n - (i * a)) % b == 0) {
      f = i;
      break;
    }
  if (f == -1) return cout << -1 << "\n", 0;
  int i;
  for (i = 1; i <= f * a; i += a) {
    cout << i + a - 1 << " ";
    for (int j = i + 1; j < i + a; ++j) cout << j - 1 << " ";
  }
  for (; i <= n; i += b) {
    cout << i + b - 1 << " ";
    for (int j = i + 1; j < i + b; ++j) cout << j - 1 << " ";
  }
  cout << "\n";
}
