#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > v(1000001, make_pair(0, 0));
  v[4].first++;
  v[7].second++;
  if (n == 5) {
    cout << -1;
    return 0;
  } else if (n == 2) {
    cout << -1;
    return 0;
  }
  for (int i = 8; i <= n; i++) {
    if (v[i - 7].second != 0 || v[i - 7].first != 0) {
      v[i].first = v[i - 7].first;
      v[i].second = v[i - 7].second + 1;
    } else if (v[i - 4].first != 0 || v[i - 4].second != 0) {
      v[i].first = v[i - 4].first + 1;
      v[i].second = v[i - 4].second;
    }
  }
  vector<int> ans;
  for (int i = 0; i < v[n].first; i++) ans.push_back(4);
  for (int i = 0; i < v[n].second; i++) ans.push_back(7);
  bool chk = false;
  int arr[] = {1, 2, 3, 5, 6, 9, 10, 13, 17};
  for (int i = 0; i < 5; i++) {
    if (n == arr[i]) chk = true;
  }
  if (chk)
    cout << -1;
  else if (ans.size() == 0)
    cout << -1;
  else {
    for (int i = 0; i < ans.size(); i++) cout << ans[i];
  }
  v.clear();
  return 0;
}
