#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, p, i;
  cin >> n;
  k = n / 7;
  p = n % 7;
  if (p == 2 && k == 0 || p == 1 && k == 0 || p == 3 && k == 0 ||
      p == 5 && k == 0 || p == 6 && k == 0 || p == 2 && k == 1 ||
      p == 3 && k == 1)
    cout << "-1";
  else if (p == 4) {
    cout << "4";
    for (i = 1; i <= k; i++) cout << "7";
  } else if (p == 0) {
    for (i = 1; i <= k; i++) cout << "7";
  } else if (p == 1) {
    cout << "4"
         << "4";
    for (i = 1; i < k; i++) cout << "7";
  } else if (p == 2) {
    cout << "4"
         << "4"
         << "4"
         << "4";
    for (i = 2; i < k; i++) cout << "7";
  } else if (p == 3) {
    cout << "4"
         << "4"
         << "4"
         << "4"
         << "4"
         << "4";
    for (i = 3; i < k; i++) cout << "7";
  } else if (p == 5) {
    cout << "4"
         << "4"
         << "4";
    for (i = 1; i < k; i++) cout << "7";
  } else if (p == 6) {
    cout << "4"
         << "4"
         << "4"
         << "4"
         << "4";
    for (i = 2; i < k; i++) cout << "7";
  } else if (n % 4 == 0) {
    for (i = 1; i <= n / 4; i++) cout << "4";
  } else
    cout << "-1";
}
