#include <bits/stdc++.h>
using namespace std;
int a[111111] = {0}, n, cur;
void check(int l) {
  cur = 0;
  for (int i = 1; i <= n; i++) {
    cur = cur * 10 + a[i];
    cur %= 21;
  }
}
int main() {
  cin >> n;
  if (n == 1 || n == 2) {
    cout << -1;
    return 0;
  }
  a[1] = 1;
  while (true) {
    a[n - 1]++;
    if (a[n - 1] > 9) {
      for (int i = n - 1; i >= 1; i--)
        if (a[i] > 9) {
          a[i] = 0;
          a[i - 1] += 1;
        } else
          break;
    }
    check(1);
    if (cur == 0) {
      for (int i = 1; i <= n; i++) cout << a[i];
      return 0;
    }
  }
  return 0;
}
