#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
const int mod = 1e9 + 7;
int p[N], n, l, r, A, B, ans1, ans2;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> A >> B;
  ans1 = ans2 = -1;
  for (int i = 0; i * A <= n; i++) {
    if ((n - i * A) % B == 0) {
      ans1 = i;
      ans2 = (n - i * A) / B;
      break;
    }
  }
  if (ans1 == -1)
    cout << -1;
  else {
    l = 1;
    for (int i = (0); i < (ans1); i++) {
      r = l + A - 1;
      for (int j = (l); j < (r); j++) p[j] = j + 1;
      p[r] = l;
      l += A;
    }
    for (int i = (0); i < (ans2); i++) {
      r = l + B - 1;
      for (int j = (l); j < (r); j++) p[j] = j + 1;
      p[r] = l;
      l += B;
    }
    for (int i = (1); i < (n + 1); i++) cout << p[i] << " ";
  }
  return 0;
}
