Little X has met the following problem recently. 

Let's define f(x) as the sum of digits in decimal representation of number x (for example, f(1234) = 1 + 2 + 3 + 4). You are to calculate <image>

Of course Little X has solved this problem quickly, has locked it, and then has tried to hack others. He has seen the following C++ code: 
    
    
      
        ans = solve(l, r) % a;  
        if (ans <= 0)  
          ans += a;  
      
    

This code will fail only on the test with <image>. You are given number a, help Little X to find a proper test for hack.

Input

The first line contains a single integer a (1 ≤ a ≤ 1018).

Output

Print two integers: l, r (1 ≤ l ≤ r < 10200) — the required test data. Leading zeros aren't allowed. It's guaranteed that the solution exists.

Examples

Input

46


Output

1 10


Input

126444381000032


Output

2333333 2333333333333
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
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);
        CHackIt solver = new CHackIt();
        solver.solve(1, in, out);
        out.close();
    }

    static class CHackIt {
        long a;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            a = in.readLong();
            BigInteger mod = BigInteger.valueOf(a);
            HashMap<BigInteger, BigInteger> map = new HashMap<>();
            BigInteger v = g(BigInteger.valueOf(328));

            BigDecimal limit = BigDecimal.ONE;
            for (int i = 0; i < 30; i++) limit = limit.multiply(BigDecimal.valueOf(10));
            for (BigInteger x = BigDecimal.valueOf(Math.random()).multiply(limit).toBigInteger(); true; ) {
                BigInteger gx = g(x);
                BigInteger qx = gx.mod(BigInteger.valueOf(a));

                BigInteger low = BigInteger.ZERO, high = mod.subtract(qx);
                while (low.compareTo(high) < 0) {
                    BigInteger mid = low.add(high).divide(BigInteger.valueOf(2));
                    if (g(x.add(mid)).subtract(gx).compareTo(mod.subtract(qx)) >= 0) {
                        high = mid;
                    } else low = mid.add(BigInteger.ONE);
                }


                BigInteger g = g(high.add(x)).mod(mod);
                if (map.containsKey(g) && map.get(g).compareTo(x.add(high)) != 0) {
                    BigInteger v1 = high.add(x);
                    BigInteger v2 = map.get(g);
                    if (v1.compareTo(v2) > 0) {
                        BigInteger t = v1;
                        v1 = v2;
                        v2 = t;
                    }
                    out.println(v1 + " " + (v2.subtract(BigInteger.ONE)));
                    return;
                }
                map.put(g, high.add(x));
                x = BigDecimal.valueOf(Math.random()).multiply(limit).toBigInteger();
            }

        }

        BigInteger g(BigInteger x) {
            return calc(x.subtract(BigInteger.ONE));
        }

        BigInteger calc(BigInteger x) {
            if (x.compareTo(BigInteger.valueOf(10)) < 0)
                return x.multiply(x.add(BigInteger.ONE)).divide(BigInteger.valueOf(2));

            long d = (x.toString() + "").length() - 1;
            BigInteger sum = BigInteger.valueOf(45);
            for (int i = 2; i <= d; i++) {
                sum = sum.multiply(BigInteger.valueOf(10)).add(BigInteger.valueOf(45).multiply(BigInteger.valueOf(10).pow(i - 1)));
            }
            BigInteger p = BigInteger.valueOf(10).pow((int) d);
            BigInteger msd = x.divide(p);
            BigInteger a1 = msd.multiply(sum).add(p.multiply(msd.multiply(msd.subtract(BigInteger.ONE)).divide(BigInteger.valueOf(2))));
            BigInteger a2 = msd.multiply(x.mod(p).add(BigInteger.ONE)).add(calc(x.mod(p)));
            return a1.add(a2);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public long readLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

