#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  bool flag = true;
  int rem = n % 7;
  int z = n / 7;
  if (rem == 0) {
    for (int j = 0; j < z; j++) cout << 7;
    cout << '\n';
    flag = false;
  } else if (rem == 1) {
    if (n > 7) {
      cout << 44;
      for (int j = 0; j < z - 1; j++) cout << 7;
      cout << '\n';
      flag = false;
    }
  } else if (rem == 2) {
    if (n > 15) {
      cout << 4444;
      for (int j = 0; j < z - 2; j++) cout << 7;
      cout << '\n';
      flag = false;
    }
  } else if (rem == 3) {
    if (n > 23) {
      cout << 444444;
      for (int j = 0; j < z - 3; j++) cout << 7;
      cout << '\n';
      flag = false;
    }
  } else if (rem == 4) {
    if (n > 3) {
      cout << 4;
      for (int j = 0; j < z; j++) cout << 7;
      cout << '\n';
      flag = false;
    }
  } else if (rem == 5) {
    if (n > 11) {
      cout << 444;
      for (int j = 0; j < z - 1; j++) cout << 7;
      cout << '\n';
      flag = false;
    }
  } else if (rem == 6) {
    if (n > 19) {
      cout << 44444;
      for (int j = 0; j < z - 2; j++) cout << 7;
      cout << '\n';
      flag = false;
    }
    z = n / 4;
    rem = n % 4;
  } else if (rem == 0) {
    for (int j = 0; j < z; j++) cout << 4;
    cout << '\n';
    flag = false;
  } else if (rem == 1) {
    if (n > 20) {
      for (int j = 0; j < z - 5; j++) cout << 4;
      cout << 777;
      cout << '\n';
      flag = false;
    }
  } else if (rem == 2) {
    if (n > 13) {
      for (int j = 0; j < z - 3; j++) cout << 4;
      cout << 77;
      cout << '\n';
      flag = false;
    }
  } else if (rem == 1) {
    if (n > 6) {
      for (int j = 0; j < z - 1; j++) cout << 4;
      cout << 7;
      cout << '\n';
      flag = false;
    }
  }
  if (flag) cout << -1 << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}
