#include <bits/stdc++.h>
const long long mxn = 1e6 + 7;
const long long mod = 1e9 + 7;
const long long inf = 1e9 + 9;
using namespace std;
long long n, m, cnt4 = 0, cnt7 = 0;
string s[mxn];
int main() {
  cin >> n;
  while (n > 0) {
    if (n % 7 == 0) {
      cnt7 = n / 7;
      break;
    } else {
      n -= 4;
      cnt4++;
    }
  }
  if (n < 0) {
    cout << -1;
    return 0;
  }
  for (int i = 1; i <= cnt4; i++) {
    cout << 4;
  }
  for (int i = 1; i <= cnt7; i++) {
    cout << 7;
  }
}
