#include <bits/stdc++.h>
using namespace std;
inline long long int __gcd(long long int a, long long int b) {
  if (a == 0 || b == 0) {
    return max(a, b);
  }
  long long int tempa, tempb;
  while (1) {
    if (a % b == 0)
      return b;
    else {
      tempa = a;
      tempb = b;
      a = tempb;
      b = tempa % tempb;
    }
  }
}
bool prime(long long int k) {
  for (long long int i = 2; i * i <= k; i++)
    if (k % i == 0) {
      return false;
    }
  return true;
}
void pdash(int n = 1) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 30; j++) {
      cout << "-";
    }
    cout << "\n";
  }
}
bool solution(int a, int b, int n, int& x, int& y) {
  for (x = 0; x * a <= n; x++) {
    if ((n - (x * a)) % b == 0) {
      y = (n - (x * a)) / b;
      return true;
    }
  }
  return false;
}
void solve() {
  int n, a, b;
  cin >> n >> a >> b;
  int x, y;
  vector<int> arr(n);
  for (int i = 1; i <= n; i++) {
    arr[i - 1] = i;
  }
  if (a == 1 || b == 1) {
    for (int i = 1; i <= n; i++) cout << arr[i - 1] << " ";
    cout << "\n";
    return;
  }
  if (solution(a, b, n, x, y)) {
    int i;
    for (i = 0; i + a <= n && x > 0; x--) {
      rotate(arr.begin() + i, arr.begin() + (i + 1), arr.begin() + (i + a));
      i += a;
    }
    for (; i + b <= n && y > 0; y--) {
      rotate(arr.begin() + i, arr.begin() + (i + 1), arr.begin() + (i + b));
      i += b;
    }
    for (int j = 0; j < n; j++) {
      cout << arr[j] << " ";
    }
    cout << "\n";
    return;
  } else {
    cout << "-1\n";
    return;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
