#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool f = false;
  char arr[1000];
  int c = (int)floor((double)n / 4);
  int o = n % 4;
  int u = 0;
  int r = c;
  if (n == 7 || n == 4) {
    cout << n;
    return 0;
  } else if (c < 7 && o == 0) {
    for (int i = 0; i < c; i++) {
      cout << "4";
    }
    return 0;
  }
  while (c > 0) {
    c--;
    o += 4;
    if (o % 7 == 0) {
      u = o / 7;
      r = c;
      f = true;
    }
  }
  if (f) {
    for (int i = 0; i < r; i++) {
      cout << "4";
    }
    for (int i = 0; i < u; i++) {
      cout << "7";
    }
  }
  if (!f) {
    cout << "-1";
  }
  return 0;
}
