#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\t";
  err(++it, args...);
}
const int MOD = 1000000007;
const int N = 2e5;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int b = 0;
  int minB = INT_MAX, minLen = INT_MAX;
  while (b * 7 <= n) {
    if ((n - 7 * b) % 4 == 0) {
      int a = (n - 7 * b) / 4;
      if ((a + b < minLen) || (a + b == minLen && b < minB)) {
        minB = b;
        minLen = a + b;
      }
    }
    b++;
  }
  if (minB == INT_MAX)
    cout << -1;
  else {
    int a = minLen - minB;
    for (int i = (0); 0 < a ? i < a : i > a; 0 < a ? i++ : i--) cout << 4;
    for (int i = (0); 0 < minB ? i < minB : i > minB; 0 < minB ? i++ : i--)
      cout << 7;
  }
  return 0;
}
