#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n && n > 0) {
    int flag = 1;
    int a = n / 4;
    int b = n % 4;
    int c = n / 7;
    int d = n % 7;
    int x, y, x1, y1;
    for (int i = c; i >= 0; i--) {
      int temp = n - i * 7;
      if (temp % 4 == 0 && temp >= 0) {
        flag = 0;
        x1 = temp / 4;
        y1 = i;
        break;
      }
    }
    if (flag)
      cout << -1;
    else {
      for (int i = 0; i < x1; i++) cout << 4;
      for (int i = 0; i < y1; i++) cout << 7;
    }
    cout << endl;
  }
  return 0;
}
