#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double pi = acos(-1.0);
const int inf = (int)1e9;
const double eps = 1e-6;
const int ss = (int)1e6 + 3;
const int base = inf;
bool pred(const pair<int, int>& i, const pair<int, int>& j) {
  if (i.first == j.first) {
    return i.second > j.second;
  } else {
    return i.first > j.first;
  }
}
bool pred1(const string& i, const string& j) { return i.size() > j.size(); }
int main() {
  int n;
  cin >> n;
  int x = 0;
  int y = 0;
  int mn = inf;
  int kol = 0;
  while (n >= 0) {
    if (n % 4 == 0) {
      int now = n / 4;
      now += kol;
      if (now < mn) {
        mn = now;
        x = n / 4;
        y = kol;
      }
      if (now == mn && kol < y) {
        x = n / 4;
        y = kol;
      }
    }
    ++kol;
    n -= 7;
  }
  if (mn == inf) {
    cout << -1;
  } else {
    for (int i = 0; i < x; ++i) cout << 4;
    for (int i = 0; i < y; ++i) cout << 7;
  }
  return 0;
}
