#include <bits/stdc++.h>
using namespace std;
template <class T>
T modpower(T a, T b, T MOD) {
  T ans = 1;
  while (b != 0) {
    if (b % 2 == 1) ans = (ans * a) % MOD;
    a = (a * a) % MOD;
    b /= 2;
  }
  return ans;
}
void init() {
  int n, t;
  cin >> n;
  if (n < 4)
    cout << "-1";
  else if (n % 7 == 0) {
    t = n / 7;
    while (t--) cout << "7";
  } else if ((n - 4) % 7 == 0 && n >= 4) {
    cout << "4";
    t = (n - 4) / 7;
    while (t--) cout << "7";
  } else if ((n - 8) % 7 == 0 && n >= 8) {
    cout << "44";
    t = (n - 8) / 7;
    while (t--) cout << "7";
  } else if ((n - 12) % 7 == 0 && n >= 12) {
    cout << "444";
    t = (n - 12) / 7;
    while (t--) cout << "7";
  } else if ((n - 16) % 7 == 0 && n >= 16) {
    cout << "4444";
    t = (n - 16) / 7;
    while (t--) cout << "7";
  } else if ((n - 20) % 7 == 0 && n >= 20) {
    cout << "44444";
    t = (n - 20) / 7;
    while (t--) cout << "7";
  } else if ((n - 24) % 7 == 0 && n >= 24) {
    cout << "444444";
    t = (n - 24) / 7;
    while (t--) cout << "7";
  } else
    cout << "-1";
}
int main() {
  clock_t time1 = clock();
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  init();
  clock_t time2 = clock();
  cerr << "Time: " << (double)(time2 - time1) / CLOCKS_PER_SEC * 100000
       << " seconds" << endl;
  return 0;
}
