#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, X = 1000000000, Y = 1000000000, y;
  cin >> n;
  int min_sum = 1000000000;
  for (int x = 0; x <= n; x++) {
    if (4 * x <= n) {
      if ((n - 4 * x) % 7 == 0) {
        y = (n - 4 * x) / 7;
        X = x;
        Y = y;
        min_sum = X + Y;
        break;
      }
    }
  }
  if (min_sum == 1000000000) {
    cout << -1 << endl;
    return 0;
  }
  string ans = "";
  for (int i = 1; i <= X; i++) {
    printf("4");
  }
  for (int i = 1; i <= y; i++) {
    printf("7");
  }
  puts("");
  return 0;
}
