#include <bits/stdc++.h>
using namespace std;
int AddSeven(int TheNumber);
void AddFour(int addSeven, int TheNumber);
int sevenCounter = 0;
int fourCounter = 0;
bool check = false;
int main() {
  int TheNumber, addSeven, addFour, LoopLength;
  cin >> TheNumber;
  addSeven = AddSeven(TheNumber);
  AddFour(addSeven, TheNumber);
  if (check != false) {
    LoopLength = sevenCounter + fourCounter;
    for (int x = 1; x <= LoopLength; x++) {
      if (fourCounter > 0)
        cout << "4";
      else
        cout << "7";
      fourCounter--;
    }
  } else
    cout << "-1";
  return 0;
}
int AddSeven(int TheNumber) {
  int addSeven = 0;
  for (int x = 7; x <= TheNumber; x += 7) {
    addSeven = x;
    sevenCounter++;
    if (addSeven == TheNumber) {
      check = true;
      break;
    }
  }
  return addSeven;
}
void AddFour(int addSeven, int TheNumber) {
  while (check != true) {
    int addFour = addSeven, x = 4;
    fourCounter = 0;
    while (true) {
      addFour += 4;
      fourCounter++;
      if (addSeven == 0 && addFour > TheNumber) {
        check = false;
        return;
      }
      if (addFour > TheNumber) break;
      if (addFour == TheNumber) {
        check = true;
        return;
      }
      x += 4;
    }
    addSeven -= 7;
    sevenCounter--;
  }
}
