#include <bits/stdc++.h>
using namespace std;
int n, A[100], B[100], t, r, x;
string s = "";
int main() {
  cin >> n;
  for (int i = 0; i <= n; i++) {
    r = 0;
    for (int j = 0; j <= n; j++) {
      if ((t + r) == n) {
        x = 1;
        break;
      }
      r = r + 7;
    }
    if (x == 1) break;
    t = t + 4;
  }
  if (x == 1) {
    for (int i = 0; i < t / 4; i++) s += '4';
    for (int i = 0; i < r / 7; i++) s += '7';
  } else {
    s = "-1";
  }
  cout << s;
}
