#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s("");
  if (n <= 14) {
    if (n == 4 || n == 7)
      cout << n;
    else if (n == 8)
      cout << "44";
    else if (n == 11)
      cout << "47";
    else if (n == 12)
      cout << "444";
    else if (n == 14)
      cout << "77";
    else
      cout << "-1";
  } else {
    int t, i = 0, j = 0;
    int tn = n;
    while (tn > 14 && tn % 7 != 0) {
      tn = tn - 4;
      j++;
    }
    if (tn > 14 && tn % 7 == 0) {
      i = tn / 7;
      for (; j > 0; j--) cout << "4";
      for (; i > 0; i--) cout << "7";
      return 0;
    } else {
      i = 0;
      j = 0;
    }
    if (n % 4 == 0) {
      for (t = 0; t < n / 4; t++) {
        s += "4";
      }
    } else {
      while (n > 8 && n % 4 != 0) {
        n = n - 3;
        j++;
      }
      if (!(n > 8 && n % 4 == 0)) {
        cout << "-1";
        return 0;
      }
      i = n / 4;
      for (i = i - j; i > 0; i--) s += "4";
      for (; j > 0; j--) s += "7";
    }
    cout << s;
  }
  return 0;
}
