#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, l = 0, r = -1, k;
  cin >> n;
  k = n;
  while (n >= 0) {
    if (n % 7 == 0) {
      r = n / 7;
      l = (k - r * 7) / 4;
      for (int i = 0; i < l; i++) cout << 4;
      for (int i = 0; i < r; i++) cout << 7;
      return 0;
    }
    l++;
    n -= 4;
  }
  cout << -1;
  return 0;
}
