#include <bits/stdc++.h>
using namespace std;
int n;
int best4;
int best7;
int arr[1000000];
int main() {
  cin >> n;
  int beta = 1e9;
  for (int a = 0; a <= 142858; a++) {
    int l = 0;
    int r = 250010;
    int mid;
    while (l + 1 < r) {
      mid = l + (r - l) / 2;
      if (a * 7 + mid * 4 <= n)
        l = mid;
      else
        r = mid;
    }
    if (a * 7 + l * 4 == n) {
      best7 = a;
      best4 = l;
    }
  }
  int i = 0;
  int x4 = 0;
  int x7 = 0;
  if (best4 + best7 > 0) {
    while (best4--) arr[i++] = 4;
    while (best7--) arr[i++] = 7;
    for (int j = 0; j < i; j++) {
      if (j + 6 < i && arr[j] == 4 && arr[j + 1] == 4 && arr[j + 2] == 4 &&
          arr[j + 3] == 4 && arr[j + 4] == 4 && arr[j + 5] == 4 &&
          arr[j + 6] == 4) {
        x7 += 4;
        j += 6;
        continue;
      } else {
        if (arr[j] == 7)
          x7++;
        else if (arr[j] == 4)
          x4++;
      }
    }
    while (x4--) cout << 4;
    while (x7--) cout << 7;
  } else
    cout << "-1";
  cout << endl;
}
