import java.io.*;
import java.util.*;
import java.math.*;

public class smooth_aa {
	public static void main(String[] args) {
		new smooth_aa().run();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;
	Random rand = new Random(125475452);

	private void run() {
		Locale.setDefault(Locale.US);
		try {
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(566);
		}
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	void check(boolean u) {
		if (!u) {
			throw new Error("Assertion failed!!!");
		}
	}

	String FNAME = "smooth";

	int MAX = 100;

	private void solve() throws IOException {
		int len = nextInt();
		check(1 <= len && len <= 100);
		if (len > 8) {
			out.println("-1");
			return;
		}
		if (len <= 2) {
			for (int i = 0; i < len; i++) {
				out.print("9");
			}
			return;
		}
		long ans = -1;
		int pow = (int) Math.round(Math.pow(10, len - 2));
		int[] a = new int[len];
		a[0] = 9;
		a[len - 1] = 9;
		for (int i = 0; i < pow; i++) {
			int x = i;
			for (int j = 1; j + 1 < a.length; j++) {
				a[j] = x % 10;
				x /= 10;
			}
			boolean good = true;
			for (int j = 1; j + 1 < a.length; j++) {
				good &= 2 * a[j] < a[j - 1] + a[j + 1];
			}
			if (good) {
				long num = 0;
				for (int j = 0; j < a.length; j++) {
					num = 10 * num + a[j];
				}
				ans = Math.max(ans, num);
			}
		}
		out.println(ans);
	}
}