#include <bits/stdc++.h>
using namespace std;
const int N = 111111;
const int INF = int(1e9), mod = (int)1e9 + 7;
int n;
pair<int, int> ans = make_pair(INF, INF);
void minimize(pair<int, int> &ans, pair<int, int> cur) {
  if (cur.first + cur.second < ans.first + ans.second) ans = cur;
  if (cur.first + cur.second == ans.first + ans.second &&
      cur.second > ans.second)
    ans = cur;
}
int main() {
  cin >> n;
  for (int i = 0; i <= n / 7; ++i) {
    int ost = n - i * 7;
    if (ost >= 0 && ost % 4 == 0) minimize(ans, make_pair(i, ost / 4));
  }
  if (ans.first == INF) {
    cout << -1;
  } else {
    for (int(i) = (0); (i) < (ans.second); ++(i)) cout << 4;
    for (int(i) = (0); (i) < (ans.first); ++(i)) cout << 7;
  }
  cout << '\n';
  return 0;
}
