#include <bits/stdc++.h>
using namespace std;
int dp[1000001];
int main() {
  ios::sync_with_stdio(false);
  int n, a, b;
  cin >> n >> a >> b;
  memset(dp, -1, sizeof dp);
  dp[0] = 0;
  for (int i = 1; i <= n; i++) {
    if (i >= a && dp[i - a] != -1)
      dp[i] = dp[i - a] + 1;
    else if (i >= b && dp[i - b] != -1)
      dp[i] = dp[i - b];
  }
  if (dp[n] == -1)
    cout << -1 << endl;
  else {
    int ca = dp[n], cb = (n - a * dp[n]) / b;
    int cur = 1;
    for (int i = 0; i < ca; i++) {
      int start = cur++;
      for (int j = 0; j + 1 < a; j++) cout << cur++ << " ";
      cout << start << " ";
    }
    for (int i = 0; i < cb; i++) {
      int start = cur++;
      for (int j = 0; j + 1 < b; j++) cout << cur++ << " ";
      cout << start << " ";
    }
    cout << endl;
  }
}
