#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
void Tez() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
long long min(long long a, long long b) {
  if (a > b) return b;
  return a;
}
int main() {
  Tez();
  long long n;
  cin >> n;
  long long cnt7 = 0, cnt4 = 0;
  cnt7 += (n / 7);
  int rem = n % 7;
  if (rem == 4 || rem == 0) {
    if (rem) cout << 4;
    for (int i = 0; i < cnt7; i++) cout << 7;
    return 0;
  }
  cnt7 = 0;
  int mn = -1;
  int N = n;
  while (n >= 7) {
    if (n % 4 == 0) {
      mn = n;
    }
    n -= 7;
    cnt7++;
  }
  if (mn == -1) {
    cout << -1;
    return 0;
  }
  cnt4 = mn / 4;
  n = N - mn;
  cnt7 = n / 7;
  for (int i = 0; i < cnt4; i++) cout << 4;
  for (int i = 0; i < cnt7; i++) cout << 7;
  return 0;
}
