#include <bits/stdc++.h>
using namespace std;
const int N = 200000;
const int INF = 1000000;
const double eps = 10e-6;
const long long MOD = 1000000007;
int n;
int x, y;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  x = 1000000;
  y = 1000000;
  bool f = false;
  for (int i = 0; 4 * i <= n; ++i) {
    int j = n - 4 * i;
    if (j % 7 == 0) {
      j = j / 7;
      if (i + j < x + y) {
        x = i;
        y = j;
        f = true;
      } else if (i + j == x + y) {
        if (j < y) {
          x = i;
          y = j;
        }
      }
    }
  }
  if (!f) {
    cout << "-1";
    return 0;
  } else {
    string ans = "";
    for (int i = 0; i < x; ++i) ans += "4";
    for (int i = 0; i < y; ++i) ans += "7";
    cout << ans;
  }
  return 0;
}
