#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 * 1000 + 7;
const double PI = 3.14159265;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int fours = 0, sevens = 0;
  if (n % 7 == 0) {
    sevens = n / 7;
    for (int i = 0; i < sevens; ++i) {
      cout << 7;
    }
    return 0;
  } else {
    while (n > 0 && n % 4 != 0) {
      n -= 7;
      sevens++;
    }
    if (n < 0)
      cout << -1;
    else {
      fours = n / 4;
      while (fours > 7) {
        sevens += 4;
        fours -= 7;
      }
      for (int i = 0; i < fours; ++i) {
        cout << 4;
      }
      for (int i = 0; i < sevens; ++i) {
        cout << 7;
      }
    }
  }
  return 0;
}
