#include <bits/stdc++.h>
using namespace std;
long long nwd(long long a, long long b) { return !b ? a : nwd(b, a % b); }
int main() {
  int numf = 0;
  int nums = 0;
  int force = 0;
  int n;
  cin >> n;
  if (n == 0) {
    printf("-1");
    return 0;
  }
  int sum = 0;
  while (sum < n) {
    sum += 7;
    nums++;
  }
  while (sum > n && force < 10000) {
    if (nums > 0 && sum >= 0) {
      sum -= 7;
      nums--;
    } else {
      force = 10000;
      break;
    }
    force++;
    while (sum < n) {
      sum += 4;
      numf++;
    }
  }
  if (force == 10000)
    printf("-1");
  else {
    string s = "";
    for (int i = 0; i < (numf); i++) s += '4';
    for (int i = 0; i < (nums); i++) s += '7';
    cout << s;
  }
}
