#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int no, i, ans, b = 0, count = 0;
  cin >> no;
  if (no % 7 == 0) {
    long long int k = no / 7;
    for (i = 0; i < k; i++) cout << 7;
  } else {
    for (i = no; i > 0; i = i - 4) {
      if (i % 7 == 0) {
        ans = i;
        b = 2;
        break;
      } else {
        b = 1;
      }
    }
    long long int c = ans / 7;
    long long int m = (no - ans) / 4;
    if (ans % 7 == 0 && (no - ans) % 4 == 0) {
      for (i = 0; i < m; i++) cout << 4;
      for (i = 0; i < c; i++) cout << 7;
    } else {
      cout << -1;
    }
  }
}
