#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int n, p, x, m, tmp;
int a[N], b[N], dp[N];
int main() {
  a[0] = 1, a[1] = 1, a[2] = 1, a[3] = 1, a[5] = 1, a[6] = 1, a[9] = 1,
  a[10] = 1, a[13] = 1, a[17] = 1;
  cin >> n;
  if (a[n] == 1)
    cout << -1;
  else {
    while (n % 7 != 0) {
      n -= 4;
      x++;
    }
    for (int i = 0; i < x; i++) cout << 4;
    for (int i = 0; i < n / 7; i++) cout << 7;
  }
  return 0;
}
