#include <bits/stdc++.h>
using namespace std;
bool FF;
int n, F, mn = 1e8;
int main() {
  cin >> n;
  for (int i = 0; i <= n / 7; i++) {
    int l = n - i * 7;
    if (l % 4 == 0) {
      if (l / 4 + i < mn) {
        mn = l / 4 + i;
        F = l / 4;
      }
      FF = true;
    }
  }
  if (!FF)
    puts("-1");
  else {
    for (int i = 1; i <= F; i++) cout << "4";
    for (int i = 1; i <= (n - 4 * F) / 7; i++) cout << "7";
  }
  return 0;
}
