#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  string s;
  while (1) {
    if (n % 7 == 0) {
      n = n / 7;
      for (long long i = 0; i < n; i++) s.push_back('7');
      break;
    } else {
      if (n > 0) {
        s.push_back('4');
        n -= 4;
      } else {
        cout << -1;
        return 0;
      }
    }
  }
  if (s.empty())
    cout << -1;
  else
    cout << s;
}
