#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, m;
  cin >> n;
  string s;
  while (n > 0) {
    if (n % 7 == 0) {
      s += '7';
      n = n - 7;
    } else {
      s += '4';
      n = n - 4;
    }
  }
  if (n == 0) {
    cout << s;
  } else {
    cout << -1;
  }
  return 0;
}
