#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c4 = -1, c7 = -1;
  scanf("%d", &n);
  for (int i = 0; i <= n / 4; ++i) {
    if ((n - 4 * i) % 7 == 0) {
      c4 = i;
      c7 = (n - 4 * i) / 7;
      break;
    }
  }
  if (c4 == -1) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < c4; ++i) cout << 4;
  for (int i = 0; i < c7; ++i) cout << 7;
}
