Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

Petya wonders eagerly what minimum lucky number has the sum of digits equal to n. Help him cope with the task.

Input

The single line contains an integer n (1 ≤ n ≤ 106) — the sum of digits of the required lucky number.

Output

Print on the single line the result — the minimum lucky number, whose sum of digits equals n. If such number does not exist, print -1.

Examples

Input

11


Output

47


Input

10


Output

-1
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.ni();
            int copy = n;
            int first_sevens = 0;
            while (n % 4 != 0 && n > 0) {
                ++first_sevens;
                n -= 7;
            }
            int second_fours = 0;
            while (copy % 7 != 0 && copy > 0) {
                ++second_fours;
                copy -= 4;
            }
            if (n <= 0 && copy <= 0) {
                out.println(-1);
                return;
            }
            int fours = 0;
            int sevens = 0;
            int first_fours = n / 4;
            int second_sevns = copy / 7;
            if (n <= 0) {
                fours = second_fours;
                sevens = second_sevns;
            } else if (copy <= 0) {
                fours = first_fours;
                sevens = first_sevens;
            } else if (first_fours + first_sevens < second_fours + second_sevns) {
                fours = first_fours;
                sevens = first_sevens;
            } else {
                fours = second_fours;
                sevens = second_sevns;
            }
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < fours; ++i)
                sb.append('4');
            for (int i = 0; i < sevens; ++i)
                sb.append('7');
            out.println(sb.toString());
        }

    }

    static class InputReader {
        BufferedReader br;
        StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String n() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public int ni() {
            return Integer.parseInt(n());
        }

    }
}

