#include <bits/stdc++.h>
using namespace std;
long long H = 1e10;
void printAns(int x, int y) {
  for (int i = 0; i < x; i++) cout << 4;
  for (int i = 0; i < y; i++) cout << 7;
  cout << endl;
  return;
}
int main() {
  int n, x, y, mn = H, mx = 0, my = 0, ans;
  cin >> n;
  for (int i = 0; i < 1000002; i++) {
    y = i;
    x = (n - (y * 7)) / 4;
    ans = x * 4 + y * 7;
    if (ans == n)
      if (((x >= 0 && y > 0) || (x >= 0 && y >= 0)) && x + y < mn) {
        mn = x + y;
        mx = x;
        my = y;
      }
  }
  if (mn == H || (!mx && !my)) {
    cout << -1 << endl;
    return 0;
  }
  printAns(mx, my);
  return 0;
}
