#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 0, nm = 0, c;
  cin >> n;
  for (int i = 1;; i++) {
    nm = nm * 10 + 4;
    k = 4 * i;
    if (k > n) {
      cout << -1 << endl;
      break;
    }
    if (k == n) {
      for (int j = 0; j < i; j++) cout << 4;
      cout << endl;
      break;
    }
    c = i * 3;
    if (c + k == n) {
      for (int j = 0; j < i; j++) cout << 7;
      cout << endl;
      break;
    } else if (c + k < n)
      k += c;
    else {
      c = n - k;
      if (c % 3 == 0) {
        for (int j = 0; j < i - c / 3; j++) cout << 4;
        for (int j = 0; j < c / 3; j++) cout << 7;
        cout << endl;
        break;
      }
    }
  }
  return 0;
  ;
}
