#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double pi = 3.14159265358979323846264338327950288419716939937511;
const double eps = 1e-11;
char ch_ch_ch[1 << 20];
string gs() {
  scanf("%s", ch_ch_ch);
  return string(ch_ch_ch);
}
string gl() {
  gets(ch_ch_ch);
  return string(ch_ch_ch);
}
pair<int, int> best = make_pair(-1, -1);
void solution() {
  int n;
  cin >> n;
  for (int i = (0); i < (n / 4 + 1); ++i)
    if (n - 4 * i >= 0 && (n - 4 * i) % 7 == 0) {
      pair<int, int> cur = make_pair(i, (n - 4 * i) / 7);
      if (best.first == -1) {
        best = cur;
        continue;
      }
      if (cur.first + cur.second < best.first + best.second)
        best = cur;
      else if (cur.first + cur.second == best.first + best.second &&
               cur.first > cur.second)
        best = cur;
    }
  if (best.first == -1)
    cout << -1 << endl;
  else {
    for (int i = 0; i < (best.first); ++i) printf("4");
    for (int i = 0; i < (best.second); ++i) printf("7");
    printf("\n");
  }
}
int main(int argc, char** argv) {
  solution();
  return 0;
}
