#include <bits/stdc++.h>
using namespace std;
string cad;
pair<int, int> dp[10000010];
pair<int, int> maxp(pair<int, int> a, pair<int, int> b) {
  if (a.first + a.second > b.first + b.second) return b;
  if (a.first + a.second < b.first + b.second) return a;
  if (a.first < b.first) return a;
  return b;
}
pair<int, int> res(int sum, int c4, int c7) {
  if (sum < 0) return make_pair(1000000, 1000000);
  if (sum == 0) return make_pair(c4, c7);
  if (dp[sum].first != -1)
    return make_pair(dp[sum].first + c4, dp[sum].second + c7);
  pair<int, int> m = maxp(res(sum - 4, c4 + 1, c7), res(sum - 7, c4, c7 + 1));
  return (dp[sum] = m);
}
int main() {
  int sum;
  scanf("%d", &sum);
  for (int i = 0; i <= sum; i++) dp[i].first = dp[i].second = -1;
  pair<int, int> s = res(sum, 0, 0);
  if (s.first != 1000000) {
    for (int i = 0; i < s.first; i++) printf("4");
    for (int i = 0; i < s.second; i++) printf("7");
    printf("\n");
  } else
    printf("-1\n");
  return 0;
}
