#include <bits/stdc++.h>
using namespace std;
long long board[2005][2005];
long long score[2005][2000 + 5];
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long t = n;
  long long a4 = 0, a7 = 0;
  while (n >= 0) {
    if (n % 7 == 0) {
      a7 = n / 7;
      break;
    }
    n = n - 4;
    if (n < 0) break;
    a4++;
  }
  if (a4 * 4 + a7 * 7 != t) {
    cout << "-1";
    return 0;
  }
  for (long long x = 1; x <= a4; x++) cout << "4";
  for (long long x = 1; x <= a7; x++) cout << "7";
}
