#include <bits/stdc++.h>   using namespace std;   const int inf = (int)1e9;   const long long int INF = (long long int)1e18;   const int N = 100005;   const long long int MOD = 1000000007;   const double EPS = 1e-7;   const double PI = acos(-1.0);   const int dx[] = {+1, -1, +0, +0};   const int dy[] = {+0, +0, +1, -1};   const int hx[] = {-2, -2, -1, -1, +1, +1, +2, +2};   const int hy[] = {+1, -1, +2, -2, +2, -2, +1, -1};   const int fx[] = {-1, +0, +1, +0, +1, +1, -1, -1, +0};   const int fy[] = {+0, -1, +0, +1, +1, -1, +1, -1, +0};   template <typename T>   inline T GCD(T a, T b) {     a = abs(a), b = abs(b);     return !b ? a : GCD(b, a % b);   }   template <typename T>   inline T LCM(T x, T y) {     T g = GCD(x, y);     return x * y / g;   }   template <typename T>   inline T BigMod(T b, T p, T mod) {     T res = 1 % mod, x = b % mod;     while (p) {       if (p & 1) res = (res * x) % mod;       x = (x * x) % mod;       p >>= 1;     }     return res;   }   template <typename T>   inline T ModInv(T val, T mod) {     return BigMod(val, mod - 2, mod);   }   template <typename T>   inline T bigmod(T b, T p, T mod) {     if (p == 0) return 1;     T x = bigmod(b, p / 2, mod);     x = (x * x) % mod;     if (p % 2 == 1) x = (b * x) % mod;     return x;   }   template <typename T>   inline T NumDigit(T num, T base) {     return ((T)(log10((num)) / log10((base)))) + 1;   }   template <typename T>   inline T Power(T b, T p) {     T res = 1, x = b;     while (p) {       if (p & 1) res = (res * x);       x = (x * x);       p >>= 1;     }     return res;   }   template <typename T>   inline T IsPrime(T x) {     if (x < 2) return false;     for (T i = 2; i * i <= x; i++) {       if (x % i == 0) return false;     }     return true;   }   template <typename T>   inline T SumDigit(T x) {     T ret = 0;     while (x) {       ret += x % 10, x /= 10;     }     return ret;   }   int main(int argc, char const *argv[]) {     int n;     scanf( %d , &n);     for (int i = 0; i * 4 <= n; i++) {       for (int j = 0; i * 4 + j * 7 <= n; j++) {         if (4 * i + j * 7 == n) {           for (int m = 1; m <= i; m++) printf( 4 );           for (int m = 1; m <= j; m++) printf( 7 );           return 0;         }       }     }     printf( -1 n );     return 0;   }   