#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const long long int LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const int mod = 1000000007;
using namespace std;
int n;
pair<int, int> pd[2][1000010];
int main() {
  cin >> n;
  for (int i = (int)(0); i < (int)(n + 1); ++i) {
    if (i % 4 == 0) {
      pd[0][i] = {i / 4, 0};
    }
  }
  for (int i = (int)(0); i < (int)(n + 1); ++i) {
    if (i < 7)
      pd[1][i] = pd[0][i];
    else if (i == 7)
      pd[1][i] = {0, 1};
    else {
      if (pd[1][i - 7].first + pd[1][i - 7].second) {
        pd[1][i] = pd[1][i - 7];
        pd[1][i].second++;
      } else if (pd[0][i].first + pd[0][i].second)
        pd[1][i] = pd[0][i];
    }
  }
  if (pd[1][n].first + pd[1][n].second == 0)
    puts("-1");
  else {
    for (int i = (int)(0); i < (int)(pd[1][n].first); ++i) cout << 4;
    for (int i = (int)(0); i < (int)(pd[1][n].second); ++i) cout << 7;
    puts("");
  }
  return 0;
}
