#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long a = n / 7;
    long long b = (n % 7) / 4;
    long long c = (n % 7) % 4;
    if (c == 1) {
      b += 2;
      a -= 1;
    } else if (c == 2) {
      b += 4;
      a -= 2;
    } else if (c == 3) {
      b += 6;
      a -= 3;
    }
    if (a >= 0 && b >= 0) {
      for (int i = 0; i < b; i++) cout << "4";
      for (int i = 0; i < a; i++) cout << "7";
    } else {
      cout << "-1";
    }
  }
}
