Let's call a positive integer composite if it has at least one divisor other than $1$ and itself. For example:

  the following numbers are composite: $1024$, $4$, $6$, $9$;  the following numbers are not composite: $13$, $1$, $2$, $3$, $37$. 

You are given a positive integer $n$. Find two composite integers $a,b$ such that $a-b=n$.

It can be proven that solution always exists.


-----Input-----

The input contains one integer $n$ ($1 \leq n \leq 10^7$): the given integer.


-----Output-----

Print two composite integers $a,b$ ($2 \leq a, b \leq 10^9, a-b=n$).

It can be proven, that solution always exists.

If there are several possible solutions, you can print any. 


-----Examples-----
Input
1

Output
9 8

Input
512

Output
4608 4096

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Complete search


Solutions:
def delit(s):
	for i in range(2, s):
		if s % i == 0:
			return True
	return False

def solve(n):
	if n % 2 == 0:
		a = n + 4
		b = 4
	else:
		a = n
		b = 3
		for i in range(10 ** 7):
			a += 1
			b = a - n
			if delit(b) and a % 4 == 0:
				break
	return (a, b)
n = int(input())
print(*solve(n))


from sys import stdin, stdout

def scal(typ=int):
	return typ(stdin.readline())

def vec(typ=int):
	if isinstance(typ, list):
		inp = stdin.readline().split()
		return [typ[i](inp[i]) for i in range(len(inp))]
	else:
		return list(map(typ, stdin.readline().split()))
n = scal()
if n % 2:
	print(n + 9, 9)
else:
	print(n + 4, 4)


n = int(input())
if n % 2 == 0:
	b = int(4)
	a = n + 4
	print(a, b)
else:

	def comp(x):
		for i in range(2, int(x / 2)):
			if x % i == 0:
				return 1
				break
		return 0
	b = int(4)
	while 1:
		a = b + n
		cp = comp(a)
		if cp == 1:
			print(a, b)
			break
		b += 1
		while 1:
			if comp(b) == 0:
				b += 1
			else:
				break


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
a = 5
b = n + 5
k = 1
while k:
	if isPrime(a):
		a += 1
		b += 1
	elif isPrime(b):
		a += 1
		b += 1
	else:
		k = 0
print(str(b) + ' ' + str(a))


a = int(input())
print(str(a * 10) + ' ' + str(a * 9))


n = int(input())
if n == 1:
	print(10, 9)
else:
	print(3 * n, 2 * n)


a = input()
print(int(a) * 9, int(a) * 8)


a = int(input())
b = a * 10
c = a * 9
print(b, c)


import sys
input = sys.stdin.readline
n = int(input())
if not n % 2:
	print(n + 4, 4)
	sys.exit()
else:
	print(n + 9, 9)


n = int(input())
if n == 1:
	print(15, 14)
elif n % 2 == 0:
	print(n * 3, n * 2)
elif n % 2 != 0:
	print(n + 9, 9)


n = int(input())
a = 8
b = 10
b += n - 2
if n & 1 == 0:
	print(b, a)
else:
	print(b + 1, a + 1)


n = int(input())
a = 9
b = 8
print(a * n, ' ', b * n)


n = int(input())
if n % 2 == 0:
	print(n + 10, 10)
else:
	print(n + 9, 9)


n = int(input())
if n == 1:
	print('9 8')
else:
	print(3 * n, ' ', 2 * n)


import random

def composite(b, n):
	count1 = 0
	count2 = 0
	for i in range(2, b):
		if b % i == 0:
			count1 += 1
		if count1 > 0:
			a = b + n
			for j in range(2, a):
				if a % j == 0:
					count2 += 1
				if count2 > 0:
					print(a, b)
					return
		b = random.randint(4, 1000000000)
		count1 = 0
n = int(input())
b = random.randint(4, 1000000000)
composite(b, n)


def isprime(x):
	for i in range(2, x):
		if x % i == 0:
			return 1
	return 0
n = int(input())
i = 1
k = 'y'
while k == 'y':
	a = n * i
	b = n * (i + 1)
	x = isprime(a)
	y = isprime(b)
	if x == 1 and y == 1:
		print(b, a, sep=' ')
		k = 'n'
	if y == 0:
		i = i + 2
	else:
		i = i + 1


N = int(input())
a = N
b = a + N
while a - b:
	chk_a = 0
	chk_b = 0
	for i in range(2, a):
		if a % i == 0:
			chk_a = 1
			break
	else:
		a += 1
		b += 1
		continue
	for i in range(2, b):
		if b % i == 0:
			chk_b = 1
			break
	else:
		a += 1
		b += 1
		continue
	if chk_a and chk_b:
		break
print(b, a)


n = int(input())
l = {1: 0, 2: 0}

def is_composite(x):
	if x in l:
		return l[x]
	for j in range(2, int(x ** 0.5 + 1)):
		if x % j == 0:
			l[x] = 1
			return True
	l[x] = 0
	return False
ans_a = ans_b = 0
for i in range(20000001):
	j = i + n
	if is_composite(i) and is_composite(j):
		ans_a = j
		ans_b = i
		break
print(ans_a, ans_b)


import math

def is_prime(n):
	if n <= 1:
		return False
	elif n < 4:
		return True
	elif n % 2 == 0:
		return False
	elif n % 3 == 0:
		return False
	elif n < 9:
		return True
	else:
		r = math.floor(math.sqrt(n))
		f = 5
		while f <= r:
			if n % f == 0:
				return False
			if n % (f + 2) == 0:
				return False
			f = f + 6
		return True
n = int(input())
start = n - n // 2
end = start + n
while True:
	if is_prime(start) == False and is_prime(end) == False:
		print(end, start)
		break
	else:
		start += 1
		end += 1


n = int(input())
print(n * 9 + n, n * 9)


n = int(input())
b = 4
a = b + n
aa = 1
while aa != 2:
	(qa, qb) = (0, 0)
	for i in range(2, a):
		if a % i == 0:
			qa = 1
			break
	for i in range(2, b):
		if b % i == 0:
			qb = 1
			break
	aa = qa + qb
	if aa == 2:
		break
	else:
		a += 1
		b += 1
print(a, b)


def compo(num):
	r = 2
	s = 0
	while r < num:
		if num % r == 0:
			s = s + 1
			if s > 0:
				return True
				break
			else:
				return False
		r = r + 1
n = int(input())
r = 4
while True:
	if compo(r) == True:
		b = r
		a = n + b
		if compo(a) == True:
			break
	r = r + 1
print(a, b)


a = int(input())
if a == 1:
	print(9, 8)
else:
	print(a * 3, a * 2)


n = int(input())
if n % 2 == 0:
	print(n + 4, 4)
else:
	print(n + 9, 9)


def equation(n):
	ll = [n * 9, n * 8]
	return ll
n = int(input())
print(*equation(n))


n = int(input())
if n % 2 == 0:
	a = n + 4
	b = 4
else:
	a = n + 9
	b = 9
print(a, b)


import sys

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def main():
	n = int(input())
	b = 4
	while True:
		a = n + b
		if isPrime(a) or isPrime(b):
			b += 1
		else:
			print(a, b)
			break
get_array = lambda : list(map(int, sys.stdin.readline().split()))
get_ints = lambda : map(int, sys.stdin.readline().split())
input = lambda : sys.stdin.readline().strip()
main()


t = int(input())
m = 4
a = 0
b = 0
while 1:
	x = t + m
	a = 0
	b = 0
	for i in range(2, x):
		if x % i == 0:
			a = -1
			break
	for j in range(2, m):
		if m % j == 0:
			b = -1
			break
	if a == -1 and b == -1:
		print(x, m)
		break
	else:
		m = m + 1


def is_composit(number):
	sqrt = int(number ** 0.5) + 1
	for i in range(2, sqrt):
		if number % i == 0:
			return True
	return False
n = int(input())
a = 3
while True:
	if is_composit(a) and is_composit(a + n):
		print(f'{a + n} {a}')
		break
	a += 1


from math import sqrt
n = int(input())
for b in range(4, 1000, 2):
	a = n + b
	for i in range(3, int(sqrt(b)) + 1, 2):
		if a % i == 0:
			print(a, b)
			exit()


def iscom(num):
	i = 2
	while i * i <= num:
		if num % i == 0:
			return True
		i += 1
	return False
n = int(input())
if n % 2 == 0:
	print(4 + n, 4)
else:
	(t1, t2, t3) = (4 + n, 6 + n, 8 + n)
	if iscom(t1):
		print(t1, 4)
	elif iscom(t2):
		print(t2, 6)
	else:
		print(t3, 8)


x = int(input())
if x == 1:
	print(9, 8)
	exit(0)
if x % 2 == 1:
	print(3 * x, 2 * x)
else:
	print(3 * x, 2 * x)


n = int(input())
print('{0} {1}'.format(9 * n, 8 * n))


n = int(input())
from math import sqrt

def gcd(a, b):
	if not a:
		return b
	return gcd(b % a, a)

def checkPrime(m):
	for i in range(2, int(sqrt(m) + 1)):
		if gcd(i, m) != 1:
			return False
	return True
for i in range(2, 10 ** 7):
	a = i + n
	b = i
	if not checkPrime(a) and (not checkPrime(b)):
		print(a, b)
		break


import math

def prime(k):
	if k == 2:
		return True
	j = 2
	while k % j != 0 and j * j <= k:
		j += 1
	if j * j > k:
		return False
	return True
n = int(input())
b = 4
a = b + n
while 1:
	if prime(a) and prime(b):
		print(a, b)
		break
	b += 1
	a = b + n


n = int(input())

def comp(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return True
	return False
for i in range(4, 1000000):
	if comp(i) and comp(n + i):
		print(n + i, i)
		break


n = int(input())
print(15 * n, end=' ')
print(14 * n)


n = int(input())
c = 0
for i in range(4, 100):
	if i % 2 == 0 and i % 3 == 0:
		r = i + n
		for j in range(2, r // 2):
			if r % j == 0:
				print(r, i)
				c += 1
				break
	if c >= 1:
		break


n = int(input())
basemap = {1: (9, 8), 2: (14, 12), 3: (21, 18)}
if n < 4:
	b = basemap[n]
	print(b[0], b[1])
else:
	print(n * 3, n * 2)


def h(n):
	k = int(n ** 0.5)
	u = 0
	for i in range(2, k):
		if n % i == 0:
			u = u + 1
			return 2
	if u == 0:
		return 1
n = int(input())
p = 1000 + n
q = 1000
while 1:
	if h(p) == 2 and h(q) == 2:
		print(p, q)
		break
	else:
		p = p + 1
		q = q + 1


def isPrime(n):
	ans = True
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		else:
			i += 1
	return True
n = int(input())
a = 4
b = n + 4
while True:
	if isPrime(a) or isPrime(b):
		a += 1
		b += 1
	else:
		print(str(b) + ' ' + str(a))
		break


def isPrime(n):
	if n <= 1:
		return True
	if n <= 3:
		return False
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
n = int(input())
a = b = -1
for i in range(4, 10 ** 9):
	if isPrime(i):
		if isPrime(n + i):
			a = i
			b = n + i
			break
	if a > 0:
		break
print(str(b) + ' ' + str(a))


import random

def IsPrime(n):
	d = 2
	while d * d <= n and n % d != 0:
		d += 1
	return d * d > n
n = int(input())
r = random.randint(2, 100)
while IsPrime(r) or IsPrime(r + n):
	r = random.randint(2, 100)
print(r + n, r)


n = int(input())
a = n // 3 * 3
b = 4
while a - b != n:
	if a - b < n:
		a += 3
	else:
		b += 2
print('{} {}'.format(a, b))


import random as rd
n = int(input())
x = rd.randint(3, 10)
y = x - 1
print(n * x, ' ', n * y)


import os
import sys
from io import BytesIO, IOBase
import math

def solve(n):
	if n % 2 == 0:
		print(10 + n, 10)
	elif n % 3 == 0:
		print(n + 12, 12)
	elif n % 3 == 1:
		print(n + 14, 14)
	else:
		print(n + 22, 22)

def main():
	solve(int(input().strip()))
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline()
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


x = int(input())
print(9 * x, 8 * x)


import sys
input = sys.stdin.readline
from math import ceil, floor, factorial

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0):
	hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(1000000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
n = int(input())
if n % 2 == 0:
	print(*(4 + n, 4))
else:
	print(*(9 + n, 9))


n = int(input())
print(n * 10, n * 9)


def prm(n):
	if n <= 3:
		return True
	ans = True
	c = 0
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			ans = False
			return ans
	return ans
n = int(input())
if n % 2 == 0:
	print(4 + n, 4)
elif abs(9 - n) <= 9:
	for i in range(9, 10 ** 9 + 1):
		if prm(i) == False:
			if prm(abs(n - i)) == False:
				if abs(n - i) >= 4:
					if abs(i - abs(n - i) == n):
						print(max(i, abs(n - i)), min(i, abs(n - i)))
						break
else:
	for i in range(n + 4, 10 ** 9 + 1):
		if prm(i) == False:
			if prm(abs(n - i)) == False:
				if abs(n - i) >= 4:
					if abs(i - abs(n - i)) == n:
						print(max(i, abs(n - i)), min(i, abs(n - i)))
						break


import os
import io
n = int(input())
if n % 2 == 0:
	print(n + 4, 4)
else:
	for i in range(1, 10000, 2):
		k = i ** 2
		if k > n and k - n > 2:
			print(k, k - n)
			break


n = int(input())
if n % 2 == 1:
	print(n + 9, 9)
else:
	print(n + 4, 4)


n = int(input())
if n == 1:
	print(9, 8)
elif n % 2 == 0:
	print(n + 10, 10)
else:
	print(n + 9, 9)


def prime(n):
	for i in range(2, n):
		if n % i == 0:
			return False
	return True
n = int(input())
if prime(n) and n != 2:
	print(n + 9, 9)
elif n == 2:
	print(6, 4)
else:
	print(2 * n, n)


def comp(n):
	if n <= 1:
		return False
	if n <= 3:
		return False
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
n = int(input())
a = [4, 6, 8, 9, 10]
for i in a:
	if comp(i + n):
		print(i + n, i)
		break


n = int(input())
a = n
b = 0
comp1 = 0
comp2 = 0
temp1 = 2
temp2 = 2
while True:
	comp1 = 0
	comp2 = 0
	temp1 = 2
	temp2 = 2
	while temp1 <= a ** 0.5:
		if a // temp1 == a / temp1 and a != temp1:
			comp1 = 1
			break
		else:
			temp1 += 1
	if not comp1:
		a += 1
		b += 1
		continue
	else:
		while temp2 <= b ** 0.5:
			if b // temp2 == b / temp2 and b != temp2:
				comp2 = 1
				break
			else:
				temp2 += 1
	if comp1 and comp2:
		print(a, b, end=' ')
		break
	else:
		a += 1
		b += 1


k = int(input())
if k % 2 == 0:
	print(k + 4, 4)
else:
	print(9 + k, 9)


n = int(input())
tt = 0
if n == 2:
	print(6, 4)
elif n % 2 == 0:
	print(n + n, n)
else:
	for i in range(4, 10 ** 24):
		a = i
		b = i + n
		for j in range(2, a // 2):
			if a % j == 0:
				for k in range(2, b // 2):
					if b % k == 0:
						tt = 1
						print(b, a)
						break
			if tt == 1:
				break
		if tt == 1:
			break


def isprime(p):
	if p < 4:
		return True
	for i in range(2, p // 2):
		if p % i == 0:
			return False
	return True
n = int(input())
b = 2
a = b + n
while True:
	if isprime(a) or isprime(b):
		a += 1
		b += 1
	else:
		break
print(str(a) + ' ' + str(b))


import sys
from math import sqrt, floor, factorial
from collections import deque, Counter
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def c_p(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return True
	return False

def solve():
	n = int(inp())
	s = 4
	while not (c_p(s) and c_p(s + n)):
		s += 1
	print(s + n, s)
solve()


import sys
import math
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
a = 9 * n
b = 8 * n
print(a, b)


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
for b in range(4, 999999999):
	if not isPrime(b):
		if not isPrime(n + b):
			print(f'{n + b} {b}')
			break


a = int(input())
print(a * 10, a * 10 - a)


def isComposite(n):
	if n <= 1:
		return False
	if n <= 3:
		return False
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False

def solve(nbr):
	i = 4
	while i < 10000000000.0:
		if isComposite(i):
			if isComposite(i + nbr):
				print(i + nbr, ' ', i)
				break
		i += 1
q = int(input())
solve(q)


import math
import copy
n = int(input())
print(9 * n, 8 * n)


from sys import *
n = int(stdin.readline())
if n % 2 == 0:
	b = 4
	a = n + 4
else:
	b = 9
	a = n + 9
print(a, b)


n = int(input())
if n == 1:
	print(9, 8)
else:
	print(n * 4, n * 3)


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from collections import defaultdict as dd
(n,) = I()
if n == 1:
	print(9, 8)
else:
	print(3 * n, 2 * n)


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def main():
	n = inin()
	if n % 2 == 1:
		print(9 + n, 9)
	else:
		print(4 + n, 4)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


n = int(input())
if n % 2 == 0:
	print(n + 4, 4)
else:
	print(n + 15, 15)


n = int(input())
if n == 1:
	print(9, 8)
elif n == 2:
	print(10, 8)
else:
	print(6 * n, 5 * n)


from sys import stdin, stdout
from math import sqrt
n = int(input())
print(10 * n, 9 * n)


def isnotprime(n):
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
n = int(input())
b = 2
while 1:
	if isnotprime(b):
		a = n + b
		if isnotprime(a):
			break
	b += 1
print(str(a) + ' ' + str(b))


import math

def divisor(n):
	large_divisors = []
	for k in range(1, int(math.sqrt(n) + 1)):
		if n % k == 0:
			yield k
			if k * k != n:
				large_divisors.append(n // k)
	for d in reversed(large_divisors):
		yield d
n = int(input())
a = 100 + n
b = 100
while len(list(divisor(a))) == 2 or len(list(divisor(a))) == 2:
	a -= 1
	b -= 1
print('{} {}'.format(a, b))


n = int(input())
b = 10
a = b + n
while not ((a % 2 == 0 or a % 3 == 0 or a % 5 == 0) and (b % 2 == 0 or b % 3 == 0 or b % 5 == 0)):
	a += 1
	b += 1
print(a, b)


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
x = 4
while True:
	if not isPrime(x + n):
		print(x + n, x)
		break
	x += 2


INF = 10 ** 10

def main():
	n = get_int()
	if n == 1:
		print(9, 8)
	else:
		print(3 * n, 2 * n)
import sys
from collections import defaultdict, Counter
from bisect import bisect_left, bisect_right
import math
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda : int(input())
get_list = lambda : list(map(int, input().split()))
main()
print(*out, sep='\n')


n = int(input())
if n == 1:
	print(9, 8)
elif n == 2:
	print(6, 4)
elif n == 3:
	print(9, 6)
else:
	print(3 * n, 2 * n)


a = int(input())
c = d = 0
if a % 2 == 0:
	c = 4
	d = c + a
else:
	c = 9
	d = c + a
print(d, c)


n = int(input())

def check(x):
	i = 2
	while i * i <= x:
		if x % i == 0:
			return True
		i += 1
	return False
a = 4
while True:
	if check(a) == True and check(n + a) == True:
		print(a + n, end=' ')
		print(a)
		break
	else:
		a += 1


def check(x):
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			return True
	return False
n = int(input())
x = 4
while True:
	if check(x) and check(x + n):
		print(x + n, x)
		break
	x += 1


def ques(n):
	if n % 2 == 0:
		print(n + 4, 4)
	else:
		print(n + 9, 9)
n = int(input())
ques(n)


from bisect import bisect_left as bl
from bisect import bisect_right as br
import heapq
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split(' ')]

def st():
	return input().rstrip('\n')

def val():
	return int(input())

def li2():
	return [i for i in input().rstrip('\n').split(' ')]

def isprime(a):
	for i in range(2, int(a ** 0.5) + 1):
		if a % i == 0:
			return False
	return True
n = val()
j = 4
while True:
	if not isprime(j) and (not isprime(j + n)):
		print(j + n, j)
		exit()
	j += 1


import math
n = int(input())

def is_composite(n):
	if n == 2:
		return False
	if n == 3:
		return False
	else:
		for i in range(2, int(math.sqrt(n)) + 1):
			if n % i == 0:
				return True
		return False
i = 4
while i >= 4:
	if is_composite(i):
		if is_composite(n + i):
			print(n + i, i)
			break
		else:
			i += 1
	else:
		i += 1


def is_prime(x):
	a = 2
	while a * a <= x:
		if x % a == 0:
			return False
		a += 1
	return True

def calc(n):
	for a in range(2, 10 ** 9):
		if not is_prime(a) and (not is_prime(a + n)):
			return map(str, [a + n, a])
	return None
n = int(input())
print(' '.join(calc(n)))


n = int(input())
print(str(n * 9) + ' ' + str(n * 8))


n = int(input())
num = 2
num1 = num + n
while True:
	(c1, c2) = (0, 0)
	num1 = num + n
	for i in range(2, int(num ** 0.5) + 1):
		if num % i == 0:
			c1 = 1
			break
	for i in range(2, int(num1 ** 0.5) + 1):
		if num1 % i == 0:
			c2 = 1
			break
	if c1 == 1 and c2 == 1:
		break
	num += 1
print(num1, num)


from math import sqrt

def is_prime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solution(n):
	y = 4
	x = y + n
	while True:
		y += n
		x += n
		if not is_prime(x) and (not is_prime(y)):
			print(x, y)
			break
solution(int(input()))


def is_prime(q):
	q = abs(q)
	if q == 2:
		return True
	if q < 2 or q & 1 == 0:
		return False
	return pow(2, q - 1, q) == 1
n = int(input())
i = 4
while True:
	j = i + n
	a = is_prime(i)
	b = is_prime(j)
	if a or b:
		i += 1
	else:
		break
print(j, i)


n = int(input())
print(n * 15, n * 14, sep=' ')


n = int(input())
import math

def composite(a):
	c = 0
	for i in range(2, int(math.pow(a, 0.5)) + 1):
		if a % i == 0:
			c = 1
			break
	if c == 1:
		return 'yes'
	else:
		return 'no'
i = 1
d = 1
while d > 0:
	if composite(i) == 'yes' and composite(i + n) == 'yes':
		d = 0
	i += 1
l = [str(i + n - 1), str(i - 1)]
print(' '.join(l))


def check_prime(n):
	for i in range(2, int(n ** 0.5)):
		if n % i == 0:
			return True
	return False

def main():
	n = int(input())
	(a, b) = (0, 4)
	while True:
		a = n + b
		if check_prime(a):
			return str(a) + ' ' + str(b)
		b += 2
print(main())


n = int(input())
print(9 * n, 8 * n, sep=' ')


import sys
import math as mt
import bisect
t = 1
for _ in range(t):
	n = int(input())
	print(9 * n, 8 * n)


n = int(input())
if n == 1:
	print(15, 14)
else:
	print(3 * n, 2 * n)


n = int(input())
if n % 2 == 0:
	a = 4
	b = 4 + n
else:
	a = -1
	if (n + 4) % 3 == 0:
		b = n + 4
	elif (n + 6) % 3 == 0:
		b = n + 6
	else:
		b = n + 8
	a = b - n
strs = str(b) + ' ' + str(a)
print(strs)


def isPrimes(n):
	if n == 1:
		return True
	if n == 2:
		return True
	if n % 2 == 0:
		return False
	d = 3
	while n % d != 0 and d * d <= n:
		d += 2
	return d * d > n
n = int(input())
b = 4
a = n + b
while isPrimes(a) or isPrimes(b):
	a += 1
	b += 1
print('%d %d' % (a, b))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve(case):
	n = int(inp())
	if n % 2 == 0:
		print(4 + n, 4)
	else:
		print(9 + n, 9)
testcase(1)


def iscomposite(a):
	count = 0
	for i in range(2, a):
		if count == 1:
			break
		if a % i == 0:
			count += 1
	if count > 0:
		return True
	else:
		return False
n = int(input())
if n == 1:
	print(9, 8)
elif n == 2:
	print(6, 4)
elif iscomposite(n):
	print(2 * n, n)
else:
	p = 0
	p = n + 1
	while iscomposite(p) == False or iscomposite(p + n) == False:
		p += 1
	print(p + n, p)


i = int(input())
if i == 1:
	print(9, 8)
else:
	print(i * 9, i * 8)


def is_comp(n):
	c = 0
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			c += 1
			if n // i != i:
				c += 1
	return c
n = int(input())
i = n + 1
while True:
	if 2 < is_comp(i) and 2 < is_comp(i - n):
		print(i, i - n)
		break
	i += 1


import math

def is_prime(n):
	if n == 1:
		return False
	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False
	return True
num = int(input())
former = num + 4
latter = 4
while is_prime(former) or is_prime(latter):
	former += 1
	latter += 1
print(former, latter)
exit(0)


(x, i) = (int(input()), 4)

def one(x):
	for i in range(2, x // 2 + 1):
		if x % i == 0:
			return True
	return False
while 1:
	a = i
	b = a + x
	if one(a) and one(b):
		exit(print(b, a))
	i += 1


n = int(input())
for i in range(n + 2, n * 22):
	test1 = 0
	for f in range(2, 10):
		if i % f == 0 and i != f:
			test1 = 1
			break
	for j in range(2, n * 100):
		test2 = 0
		if i - j < n:
			break
		else:
			for k in range(2, 10):
				if j % k == 0 and j != k:
					test2 = 1
					break
			if i - j == n and test1 == 1 and (test2 == 1):
				print(i, ' ', j)
				exit(0)


n = int(input())
(a, b, c) = (8, 9, 10)
if (8 + n) % 3 == 0:
	print(8 + n, 8)
elif (9 + n) % 3 == 0:
	print(9 + n, 9)
else:
	print(10 + n, 10)


n = int(input())
if n == 1:
	print('{} {}'.format(9, 8))
else:
	print('{} {}'.format(9 * n, 8 * n))


def isprime(p):
	if p in [1, 2]:
		return True
	for i in range(2, int(p ** 0.5) + 1):
		if p % i == 0:
			return False
	return True
n = int(input())
(a, b) = (2 + n, 2)
while True:
	if a - b == n:
		if not isprime(a) and (not isprime(b)):
			print(a, b, sep=' ')
			break
	(a, b) = (a + 1, b + 1)
	if a == 100:
		break


n = int(input())
count = 0
if n == 1:
	print('9', '8')
else:
	print(n * 3, n * 2)


import os
import sys
from io import BytesIO

def isPrime(x):
	if x < 3:
		return True
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			return False
	return True
a = int(input())
if isPrime(a + 8):
	print(a + 9, 9)
else:
	print(a + 8, 8)


n = int(input())
b = 8
if n == 1:
	a = n + b
	print(a, b)
else:
	b = n * 8
	a = n + b
	print(a, b)


import math

def Composite(n):
	if n == 1:
		return False
	for i in range(2, int(math.ceil(n ** 0.5)) + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
b = 4
while True:
	if Composite(b) and Composite(n + b):
		print(n + b, b)
		break
	else:
		b += 1


n = int(input())
m = n * 2
found = False

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
while not found:
	for i in range(2, m):
		if m - i == n and (not isPrime(i)):
			print(str(m) + ' ' + str(i))
			found = True
			break
	m *= 2


k = 10 ** 7 + 5
n = int(input())
if n % 2 == 0:
	print('{} {}'.format(2 * n + 2, n + 2))
else:
	print('{} {}'.format(k, k - n))


import math
x = int(input())
y = 3
z = 4
result = 0
result2 = 0

def composite(n):
	if n <= 1:
		return False
	if n <= 3:
		return False
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
while True:
	result = x * y - x
	flag_for_y = composite(result)
	if result2 - result == x and flag_for_y and flag_for_z:
		print(result2, result)
		break
	else:
		y += 1
	result2 = x * z - x
	flag_for_z = composite(result2)
	if result2 - result == x and flag_for_z and flag_for_y:
		print(result2, result)
		break
	else:
		z += 1


from math import *

def prime(n):
	if n == 1:
		return False
	i = 2
	while i <= sqrt(n):
		if n % i == 0 and n // i != 0:
			return False
		i += 1
	return True
n = int(input())
i = 2 + n
while prime(i) or prime(i - n):
	i += 1
print(i, i - n)


d = int(input())
if d == 1:
	print(9, 8)
else:
	print(3 * d, 2 * d)


n = int(input())
valor1 = (n + n) * 4
valor2 = valor1 + n
print(valor2, valor1)


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
n = int(input())
if n % 2 != 0:
	print(9 + n, 9)
else:
	print(4 + n, 4)


n = int(input())
if n & 1:
	print(25 + n, 25)
else:
	print(4 + n, 4)


n = int(input())
if n % 2 == 0:
	x = n + 1000
	print(x, 1000)
else:
	print(9 + n, 9)


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
n = int(input())
print([str(4 + n) + ' ' + str(4), str(9 + n) + ' ' + str(9)][n % 2])


a = eval(input())
print('{1} {0}'.format(8 * a, 9 * a))


n = int(input())
print('%d %d' % (9 * n, 8 * n))


n = int(input())
a = 18 * n // 2
b = 16 * n // 2
print(a, b, sep=' ')


number = int(input())
number_the_biggest = number * 9
number_smaller = number_the_biggest - number
print(number_the_biggest, number_smaller)


n = int(input())
b = 9 if n & 1 else 8
print(n + b, b)


def isPrime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
a = n
b = n * 2
while isPrime(a) or isPrime(b):
	a = a + 1
	b = b + 1
print(b, a)


n = int(input())
if n == 1:
	print(15, 14)
elif n == 2:
	print(16, 14)
elif n % 2 == 1:
	print(n * 3, n * 3 - n)
else:
	print(n * 2, n * 2 - n)


def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
import math
mod = 1000000007
abc = 'abcdefghijklmnopqrstuvwxyz'
n = ii()
a = n * 9
b = n * 8
print(a, b)


def prost(a):
	nDel = 0
	for d in range(1, a + 1):
		if a % d == 0:
			nDel += 1
		if nDel > 2:
			break
	return nDel
n = int(input())
for b in range(1, 1000000001):
	if prost(b) > 2 and prost(b + n) > 2:
		print(b + n, b)
		break


import sys
n = int(input())
if n == 1:
	print(9, 8)
	sys.exit(0)
if n % 2 != 0:
	a = 9
	b = n + 9
else:
	a = 2 * n
	b = 3 * n
print(b, a)


def isPrime(n):
	if n in (2, 3):
		return True
	if n % 2 == 0:
		return False
	for i in range(3, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
n = int(input())
(a, b) = [1, 1]
if n % 2 == 0:
	b = 4
	a = b + n
else:
	b = 9
	a = b + n
while isPrime(a) or isPrime(b):
	a = a + 1
	b = b + 1
print(a, b)


n = int(input())
if n % 2 == 0:
	out = str(n + 4) + ' 4'
	print(out)
else:
	out = str(n + 9) + ' 9'
	print(out)


t = int(input())
a = t * 8
b = a + t
print(b, a)


def iscomp(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return True
		i += 1
	return False
n = int(input())
b = 4
a = n + b
while iscomp(a) == False or iscomp(b) == False:
	b += 1
	a = n + b
print(a, b)


def read_nums():
	return [int(x) for x in input().split()]

def is_composite(n):
	for i in range(2, n):
		if n % i == 0:
			return True
	return False

def main():
	(n,) = read_nums()
	for i in range(2, 10 ** 9):
		if is_composite(i) and is_composite(i + n):
			print(i + n, i)
			return
main()


def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True
N = int(input())
B = 2
while 1:
	A = B + N
	if not isprime(A) and (not isprime(B)):
		print(A, B)
		break
	else:
		B += 1


t = 1
for i in range(t):
	n = int(input())
	print(9 * n, 8 * n)


import math
a = int(input())
print(str(9 * a) + ' ' + str(8 * a))


from math import sqrt

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def ii():
	return int(input())

def si():
	return input()
mod = 1000000007

def divisor(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return True
	return False
n = ii()
for i in range(2, 1000000000):
	if divisor(i) and divisor(i + n):
		print(i + n, end=' ')
		print(i)
		break


for nt in range(1):
	n = int(input())
	if n % 2 == 0:
		print(n + 4, 4)
	else:
		print(n + 9, 9)


from math import *
from copy import *
from string import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
from collections import defaultdict

def solve(x):
	if x == 1:
		print(9, 8)
	else:
		print(x * 3, x * 2)
N = int(stdin.readline())
solve(N)


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
MOD = 10 ** 9 + 7
n = int(input())
if n % 2 == 0:
	print(10 ** 9 - 4, 10 ** 9 - 4 - n)
else:
	print(10 ** 9 - 5, 10 ** 9 - 5 - n)


n = int(input())
if n == 1:
	print(21, 20)
else:
	print(3 * n, 2 * n)


import math

def compcheck(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return True
	return False
n = int(input())
c = 4
while 1:
	x = c + n
	if compcheck(x):
		print(f'{x} {c}')
		break
	else:
		c += 1
		while not compcheck(c):
			c += 1


n = int(input())
a = 16 * n
b = 15 * n
print(str(a) + ' ' + str(b))


import sys
from math import gcd
from heapq import heappop
from heapq import heappush
from heapq import heapify
from bisect import insort
from bisect import bisect_right
from bisect import bisect_left
from sys import stdin, stdout
from collections import defaultdict, deque
from math import log2, ceil, floor
inp = lambda : int(input())
sip = lambda : input()
mulip = lambda : map(int, input().split())
lst = lambda : list(map(int, input().split()))
slst = lambda : list(sip())
arr2d = lambda x: [[int(j) for j in input().split()] for i in range(x)]
odds = lambda l: len(list(filter(lambda x: x % 2 != 0, l)))
evens = lambda l: len(list(filter(lambda x: x % 2 == 0, l)))
mod = pow(10, 9) + 7
Judge = 0
if Judge:
	sys.stdin = open('input.in', 'r')

def check_composite(n, a, d, s):
	x = pow(a, d, n)
	if x == 1 or x == n - 1:
		return False
	for r in range(1, s):
		x = x * x % n
		if x == n - 1:
			return False
	return True

def miller_rabin(n):
	if n < 2:
		return False
	r = 0
	d = n - 1
	while d & 1 == 0:
		d >>= 1
		r += 1
	base = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]
	for a in base:
		if n == a:
			return True
		if check_composite(n, a, d, r):
			return False
	return True
n = inp()
a = 4
b = a + n
while True:
	if not miller_rabin(a) and (not miller_rabin(b)):
		print(max(a, b), min(a, b))
		break
	else:
		a += 1
		b += 1


def isComposite(n):
	if n <= 1:
		return False
	if n <= 3:
		return False
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
n = int(input())
a = n + 4
b = 4
while True:
	composite_a = isComposite(a)
	composite_b = isComposite(b)
	if composite_a == True and composite_b == True:
		break
	else:
		a += 1
		b += 1
print(a, b)


def is_comp(x):
	if x < 4:
		return False
	elif x % 2 == 0:
		return True
	i = 3
	while i * i <= x:
		if x % i == 0:
			return True
		i += 2
	return False
n = int(input())
b = 2
a = n + b
while not is_comp(b) or not is_comp(a):
	b += 1
	a = n + b
print(a, b)


def isprime(n):
	if n == 1:
		return False
	for i in range(2, n // 2 + 1, 1):
		if n % i == 0:
			return False
	return True
n = int(input())
if isprime(n + 8):
	print(n + 9, 9)
else:
	print(n + 8, 8)


t = int(input())
if t == 1:
	print(9, 8)
else:
	print(t * 3, t * 2)


from collections import defaultdict, deque
from itertools import permutations
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from copy import deepcopy
int_input = lambda : int(stdin.readline())
string_input = lambda : stdin.readline()
multi_int_input = lambda : map(int, stdin.readline().split())
multi_input = lambda : stdin.readline().split()
list_input = lambda : list(map(int, stdin.readline().split()))
string_list_input = lambda : list(string_input())
MOD = pow(10, 9) + 7
n = int_input()
print(9 * n, 8 * n)


n = int(input())
if n % 2 == 0:
	n1 = 4
	n2 = 4 + n
	print(str(n2) + ' ' + str(n1))
else:
	n1 = 9
	n2 = 9 + n
	print(str(n2) + ' ' + str(n1))


n = int(input())
if n >= 1 and n <= pow(10, 7):
	a = 9 * n
	b = 8 * n
	if a >= 2 and a <= pow(10, 9) and (b >= 2) and (b <= pow(10, 9)):
		print(a, b)


import sys
import math
input = sys.stdin.readline
t = int(input())
for x in range(t + 1000, t + 1105):
	if x % 2 == 0 and (x + t) % 3 == 0:
		print(x + t, x)
		exit()


import math

def isPrime(n):
	if n < 2:
		return False
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
a = n + 1
while 1:
	if isPrime(a) == False and isPrime(n + a) == False:
		print(n + a, a, sep=' ')
		break
	a += 1


n = int(input())

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
for i in range(2, 10000000):
	if isPrime(i) == False and isPrime(i + n) == False:
		print(i + n, i)
		break


from collections import defaultdict as dc
import sys
import math
mod = 10 ** 9 + 7

def bs(a, x):
	i = bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return len(a)

def bs(a, b):
	l = a
	r = b + 1
	x = b
	ans = 0
	while l < r:
		mid = (l + r) // 2
		if x | mid > ans:
			ans = x | mid
			l = mid + 1
		else:
			r = mid
	return ans

def digit(n):
	a = []
	while n > 0:
		a.append(n % 10)
		n = n // 10
	return a

def inp():
	p = int(input())
	return p

def line():
	p = list(map(int, input().split()))
	return p
a = inp()
if a == 1:
	print(9, 8)
else:
	print(4 * a, 3 * a)


n = int(input())
print(21 * n, 20 * n)


from math import ceil, sqrt, floor

def isPrime(h):
	return all([h % i for i in range(2, floor(sqrt(h)))])
n = int(input())
a = 4
b = n + 1
while isPrime(b):
	b += 1
while b - a != n:
	if b - a > n:
		a += 1
		while isPrime(a):
			a += 1
	else:
		b += 1
		while isPrime(b):
			b += 1
print(b, a)


n = int(input())
men = 8
if n == 1:
	print('9' + ' ' + str(men))
elif (men + n) % 3 != 0 and (men + n) % 2 != 0 and ((men + n) % 5 != 0):
	print(str(men + n + 1) + ' ' + str(men + 1))
else:
	print(str(men + n) + ' ' + str(men))


t = int(input())
if t == 1:
	print(9, 8)
elif t == 2:
	print(8, 6)
else:
	print(t * 5, t * 4)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from bisect import insort
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
from itertools import permutations, combinations
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
out = lambda x: stdout.write(str(x) + '\n')

def prime(n):
	f = True
	for i in range(2, int(math.sqrt(n))):
		if n % i == 0:
			f = False
			break
	return f
t = 1
for _ in range(t):
	n = ip()
	ch = [i for i in range(1, max(n, 100))]
	for i in ch:
		if not prime(n + i) and (not prime(i)):
			a = n + i
			b = i
			break
	print(n + i, i)


c = int(input())
if c % 2 == 0:
	print(str(4 + c) + ' 4')
else:
	print(str(9 + c) + ' 9')


n = int(input())

def f(x, y):
	c = 0
	d = 0
	for i in range(2, y):
		if y % i == 0:
			c = 1
			break
		else:
			continue
	for i in range(2, x):
		if x % i == 0:
			d = 1
			break
		else:
			continue
	if c == 1 and d == 1:
		s = str(y) + ' ' + str(x)
		return s
	else:
		return f(x + 1, y + 1)
print(f(4, 4 + n))


n = int(input())
for i in range(4, 10 ** 9, 2):
	tmp = i + n
	for j in range(2, int(tmp ** 0.5) + 1):
		if tmp % j == 0:
			print(tmp, i)
			exit(0)


v = int(input())
if v > 1:
	print(3 * v, 2 * v)
else:
	print(9, 8)


n = int(input())
if n == 1:
	print('9 8')
else:
	s = str(3 * n) + ' ' + str(2 * n)
	print(s)


import math

def is_composite(x):
	for i in range(2, x):
		if x % i == 0:
			return True
	return False
n = int(input())
b = n
a = 2 * n
while not is_composite(a) or not is_composite(b):
	a += 1
	b += 1
print(str(a) + ' ' + str(b))


def isPrime(n):
	if n < 4 or n == 5 or n == 7:
		return True
	if n % 2 == 0 or n % 3 == 0 or n % 5 == 0 or (n % 7 == 0):
		return False
	for i in range(9, int(n ** 0.5) + 1, 2):
		if n % i == 0:
			return False
	return True
n = int(input())
a = 4
b = 0
while True:
	b = n + a
	if isPrime(a) or isPrime(b):
		a += 1
	else:
		break
print('{} {}'.format(max(a, b), min(a, b)))


def prime(n):
	f = 0
	for i in range(2, n):
		if n % i == 0:
			break
	else:
		f = 1
	return f
n = int(input())
a = 2
b = 2 + n
while prime(a) != 0 or prime(b) != 0:
	a = a + n
	b += n
print(b, a)


import sys
import collections
import heapq
import math
import bisect
input = sys.stdin.readline

def rints():
	return map(int, input().strip().split())

def rstr():
	return input().strip()

def rint():
	return int(input().strip())

def rintas():
	return [int(i) for i in input().strip().split()]

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
from itertools import accumulate
t = int(input())
if t == 1:
	print(9, 8)
else:
	a = 3 * t
	b = 2 * t
	print(a, b)


n = int(input())
for i in range(2, 10000000000):
	a = n + i
	b = i
	if a != 2 and a != 3 and (a != 5) and (a != 7):
		if b != 2 and b != 3 and (b != 5) and (b != 7):
			if a % 2 == 0 or a % 3 == 0 or a % 5 == 0 or (a % 7 == 0):
				if b % 2 == 0 or b % 3 == 0 or b % 5 == 0 or (a % 7 == 0):
					print(a, b)
					break


n = int(input())
for i in range(n + 2, n + 1000):
	if (i % 2 == 0 or i % 3 == 0) and ((i - n) % 2 == 0 or (i - n) % 3 == 0) and (i != 2 and i != 3) and (i - n != 2 and i - n != 3):
		print(i, i - n)
		break


n = int(input())
print(16 * n, 15 * n)


x = int(100000000.0 + 11)
n = int(input())
if n % 2 == 1:
	print(x, x - n)
else:
	print(x - 11, x - n - 11)


n = int(input())
if n == 1:
	print(7777, 7776)
else:
	print(3 * n, n + n)


import sys
from operator import itemgetter
input = sys.stdin.readline
from collections import defaultdict as dc
from bisect import bisect_left, bisect_right
import math
n = int(input())
print(9 * n, 8 * n)


n = int(input())
p = []

def is_prime(x):
	return True if x in [2, 3] else not any((x % n == 0 for n in range(2, int(x ** 0.5) + 1)))
for x in range(2, 1000000001 - n):
	if is_prime(x) or is_prime(x + n):
		p.append(x)
	else:
		print(x + n, x)
		break


def main():
	n = int(input())
	(a, b) = (9 * n, 8 * n)
	print(a, b)
main()


n = int(input())
if n % 2 == 0:
	(b, a) = (n + 8, 8)
else:
	(b, a) = (n + 9, 9)
print(b, a)


n = int(input())
if n % 2 == 0:
	print(n + 4, 4)
elif n % 2 != 0 and (n - 1) % 3 == 0:
	p = n + 8
	print(p, 8)
elif n % 2 != 0 and (n + 1) % 3 == 0:
	p = n + 9
	print(p, 9)
elif n % 2 != 0 and n % 3 == 0:
	p = n + 6
	print(p, 6)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		rr.append(JA([n * 9, n * 8], ' '))
	return JA(rr, '\n')
print(main())


n = int(input())
print(22 * n, 21 * n)


n = int(input())
print(f'{n * 8 + n} {n * 8}')


n = int(input())
k = n * 4
m = k + n
if m % 3 == 0 or m % 2 == 0:
	print(m, k)
else:
	m += 1
	k += 1
	if k % 3 == 0 or k % 2 == 0:
		print(m, k)
	else:
		m += 2
		k += 2
		if k % 3 == 0 or k % 2 == 0:
			print(m, k)
		else:
			m += 1
			k += 1
			print(m, k)


n = int(input())

def is_prime(n):
	if n == 1:
		return False
	for k in range(2, int(n ** 0.5) + 1):
		if n % k == 0:
			return False
	return True
i = 2
while True:
	if not is_prime(i) and (not is_prime(i + n)):
		print(i + n, i)
		break
	i += 1


n = int(input())

def isPrime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
for i in range(1, 10 * (n + 1)):
	if not isPrime(i) and (not isPrime(i + n)):
		print(i + n, i)
		break


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
a = 9 * n
b = 8 * n
print(str(a) + ' ' + str(b))


b = int(input())
if b & 1:
	print(b + 9, 9)
else:
	print(b + 4, 4)


def is_prime(n):
	if n in [2, 3, 5, 7]:
		return True
	if n % 2 == 0:
		return False
	r = 3
	while r * r <= n:
		if n % r == 0:
			return False
		r += 2
	return True
diff = int(input())
i = 1
while True:
	num = diff + i
	if not is_prime(num) and (not is_prime(num + diff)):
		print(num + diff, num)
		break
	i += 1


from math import ceil

def isPrime(n):
	if n in [2, 3, 5, 7, 11]:
		return True
	r = ceil(n ** 0.5)
	for i in range(2, r + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(2, 10 ** 9 + 1):
	if not isPrime(i) and (not isPrime(n + i)):
		print(n + i, i)
		break


n = int(input())
print(50 * n, 49 * n)


def isPrime(num):
	if num == 1:
		return True
	elif num == 2 or num == 3:
		return True
	i = 2
	while i * i <= num:
		if num % i == 0:
			return False
		i += 1
	return True

def main():
	n = int(input())
	a = 4
	b = a + n
	printed = False
	while not printed:
		if not isPrime(a) and (not isPrime(b)):
			print(b, a)
			printed = True
			return None
		a += 1
		b += 1
main()


a = int(input())
c = 9 if a % 2 else 4
print(a + c, c)


def isPrime(n):
	if n == 1 or n == 0 or n == 2 or (n == 3):
		return True
	if n == 4:
		return False
	s = int(n ** (1 / 2))
	for i in range(2, s + 2):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(1, 1000000):
	if not isPrime(i) and (not isPrime(i + n)):
		print(i + n, i)
		break


def iscomposite(n):
	ans = 0
	for i in range(2, n):
		if n % i == 0:
			ans = 1
			break
		else:
			ans = 0
	if ans:
		return 1
	else:
		return 0
n = int(input())
i = 4
while i:
	if iscomposite(i + n) and iscomposite(i):
		print('%d %d' % (i + n, i))
		break
	i += 1


def comp(a):
	for i in range(2, a // 2 + 1):
		if a % i == 0:
			return 1
	return 0
n = int(input())
i = 4
while 1:
	if comp(n + i) == 1 and comp(i) == 1:
		print(max(i, n + i), min(i, n + i))
		break
	else:
		i += 1


def is_prime(n):
	if n < 2:
		return False
	i = 2
	while i <= n ** 0.5:
		if n % i == 0:
			return False
		i += 1
	return True
n = int(input())
for i in range(4, 10 ** 9):
	if is_prime(i) == False and is_prime(n + i) == False:
		print(n + i, i)
		break


a = int(input())
if a % 2 == 0:
	print(4 + a, 4)
else:
	print(9 + a, 9)


n = int(input())
if n % 2 == 0:
	print(8 + n, 8)
else:
	print(9 + n, 9)


def main():
	n = int(input())
	if n % 2 == 0:
		print(100 + n, 100)
	else:
		print(9 + n, 9)
t = 1
for i in range(t):
	main()


a = int(input())
print(15 * a, 14 * a)


n = int(input())
if n % 2 == 0:
	print(n + 10, 10)
else:
	print(n + 15, 15)


import sys
import math
import heapq
import collections

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputstringnum():
	return [ord(x) - ord('a') for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
n = inputnum()
print(9 * n, 8 * n)


i = int(input())
o = True
j = 10
c = []
while o == True:
	if j % 2 == 0 or j % 3 == 0:
		if (j + i) % 2 == 0 or (j + i) % 3 == 0:
			c.append(j)
			c.append(j + i)
			break
	if len(c) != 0:
		break
	else:
		j += 1
print(str(c[1]) + ' ' + str(c[0]))


def Composite(a):
	if a == 2:
		return False
	elif a % 2 == 0:
		return True
	else:
		for i in range(3, int(a ** 0.5), 2):
			if a % i == 0:
				return True
	return False
target = int(input())
below = filter(Composite, (i for i in range(target, 10 ** 9)))
for i in below:
	if Composite(target + i) == True:
		print(target + i, i)
		break


n = int(input())
if n % 2 == 0:
	print(100 + n, 100)
else:
	print(27 + n, 27)


import math
n = int(input())
if n == 1:
	print(9, 8)
else:
	f1 = 0
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			f1 = 1
			break
	if f1 == 1:
		print(2 * n, n)
	else:
		print(3 * n, 2 * n)


def pro(x):
	y = 2
	while y * y <= x:
		if x % y == 0:
			return True
		y += 1
	return False
n = int(input())
a = n + 2
b = 2
while not (pro(a) and pro(b)):
	a += 1
	b += 1
print(a, b)


def solve(n):
	a = n * 9
	b = n * 8
	print(a, b)
n = int(input())
solve(n)


n = int(input())
ans = []

def IsPrime(n):
	d = 2
	while n % d != 0:
		d += 1
	return d == n
a = 8
b = a + n
while IsPrime(b):
	if IsPrime(a):
		a = a + 1
	else:
		a = a + 1
		b = a + n
print(str(b) + ' ' + str(a))


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	N = int(input())
	b = 8 * N
	a = b + N
	print(a, b)
main()


def isP(a):
	for i in range(2, int(a ** 0.5) + 1):
		if a % i == 0:
			return 0
	return 1
n = int(input(''))
i = 4
while True:
	while isP(i):
		i += 1
	c = n + i
	if isP(c):
		i += 1
	else:
		sol1 = c
		sol2 = i
		break
print(sol1, ' ', sol2)


N = int(input())
print(N * 9, N * 8)


n = int(input())
b = n + 1
a = b + n
if a == 2 or b == 2:
	a += 1
	b += 1
if a == 3 or b == 3:
	a += 1
	b += 1
while a % 6 == 1 or a % 6 == 5 or b % 6 == 1 or (b % 6 == 5):
	a += 1
	b += 1
print(a, end=' ')
print(b)


import math

def com(num):
	for i in range(2, int(math.sqrt(num)) + 1):
		if num % i == 0:
			return True
	return False
n = int(input())
a = n + 4
b = 4
while not com(a) or not com(b):
	a += 1
	b += 1
print(a, ' ', b)


def isPrime(n):
	if n <= 1:
		return 0
	if n <= 3:
		return 1
	if n % 2 == 0 or n % 3 == 0:
		return 0
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return 0
		i = i + 6
	return 1
n = int(input())
for i in range(n + 4, n + 1000):
	if isPrime(i) == 0 and isPrime(i - n) == 0:
		print(i, i - n)
		break


n = int(input())
for a in range(n, 10 ** 9 + 1):
	c1 = 0
	c2 = 0
	b = a - n
	for i in range(2, a):
		if a % i == 0:
			c1 = 1
			break
	if c1 == 1:
		for i in range(2, b):
			if b % i == 0:
				c2 = 1
				break
	if c1 == 1 and c2 == 1:
		print(a, b)
		break


def is_prime(n):
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
n = int(input())
i = 4
while True:
	if is_prime(i) or is_prime(i + n):
		i += 1
		continue
	print('{} {}'.format(i + n, i))
	break


n = int(input())
a = n * 10
b = n * 9
print(str(a) + ' ' + str(b))


n = int(input())

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
a = 1
while 1:
	a += 1
	if not is_prime(a):
		if not is_prime(n + a):
			print(a + n, a)
			exit()


n = int(input())
print(9 * n, 8 * n, end=' ')


n = int(input())
if not n % 2:
	print(4 + n, 4)
else:
	print(9 + n, 9)


def binario(f):
	valor = 0
	if f == 1:
		return 1
	for i in range(1, f + 1):
		if f % i == 0:
			valor = valor + 1
			if valor > 2:
				return 0
				break
	if valor == 2:
		return 1
n = int(input())
index = 0
bucle = 0
if n % 2 == 0:
	a = n + 1
	b = a - n
else:
	a = n + 2
	b = a - n
final = 1
while index == 0:
	if binario(a) == 1:
		a = a + 1
	elif binario(b) == 1:
		b = b + 1
	if binario(a) == 0 and binario(b) == 0:
		while final == 1:
			a = b + n
			if binario(a) == 0 and binario(b) == 0:
				print(a, b)
				final = 2
				index = 5
			else:
				b = b * 2


from math import sqrt

def composite(a):
	for j in range(2, int(sqrt(a))):
		if a % j == 0:
			return True
	return False
n = int(input())
for i in range(n, 10 ** 9):
	if composite(i) == True:
		if composite(n + i) == True:
			print(n + i, i)
			break


def isComposite(n):
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
n = int(input())
i = 4
while True:
	if isComposite(i):
		if isComposite(i + n):
			print(i + n, i)
			break
		else:
			i += 1
	else:
		i += 1


import sys

class AEquation:

	def solve(self):
		import math
		n = int(input())
		a = n + 1
		k = math.ceil(n / 2)
		if n % 2 == 0:
			print(2 * k + 4, 4)
		else:
			print(2 * (k + 4), 9)
solver = AEquation()
input = sys.stdin.readline
solver.solve()


try:
	t = int(input())
	print(t * 8 + t, ' ', t * 8)
except EOFError as e:
	pass


i = int(input())
print(i * 9, end=' ')
print(i * 8)


n = 1
while n:
	n -= 1
	t = int(input())
	if t % 2:
		print(t + 9, 9)
	else:
		print(t + 4, 4)


def prime(n):
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return 1
	return 0
n = int(input())
d = pow(10, 7)
for i in range(2, d):
	h = prime(i)
	if h == 1:
		k = prime(n + i)
		if k == 1:
			print(n + i, i)
			break


def solve():
	n = int(input())
	print(9 * n, 8 * n)
solve()


c = int(input())
print(9 * c, 8 * c, sep=' ')


n = int(input())
if n % 2 == 0:
	print(100000002, 100000002 - n)
else:
	print(100000005, 100000005 - n)


def isComposite(n):
	i = 2
	while i < n:
		if n % i == 0:
			break
		else:
			i += 1
	if i == n or n == 1:
		return False
	else:
		return True
n = int(input())
b = 4
while True:
	if isComposite(b) and isComposite(b + n):
		break
	else:
		b += 1
print(b + n, b)


import math, sys
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
lili = lambda : list(map(int, sys.stdin.readlines()))
li = lambda : list(map(int, input().split()))
I = lambda : int(input())
S = lambda : input().strip()

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = I()
k = 4
while True:
	if isPrime(k) or isPrime(k + n):
		k += 1
	else:
		print(k + n, k)
		break


N = int(input())
if N == 1:
	print(9, 8)
else:
	print(N * 3, N * 2)


diff = int(input())

def check(num):
	flag = 0
	i = 2
	while i < num:
		if num % i == 0:
			flag = 1
			break
		i = i + 1
	return flag
i = 4
while i >= 4:
	if check(i) == 0 or check(i + diff) == 0:
		i = i + 1
		continue
	if check(i) == 1 and check(i + diff) == 1:
		print(i + diff, end=' ')
		print(i)
		break


import sys
import math

def rint():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().rstrip('\n')

def oint():
	return int(input())

def check_prime(num):
	if all((num % i != 0 for i in range(2, int(math.sqrt(num)) + 1))):
		return 1
	else:
		return 0
n = oint()
if n % 2 == 0:
	print(n + 4, 4)
else:
	print(n + 9, 9)


n = int(input())
print((str(9 + n) + ' 9', str(8 + n) + ' 8')[(8 + n) % 2 == 0 or (8 + n) % 3 == 0])


t = int(input())
print(t * 9, t * 8)


x = int(input())
if x % 2 == 0:
	print(str(x + 8) + ' ' + str(8))
else:
	print(str(x + 9) + ' ' + str(9))


diff = int(input())
if diff % 2 == 0:
	print(6 + diff, 6)
else:
	print(9 + diff, 9)


def is_compound(n):
	for i in range(2, n):
		if n % i == 0:
			return True
	return False
n = int(input())
a = 0
b = 0
for b in range(0, 10 ** 9):
	if is_compound(b):
		a = n + b
		if is_compound(a):
			break
	else:
		continue
print(a, b)


def isprime(x):
	for i in range(2, int(x / 2)):
		if x % i == 0:
			return False
	return True
n = int(input())
i = 4
while True:
	if isprime(i):
		i += 1
		continue
	else:
		b = n + i
		if not isprime(b):
			print(b, ' ', i)
			break
		else:
			i += 1
			continue


from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 6)
input = stdin.readline
n = int(input().rstrip())
if n % 2 == 0:
	print(n + 4, 4)
else:
	print(n + 9, 9)


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
i = int(input())
if i == 1:
	print(9, 8)
	exit()
a = 4
b = a + i
while isPrime(a) or isPrime(b):
	a += i
	b = a + i
print(b, a)


z = input
import math
a = int(z())
if a == 1:
	print(9, 8)
	exit(0)
x = a * 3
p = x - a
print(x, p)


def solve(n):
	return str(15 * n) + ' ' + str(14 * n)
n = int(input())
print(solve(n))


x = int(input())
if x == 1:
	print(9, 8)
else:
	print(3 * x, 2 * x)


n = int(input())
i = 4
t = 0
while t == 0:
	count = 0
	for j in range(2, i):
		if i % j == 0:
			count += 1
			break
	if count != 0:
		p = i + n
		for j in range(2, p):
			if p % j == 0:
				t = 1
				print(p, i)
				break
	i += 1


x = int(input())
x1 = 10 * x
x2 = 9 * x
print(str(x1) + ' ' + str(x2))


n_in = int(input())
a = n_in * 9
b = a - n_in
print(a, b)


n = int(input())
if n == 2:
	print(6, 4)
elif n % 2 == 0:
	print(2 * n, n)
else:
	print(n + 9, 9)


n = int(input())
i = 2
j = 3
if n % 2 == 0:
	k = pow(2, i)
	print(k + n, k)
else:
	k = pow(3, j)
	print(k + n, k)


import pdb
import math as mm

def solve(n):
	a = 0
	b = 0
	b2 = False
	b1 = False
	calc = 0
	for i in range(1, 10):
		b2 = False
		b1 = False
		a = n * i
		b = n * (i + 1)
		for j in range(2, a):
			if a % j == 0:
				b2 = True
				break
		for k in range(2, b):
			if b % k == 0:
				b1 = True
				break
		if b2 and b1:
			calc = int(mm.fabs(a - b))
		if calc == n:
			return (b, a)
user = int(input())
(x, y) = solve(user)
print(x, y)


cmp = lambda x: any((x % i == 0 for i in range(2, int(x ** 0.5) + 1)))
n = int(input())
for i in range(20):
	if cmp(i) and cmp(n + i):
		print(n + i, i)
		break


x = int(input())
flag = 0
i = 4
while flag == 0:
	l = x + i
	if (l - 1) % 6 != 0 and (l + 1) % 6 != 0 and ((i - 1) % 6 != 0) and ((i + 1) % 6 != 0):
		flag += 1
	else:
		i += 1
print(l, ' ', i)


def is_prime(n: int) -> bool:
	if n <= 3:
		return n > 1
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i ** 2 <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i += 6
	return True

def solve(n):
	a = 4
	b = a + n
	while is_prime(a) or is_prime(b):
		a += 1
		b += 1
	print(f'{b} {a}')
n = int(input())
solve(n)


from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
mod = 10 ** 9 + 7
eps = 10 ** (-7)

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))

def inpl_str():
	return list(sys.stdin.readline().split())
N = inp()
(a, b) = (N + 10, 10)
while True:
	if (a % 2 == 0 or a % 3 == 0) and (b % 2 == 0 or b % 3 == 0):
		print(a, b)
		break
	a += 1
	b += 1


t = int(input())
if t % 2 == 0:
	a = 4
	b = a + t
else:
	a = 9
	b = a + t
print(b, a)


try:
	n = int(input())
	print(str(n * 9) + ' ' + str(n * 8))
except:
	pass


def isPrime(n):
	for i in range(2, n):
		if n % i == 0:
			return False
	return True
n = int(input())
if n == 1:
	print(9, 8)
elif n == 2:
	print(6, 4)
elif isPrime(n):
	print(n * 3, n * 2)
else:
	print(2 * n, n)


t = int(input())
l1 = []
if t % 2 != 0:
	l1.append(9 + t)
	l1.append(9)
else:
	l1.append(4 + t)
	l1.append(4)
for i in range(2):
	print(l1[i], end=' ')


def prime(n):
	for i in range(2, n):
		if n % i == 0:
			return False
	return True
n = int(input())
for i in range(6, 5000):
	if prime(i) == False:
		if prime(i + n) == False:
			b = i
			a = i + n
			break
print(a, b)


n = int(input())
if n % 3 == 0:
	print(6 + n, 6)
elif n % 3 == 1:
	print(8 + n, 8)
else:
	print(4 + n, 4)


n = int(input())
k = n * 9
print(k, k - n)


def iscomposite(n):
	for i in range(2, int(n / 2) + 1):
		if n % i == 0:
			return 1
			break
n = int(input())
l = []
if 1 <= n <= 10 ** 7:
	for i in range(1, 10 ** 7):
		if iscomposite(i) and iscomposite(i + n):
			print(i + n, i)
			break


def prime(n):
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
if n == 1:
	print(9, 8)
elif n == 2:
	print(6, 4)
else:
	x = prime(n)
	if x == True:
		print(n + 9, 9)
	elif prime(n + 4):
		print(n + 15, 15)
	else:
		print(n + 4, 4)


import sys
import math

def read_line():
	return sys.stdin.readline()[:-1]

def read_int():
	return int(sys.stdin.readline())

def read_int_line():
	return [int(v) for v in sys.stdin.readline().split()]
n = read_int()
if n % 2 == 0:
	print(n + 4, 4)
else:
	print(n + 9, 9)


n = int(input())
print('{} {}'.format(9 * n, 8 * n))


import sys

def solve_equation(n):
	b = 9 * n
	a = 10 * n
	return (a, b)

def solve(io):
	N = io.read_int()
	(a, b) = solve_equation(N)
	io.println(a, b)

class IO:
	in_stream = None
	out_stream = None
	raw = ''
	buf = []
	pos = 0

	def __init__(self, input_stream, output_stream):
		self.in_stream = input_stream
		self.out_stream = output_stream

	def read_to_buffer(self):
		self.raw = self.in_stream.readline().rstrip('\n')
		self.buf = self.raw.split()
		self.pos = 0

	def read_string(self):
		while self.pos == len(self.buf):
			self.read_to_buffer()
		ans = self.buf[self.pos]
		self.pos += 1
		return ans

	def read_int(self):
		return int(self.read_string())

	def read_float(self):
		return float(self.read_string())

	def read_string_array(self, N, offset=0):
		arr = [None] * offset
		for _ in range(0, N):
			arr.append(self.read_string())
		return arr

	def read_int_array(self, N, offset=0):
		arr = [None] * offset
		for _ in range(0, N):
			arr.append(self.read_int())
		return arr

	def read_float_array(self, N, offset=0):
		arr = [None] * offset
		for _ in range(0, N):
			arr.append(self.read_float())
		return arr

	def read_line(self):
		while self.pos == len(self.buf):
			self.read_to_buffer()
		if self.pos > 0:
			raise ValueError('Cannot call read_line in the middle of a line.')
		self.pos = len(self.buf)
		return self.raw

	def print(self, *args):
		self.out_stream.write(' '.join([str(x) for x in args]))

	def println(self, *args):
		self.print(*args)
		self.print('\n')

	def println_array(self, arr, sep=' '):
		self.println(sep.join((str(x) for x in arr)))

	def flush_output(self):
		self.out_stream.flush()
pythonIO = IO(sys.stdin, sys.stdout)
solve(pythonIO)
pythonIO.flush_output()


a = int(input())
if a == 1:
	print(9, 8)
else:
	print(a * 4, a * 3)


a = int(input())
for i in range(4, 1000000000):
	p = 0
	y = 0
	o = 0
	for k in range(2, i - 1):
		if i % k == 0:
			o = o + 1
			if o == 1:
				y = i + a
				for z in range(2, y - 1):
					if y % z == 0:
						p = p + 1
						if o == 1:
							print(y, i)
							exit()


def prime(n):
	if n < 2:
		return False
	for i in range(2, int(n ** (1 / 2)) + 1):
		if n % i == 0:
			return False
	return True
n = int(input())
i = 3
j = n + 3
while True:
	if not prime(i) and (not prime(j)):
		print(j, i)
		break
	i += 1
	j += 1


def solve(n):
	if n == 1:
		return (10, 9)
	if n == 2:
		return (6, 4)
	if n % 2 == 0:
		return (n + 4, 4)
	else:
		return (3 * n, 2 * n)

def main():
	n = int(input())
	print(*solve(n))
main()


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
from sys import stdin, stdout
from collections import Counter
from math import ceil
from bisect import bisect_left
from bisect import bisect_right
import math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def lessThanX(a, x):
	i = bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def isprime(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return False
	return True

def BinarySearchFromRight(a, x):
	i = bisect_right(a, x)
	if i != len(a) + 1 and a[i - 1] == x:
		return i - 1
	else:
		return -1

def BinarySearch(a, x):
	i = bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	else:
		return -1

def main():
	n = ip()
	print(9 * n, 8 * n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
ip = lambda : int(sys.stdin.readline().rstrip('\r\n'))
ai = lambda : list(map(int, sys.stdin.readline().split()))
ei = lambda : map(int, sys.stdin.readline().split())
main()


def check(a):
	flag = False
	c = 2
	while c <= a ** 0.5:
		if a % c == 0 and a != c:
			flag = True
			return flag
		else:
			c += 1
	return flag
n = int(input())
b = n
flag = True
while flag:
	a = b + n
	if check(a) and check(b):
		flag = False
	else:
		b += 1
print(a, b)


n = int(input())
k = n
count = 0
ar = [4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20]
for i in ar:
	if ((n + i) % 2 == 0 or (n + i) % 3 == 0) and abs(n + i) >= 4:
		print(abs(n + i), i)
		break


def check_compo(any_num):
	for i in range(2, int(any_num ** 0.5) + 1):
		if any_num % i == 0:
			return True
	return False
num = int(input())
compo = 6
while True:
	b = num + compo
	if check_compo(b):
		print(b, compo)
		break
	else:
		compo += 1
		while check_compo(compo) is not True:
			compo += 1


import sys, math, queue, collections
MOD = 10 ** 9 + 7
n = int(input())
print(9 * n, 8 * n)


_ = int(input())
print(_ * 9, _ * 8)


def f(n):
	if n % 2 == 0:
		return (n + 4, 4)
	else:
		return (n + 9, 9)
n = int(input())
a = f(n)
print(a[0], a[1])


def solve(test):
	n = int(input())
	if n % 3 == 1:
		print(8 + n, 8)
	elif n % 3 == 2:
		print(4 + n, 4)
	else:
		print(6 + n, 6)
t = 1
for _ in range(t):
	solve(_ + 1)


def isComp(i):
	for j in range(2, int(i ** 0.5) + 1):
		if i % j == 0:
			return True
	return False
n = int(input())
(a, b) = (0, 0)
for i in range(n, 10 ** 9 + 1):
	if isComp(i) and isComp(i + n):
		a = i + n
		b = i
		break
	elif isComp(i - n) and isComp(i):
		a = i
		b = i - n
print(a, b)


import sys
n = int(sys.stdin.readline().rstrip())

def main():
	if n & 1:
		b = 9
		a = b + n
	else:
		b = 4
		a = b + n
	return (a, b)
ans = main()
print(*ans, sep=' ')


for _ in range(1):
	n = int(input())
	if n == 1:
		print(15, 14)
	else:
		print(3 * n, 2 * n)


import sys
input = sys.stdin.readline

def prime_factorize(n, unique=False):
	b = 2
	fct = []
	while b * b <= n:
		while n % b == 0:
			n //= b
			fct.append(b)
		b = b + 1
	if n > 1:
		fct.append(n)
	if unique:
		return set(fct)
	else:
		return fct
n = int(input())
for i in range(4, 1000):
	if len(prime_factorize(i)) != 1:
		if len(prime_factorize(i + n)) != 1:
			print(i + n, i)
			exit()


from math import sqrt, inf

def is_prime(n):
	if n <= 1:
		return False
	for _ in range(2, int(sqrt(n)) + 1):
		if n % _ == 0:
			return False
	return True
n = int(input())
i = n + 1
while True:
	if not is_prime(i) and (not is_prime(n + i)):
		print(n + i, i)
		break
	i += 1


def seive():
	high = 10 ** 7
	primes = [False for i in range(high + 1)]
	p = 2
	while p * p < high:
		if primes[p] == False:
			for i in range(p * p, high + 1, p):
				primes[i] = True
		p += 1
	return primes

def solve():
	primes = seive()
	for (idx, prime) in enumerate(primes[1:]):
		if idx == 0:
			continue
		try:
			if primes[idx] == True and primes[idx + n] == True:
				return (idx + n, idx)
		except IndexError as IE:
			print('No solutions', IE)
			return (0, 0)
	(a, b) = (0, 0)
	return (a, b)
n = int(input())
print(9 * n, 8 * n)


n = int(input())
print(*[(n + 4, 4), (n + 9, 9)][n % 2])


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_strList_from_str = lambda : list(sys.stdin.readline().strip())
get_int = lambda : int(sys.stdin.readline().strip())
pt = lambda x: sys.stdout.write(str(x))
n = get_int()
if n % 2 == 0:
	b = 10
	a = n + b
	print(a, b)
else:
	b = 9
	a = n + b
	print(a, b)


from math import sqrt
from math import ceil

def is_composite(num):
	for d in range(ceil(sqrt(num)), 1, -1):
		if num % d == 0:
			return True
	return False
n = int(input())
maximum = 10 ** 9
a_start = 5 if n <= 5 else n + 1
for a in range(a_start, maximum + 2):
	b_start = a - n
	if b_start <= 3:
		continue
	if is_composite(a):
		for b in range(b_start, a):
			if a - b != n:
				continue
			if is_composite(b):
				print(f'{a} {b}')
				exit()


def solve(nbr):
	if nbr % 2 == 0:
		print(4 + nbr, '', 4)
	else:
		print(9 + nbr, '', 9)
q = int(input())
solve(q)


import sys

def main():
	t = int(input())
	if t % 2 == 0:
		print(str(t + 4) + ' 4')
	else:
		print(str(t + 9) + ' 9')
main()


def composite(n):
	print(n * 9, n * 8)
n = int(input())
composite(n)


n = int(input())
print(n * 10, n * 10 - n)


y = int(input())
if y % 2 == 0:
	print(y + 4, 4)
else:
	print(y + 9, 9)


def solve(n):
	return str(9 * n) + ' ' + str(8 * n)
n = int(input())
print(solve(n))


def main():
	n = int(input())
	if n % 2 == 0:
		print(n + 4, 4)
	else:
		print(n + 9, 9)
main()


n = int(input())
if n < 1000000:
	prime = [True for i in range(1000000 + 1)]
	p = 2
	while p * p <= 1000000:
		if prime[p] == True:
			for i in range(p * p, 1000000 + 1, p):
				prime[i] = False
		p += 1
	a = 4
	b = 4 + n
	while prime[a] == True or prime[b] == True:
		a = a + 1
		b = b + 1
	print(b, a)
else:
	a = 4
	b = 4 + n
	prime = [True for i in range(1000000 + 1)]
	p = 2
	while p * p <= 1000000:
		if prime[p] == True:
			for i in range(p * p, 1000000 + 1, p):
				prime[i] = False
		p += 1
	while True:
		while prime[a] != False:
			a = a + 1
		b = a + n
		i = 2
		while b % i != 0 and i < 100000:
			i = i + 1
		if i != 100000:
			break
		a = a + 1
	print(b, a)


def main():
	n = int(input())
	if n == 1:
		print('9 8')
	else:
		print(f'{3 * n} {2 * n}')
main()


import math

def primenum(x):
	count = 0
	if x == 1:
		return False
	else:
		for i in range(2, int(math.floor(math.sqrt(x))) + 1):
			if x % i == 0:
				count = count + 1
		if count == 0:
			return True
		else:
			return False
n = int(input())
x = 2
y = 2 + n
for i in range(100000):
	if primenum(x) == False and primenum(y) == False:
		print(y, x)
		break
	else:
		x = x + 1
		y = y + 1


inp = int(input())
if inp == 1:
	print(9, 8)
else:
	print(inp * 3, inp * 2)


n = int(input())
if n == 4:
	print(10, 6)
elif n % 2 == 0:
	print(n + 4, 4)
elif n == 1:
	print(9, 8)
else:
	for i in range(2, 7):
		if (n + 2 * i) % 3 == 0:
			print(n + 2 * i, 2 * i)
			break


def main():
	n = int(input())
	print(n * 9, n * 8)
main()


import math
from collections import defaultdict
ml = lambda : map(float, input().split())
ll = lambda : list(map(int, input().split()))
ii = lambda : int(input())
ip = lambda : list(input())
t = ii()
a = 4
b = a + t
f = 1
while f:
	f = 1
	s1 = set()
	s2 = set()
	for i in range(2, int(math.sqrt(a)) + 1):
		if a % i == 0:
			s1.add(i)
			if a // i != i:
				s1.add(a // i)
	for i in range(2, int(math.sqrt(b)) + 1):
		if b % i == 0:
			s2.add(i)
			if b // i != i:
				s2.add(b // i)
	if len(s1) > 0 and len(s2) > 0:
		f = 0
		break
	a += 1
	b += 1
print(b, a)


import math
n = int(input())
k = 0

def divisors(n):
	global k
	i = 2
	while i <= math.sqrt(n):
		if n % i == 0:
			k += 1
		i += 1
if n % 2 == 0:
	print(4 + n, 4, sep=' ')
else:
	divisors(n)
	if k > 0:
		print(2 * n, n)
	else:
		print(9 * n, 8 * n)


Num = int(input())
if Num % 2 == 0 and Num != 2:
	print(Num * 2, Num)
elif Num == 1:
	print(9, 8)
elif Num == 2:
	print(10, 8)
else:
	print(Num * 3, Num * 2)


n = int(input())
if n == 1:
	print(f'9 8')
else:
	print('{} {}'.format(3 * n, 2 * n))


import math
n = int(input())
if n == 1:
	print(9, 8)
elif n == 2:
	print(6, 4)
else:
	tf = False
	for i in range(2, math.ceil(math.sqrt(n))):
		if n % i == 0:
			tf = True
			break
	if tf:
		print(2 * n, n)
	else:
		print(3 * n, 2 * n)


def main(n):
	index = n + 1
	while True:
		x = index - n
		if x != 2:
			if x % 2 == 0:
				if index != 2:
					if index % 2 == 0:
						return [index, x]
		composite_x = False
		i = 2
		while i < x:
			if x % i == 0:
				composite_x = True
				break
			i = i + 1
		composite_index = False
		i = 2
		while i < index:
			if index % i == 0:
				composite_index = True
				break
			i = i + 1
		if composite_index and composite_x:
			return [index, x]
		index = index + 1
n = int(input())
res = main(n)
print(*res)


k = int(input())
print(16 * k, 15 * k)


import sys, math, string, bisect
input = sys.stdin.readline
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())

def find_gt(a, x):
	i = bisect_right(a, x)
	if i != len(a):
		return a[i]
	raise ValueError
n = I()
if n % 2 == 0:
	if n > 6:
		print(n + 4, 4)
	else:
		print(10, 10 - n)
elif n % 2 == 1:
	if n > 11:
		print(n + 9, 9)
	else:
		print(15, 15 - n)


n = int(input())
if n % 2 == 0:
	a = 4
	b = a + n
	print(b, a)
if n % 2 == 1:
	a = 4
	while a > 0:
		b = a + n
		if b % 3 == 0:
			print(b, a)
			break
		a += 2


from math import sqrt
from itertools import count, islice

def isPrime(n):
	return n > 1 and all((n % i for i in islice(count(2), int(sqrt(n) - 1))))
num = int(input())
curr = 4
while True:
	if isPrime(curr) == False and isPrime(num + curr) == False:
		print(num + curr, curr)
		break
	curr = curr + 1


n = int(input())
print(n * 8 + n, n * 8)


import math

def div(n):
	cnt = 0
	for i in range(1, math.ceil(math.sqrt(n)) + 1):
		if n % i == 0:
			if n / i == i:
				cnt += 1
			else:
				cnt += 2
			if cnt > 2:
				return True
	return False
n = int(input())
b = 4
while not div(n + b):
	b += 2
print(b + n, b)


n = int(input())
x = 1000000000
while True:
	if n % 2 == 0:
		if x % 2 == 0 and (x - n) % 2 == 0:
			print(x, x - n)
			break
		else:
			x -= 2
	elif x % 3 == 0:
		print(x, x - n)
		break
	else:
		x -= 1


num = int(input())
if num % 2 == 0:
	print(num + 4, 4)
else:
	print(num + 9, 9)


n = int(input())
print((8 + 1) * n, 8 * n)


n = int(input())
i = 3
a = False

def isComposite(num):
	for i in range(2, num):
		if num % i == 0:
			return True
	return False
while not a:
	a = isComposite(i) and isComposite(i + n)
	if a:
		print(i + n, i)
	i += 1


n = int(input())

def fuck(x):
	y = x ** 0.5
	for i in range(2, int(y) + 1):
		if x % i == 0:
			return 0
	return 1
i = 2
while True:
	if fuck(i + n) == 0 and fuck(i) == 0:
		print(i + n, i)
		break
	else:
		i += 1


n = int(input())
if n == 0:
	print('4 4')
elif n == 1:
	print('9 8')
else:
	print(str(3 * n) + ' ' + str(2 * n))


from math import sqrt

def isPrime(n):
	d = 2
	while d <= sqrt(n):
		if n % d == 0:
			return False
		d += 1
	return True

def equation(n):
	sol = []
	for i in range(n + 2, 10 ** 9 + 1):
		if not isPrime(i) and (not isPrime(n + i)):
			sol.append(n + i)
			sol.append(i)
			break
	for x in sol:
		print(x, end=' ')
n = int(input())
equation(n)


n = int(input())
if n == 1:
	print(15, 14)
elif n == 2:
	print(14, 12)
elif n == 3:
	print(15, 12)
elif n == 4:
	print(16, 12)
elif n == 5:
	print(15, 10)
elif n == 6:
	print(26, 20)
elif n == 7:
	print(27, 20)
elif n == 8:
	print(28, 20)
elif n == 9:
	print(27, 18)
elif n == 10:
	print(30, 20)
elif n == 11:
	print(33, 22)
elif n % 2 == 0:
	print(n + 4, 4)
else:
	print(n + 9, 9)


def kk(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
for b in range(2, 10 ** 9 - n):
	if kk(b) == False and kk(n + b) == False:
		print(n + b, b)
		break


number = int(input())
print(number * 9, number * 9 - number)


import math
t = int(input())
print(25 * t, 24 * t)


def is_ok(n):
	i = 2
	if n == 2:
		return False
	x = n ** 0.5 + 1
	while i < x:
		if n % i == 0:
			return True
		i += 1
n = int(input())
i = n + 2
while not is_ok(i) or not is_ok(i - n):
	i += 1
print(i, i - n)


n = int(input())
if n % 2:
	print(27 + n, 27)
else:
	print(4 + n, 4)


s = int(input())
print(s * 9, s * 8)


n = int(input())
temp = 10
a = n * temp
b = a - n
print(str(a) + ' ' + str(b))


import sys
import math

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
n = II()
if n == 1:
	print(9, 8)
else:
	print(n * 3, n * 2)


n = int(input())
a = 1
b = a + n
flag1 = 0
flag2 = 0
while flag1 == 0 or flag2 == 0:
	a += 1
	b += 1
	flag1 = 0
	flag2 = 0
	for i in range(2, a):
		if a % i == 0:
			flag1 = 1
			break
	for i in range(2, b):
		if b % i == 0:
			flag2 = 1
			break
print(str(b) + ' ' + str(a))


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools
from collections import deque, defaultdict, OrderedDict
import collections

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(1):
		n = ri()
		print(9 * n, 8 * n)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


(a, bn, count) = (0, 3, 4)
number = int(input())
prime = []
for num in range(1000):
	if num > 1:
		for i in range(2, num):
			if num % i == 0:
				break
			else:
				prime.append(num)
while a == 0:
	count += 1
	for o in prime:
		if o >= count:
			break
		elif count % o == 0:
			bn = count + number
			for m in prime:
				if m >= bn:
					break
				elif bn % m == 0:
					a = 1
					break
print(bn, count)


from sys import stdin
input = stdin.readline
n = int(input())
if n == 1:
	print(10, 9)
else:
	print(n * 3, n * 2)


n = int(input())
if n % 2 == 0:
	print(n + 4, 4)
else:
	a = n + 4
	while a % 3 != 0:
		a += 2
	print(a, a - n)


def isprime(n):
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
for i in range(4, 1000000):
	if isprime(i) == False and isprime(i + n) == False:
		print(i + n, i)
		break


n = int(input())

def is_prime(p):
	for i in range(2, int(p ** 0.5) + 1):
		if p % i == 0:
			return False
	return True
for a in range(1000000000):
	b = a - n
	if b > 2:
		if not is_prime(a):
			if not is_prime(b):
				print(a, b)
				break


n = int(input())
if n == 1:
	print(9, 8)
else:
	print(n * 5, n * 4)


n = int(input())
if n % 2 == 0:
	print(n + 4, 4)
elif (n + 4) % 3 == 0:
	print(n + 4, 4)
elif (n + 6) % 3 == 0:
	print(n + 6, 6)
elif (n + 8) % 3 == 0:
	print(n + 8, 8)


n = int(input())
A = []
if n % 2 == 0:
	A.append(n + 8)
	A.append(8)
	print(*A)
else:
	A.append(n + 15)
	A.append(15)
	print(*A)


n = int(input())
k = 8 * n
p = k + n
print(p, k)


from collections import Counter, deque, defaultdict, OrderedDict, namedtuple
from bisect import bisect_left, bisect_right, insort
from math import sqrt, ceil, floor, factorial, gcd

def p(n):
	d = 0
	if n == 1 or n == 2:
		return True
	prev = 1
	for i in range(2, int(sqrt(n) + 1)):
		if n % i == 0 and i != prev:
			d += 1
			prev = i
		if d > 0:
			break
	if d > 0:
		return False
	else:
		return True
from sys import stdin
n = int(stdin.readline())
a = 4
b = 0
while b == 0:
	if p(a) == False:
		if p(n + a) == False:
			b = n + a
			break
	a += 1
print(b, a)


def prime(num):
	for i in range(2, int(num ** 0.5) + 1):
		if num % i == 0:
			return False
	return True
n = int(input())
i = 1
while True:
	if not prime(i):
		if not prime(i + n):
			print(i + n, i)
			break
	i += 1


n = int(input())
if n == 1:
	print(9, end=' ')
	print(8)
elif n % 2 == 0:
	a = n + 4
	print(a, end=' ')
	print(4)
elif n % 2 != 0 and n != 1:
	a = n * 2
	b = n * 3
	print(b, end=' ')
	print(a)


a = int(input())
print(a * 16, a * 15)


import sys
input = sys.stdin.readline
n = int(input())
if n == 1:
	print(9, 8)
	exit()
if n == 2:
	print(8, 6)
	exit()
if n == 3:
	print(12, 9)
	exit()
if n % 2 == 0:
	print(n + 4, 4)
	exit()
print(n + 9, 9)


n = int(input())
print(8 + n % 2 + n, 8 + n % 2)


n = int(input())
counter = 0
sounter = 0
num1 = 8
num2 = num1 + n
while True:
	for i in range(2, num1):
		if num1 % i == 0:
			counter += 1
	for j in range(2, num2):
		if num2 % j == 0:
			sounter += 1
	if counter != 0 and sounter != 0:
		print(num2, num1, sep=' ')
		exit()
	else:
		num1 += 1
		num2 += 1
		counter = 0
		sounter = 0


import sys
import collections
from collections import Counter
import itertools
import math
import timeit

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=1):
	divisors = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				divisors.append(i)
			else:
				divisors.extend([i, n // i])
	return divisors

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
n = ii()
print(3 * n, 2 * n) if n > 1 else print(9, 8)


import math

def com(n):
	sqr = int(math.ceil(n / 2))
	for i in range(2, sqr + 1):
		if n % (i + 1) == 0:
			return True
	return False
n = int(input().strip())
a = 4
b = 4 + n
while not (com(a) and com(b)):
	a += n
	b += n
a = str(a)
s = str(b) + ' ' + str(a)
print(s)


number = int(input())
if number % 2 == 1:
	print(str(9 + number) + ' ' + str(9))
else:
	print(str(4 + number) + ' ' + str(4))


n = int(input())
if n == 0:
	print(6, 6)
	exit()
if n == 1:
	print(21, 20)
	exit()
a = 2 * n
b = 3 * n
print(b, a)


import sys
from random import choice, randint

def MI():
	return map(int, sys.stdin.readline().strip().split())

def LI():
	return list(map(int, sys.stdin.readline().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().strip().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def LS():
	return sys.stdin.readline().strip().split()

def I():
	return int(sys.stdin.readline().strip())

def F():
	return float(sys.stdin.readline().strip())

def S():
	return sys.stdin.readline().strip()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))
inp = sys.stdin.readline
out = sys.stdout.write

def main():
	n = I()
	print(n * 9, n * 8)
main()


i1 = int(input())
if i1 % 2 == 0:
	print(i1 * 2 + 2, i1 + 2)
else:
	r = i1 % 10
	if r > 5:
		print(max(15 - r, i1 + 15 - r), min(15 - r, i1 + 15 - r))
	elif r < 5:
		print(max(15 - r, i1 + 15 - r), min(15 - r, i1 + 15 - r))
	elif r == 5:
		print(i1 + 15, 15)


t = int(input())
if t == 1:
	print(9, 8)
else:
	print(4 * t, 3 * t)


a = int(input())
q = 4

def n(w):
	n = w
	counter = 0
	for i in range(1, n + 1):
		if n % i == 0:
			counter += 1
	return 1 if counter == 2 else 2
while True:
	if n(q + a) == 2 and n(q) == 2:
		print(q + a, q)
		break
	else:
		q += 1


l = int(input())

def composite(a):
	for i in range(2, a // 2):
		if a % i == 0:
			return True
	return False
a = 2
while True:
	if composite(a) and composite(a + l) == True:
		print(a + l, a)
		break
	else:
		a += 1


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def isPrime(x):
	if x == 1:
		return False
	for i in range(2, int(math.sqrt(x)) + 1):
		if x % i == 0:
			return False
	return True

def main():
	n = I()
	l = 4
	r = n + 4
	while True:
		if not isPrime(l) and (not isPrime(r)):
			return str(r) + ' ' + str(l)
		l += 1
		r += 1
print(main())


no = int(input())

def isprime(no):
	i = 2
	while i <= no ** 0.5:
		if no % i == 0:
			return False
		i += 1
	return True
i = 1
while True:
	if not isprime(i + no) and (not isprime(i)):
		print(i + no, i)
		break
	else:
		i += 1


x = int(input())
if x == 1:
	print(16, 15)
else:
	print(3 * x, 2 * x)


n = int(input())
if n % 2 == 0:
	print(n + 100, 100)
else:
	print(15 * n, 14 * n)


n = int(input())
primeDict = {1: False, 2: True}

def isPrime(n):
	if n in primeDict:
		return primeDict[n]
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			primeDict[n] = False
			return False
	primeDict[n] = True
	return True
i = 2
while True:
	if isPrime(n + i) == False and isPrime(i) == False:
		print(str(i + n) + ' ' + str(i))
		break
	i += 1


n = int(input())
cur = 4
(a, b) = (n + 4, 4)
p = 0
while p < 2:
	p = 0
	for i in range(2, a):
		if a % i == 0:
			p += 1
			break
	for i in range(2, b):
		if b % i == 0:
			p += 1
			break
	if p < 2:
		a += 1
		b += 1
		p = 0
print(a, b)


import math

def isPrime(x):
	list1 = range(2, math.floor(math.sqrt(x)) + 1)
	for i in list1:
		if x % i == 0:
			return False
		list1 = [y for y in list1 if y % i != 0]
	return True
n = int(input())
b = 4
for j in range(b, 100):
	if isPrime(j) == False:
		if isPrime(j + n) == False:
			print(n + j, j)
			break


def easy(x):
	n = True
	for i in range(2, x):
		if x % i == 0:
			n = False
			break
	return n
x = int(input())
i = 1
while easy(i) or easy(x + i):
	i += 1
print(i + x, i)


import sys
import math

def input():
	return sys.stdin.readline().strip()

def iinput():
	return [int(x) for x in sys.stdin.readline().split()]

def main():
	n = int(input())
	print(n * 9, n * 8)
	return
for ______ in range(1):
	main()


n = int(input())
if n == 1:
	print(9, 8)
else:
	num1 = 3 * n
	num2 = 2 * n
	print(num1, num2)


n = int(input())
accept = 0
b = 6
a = 6 + n
acceptA = 0
acceptB = 0
while accept == 0:
	acceptA = 0
	acceptB = 0
	for i in range(2, b):
		if b % i == 0:
			acceptB = 1
	for j in range(2, a):
		if a % j == 0:
			acceptA = 1
	if acceptA == 1 and acceptB == 1:
		print(a, b)
		break
	else:
		a += 1
		b += 1


def isComposite(n):
	if n <= 1:
		return False
	if n <= 3:
		return False
	if n % 2 == 0 or n % 3 == 0:
		return True
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return True
		i = i + 6
	return False
n = int(input())
for a in range(2, 1000000001, 1):
	b = a + n
	if isComposite(a) and isComposite(b):
		print(b, a)
		break


inp = input()
n = int(inp)
print(9 * n, 8 * n)


def prime(n):
	x = int(n ** 0.5)
	for i in range(2, x + 1):
		if n % i == 0:
			return 0
	return 1
n = int(input())
a = 4
b = 4 + n
while 1:
	if prime(a) or prime(b):
		a += 1
		b += 1
	else:
		print(b, a)
		break


def read_nums():
	return [int(x) for x in input().split()]

def equation(n):
	return (8 * n, 9 * n)
n = read_nums()[0]
result = equation(n)
print(f'{result[1]} {result[0]}')


n = int(input())
N = int(1000000000.0)

def p(x):
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			return 1
	return 0
for i in range(4, N):
	if p(i) == 1 and p(i + n) == 1:
		print(i + n, i)
		break


n = int(input())
if n == 1:
	print(9, 8)
elif n == 7:
	print(63, 56)
else:
	k = n * 4
	m = k + n
	if m % 3 == 0 or m % 2 == 0:
		print(m, k)
	else:
		m += 1
		k += 1
		if k % 3 == 0 or k % 2 == 0:
			print(m, k)
		else:
			m += 1
			k += 1
			if m % 3 == 0 or m % 2 == 0:
				print(m, k)
			else:
				m += 1
				k += 1
				if k % 3 == 0 or k % 2 == 0:
					print(m, k)
				else:
					m += 2
					k += 2
					print(m, k)


def answer():
	a = int(input())
	print(9 * a, 8 * a)
answer()


n = int(input())
if n % 2:
	print(n + 15, 15)
else:
	print(n + 6, 6)


def isPrime(x):
	if x <= 1:
		return False
	if x <= 3:
		return False
	if x % 2 == 0 or x % 3 == 0:
		return True
	i = 5
	while i * i <= x:
		if x % i == 0 or x % (i + 2) == 0:
			return True
		i = i + 6
	return False
n = int(input())
notFound = True
a = 2
while notFound:
	a = a << 1
	b = n + a
	if isPrime(b):
		notFound = False
print(b, a)


n = int(input())
let_a = 4
let_b = 0
flag = 0

def check(num1):
	r1 = num1 - 1
	r2 = num1 + 1
	if r1 % 6 == 0 or r2 % 6 == 0:
		return False
	return True
while True:
	let_a = let_a
	let_b = let_a + n
	result = check(let_a) and check(let_b)
	if result:
		break
	let_a += 1
print(let_b, let_a)


q = int(input())
print(9 * q, 8 * q)


import math

def isPrime(n):
	for i in range(2, n // 2):
		if n % i == 0:
			return 0
	return 1
n = int(input())
i = n + 1
while True:
	if not isPrime(i) and (not isPrime(i - n)):
		print(i, i - n)
		break
	i += 1


def isPrime(n):
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = int(input())
i = 1
while 1:
	if isPrime(i) == 0 and isPrime(i + n) == 0:
		print(i + n, i)
		break
	i += 1


n = int(input())
if n == 1:
	b = 8
	a = 9
else:
	b = 2 * n
	a = 3 * n
print(a, b)


n = int(input())
if n % 2 == 0:
	a = 4 + n
	b = 4
	print(a, b)
else:
	n1 = (n - 1) // 2
	a = 2 * n1 + 10
	b = 9
	print(a, b)


def comp_n(n):

	def composite(comp):
		for i in range(comp + 1, 10 ** 9):
			for j in range(2, i // 2 + 1):
				if i % j == 0:
					return i

	def prime(a):
		for i in range(2, a // 2 + 1):
			if a % i == 0:
				return True

	def result(b=composite(1)):
		if prime(n + b):
			return (n + b, b)
		else:
			return result(composite(b))
	return result()
n = int(input())
ans = comp_n(n)
print(ans[0], ans[1])


n = int(input())

def isComposite(n):
	b = [n, 4][n <= 4]
	a = b + n
	flag1 = flag2 = 0
	while True:
		while True:
			for i in range(2, b // 2 + 1):
				if b % i == 0:
					flag1 = 1
					break
			if flag1 == 1:
				break
			b += 1
		a = b + n
		flag2 = 0
		while True:
			for i in range(2, a // 2 + 1):
				if a % i == 0:
					flag2 = 1
					break
			if flag2 == 1:
				break
			a += 1
		if a - b == n:
			break
		b = a - n
		flag1 = 0
	print(a, b)
isComposite(n)


n = int(input())
if n % 2 == 0:
	print(n + 8, 8)
else:
	print(n + 15, 15)


def is_prime(n):
	l = []
	for i in range(1, n + 1):
		if n % i == 0:
			l.append(i)
	return l == [1, n]
n = int(input())
i = 4
while is_prime(n + i) == True:
	i += 2
print(str(n + i) + ' ' + str(i))


T_ON = 0
DEBUG_ON = 0
MOD = 998244353

def solve():
	n = read_int()
	if n == 1:
		print(10, 9)
	else:
		print(n * 3, n * 2)

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


n = int(input())
if n == 1 or n == 2:
	print(20 + n, 20)
else:
	print(n * 3, n * 2)


N = int(input())
if N % 2 == 0:
	print(N + 4, 4)
else:
	print(N + 9, 9)


import sys
n = int(sys.stdin.readline())
b = 9
a = b + n
if n % 2 == 0:
	a += 1
	b += 1
print(a, b)


def composite(n):
	for i in range(2, n // 2 + 1):
		if n % i == 0:
			return 1
n = int(input())
for i in range(4, 10 ** 9):
	if composite(i) and composite(i + n):
		print(i + n, i, sep=' ')
		break


a = int(input())
print(a * 8 + a, a * 8)


n = int(input())
if n & 1:
	b = 9
	a = n + 9
else:
	b = 4
	a = n + 4
print(a, b)


def isPrime(n):
	prime = [True for i in range(n + 1)]
	i = 2
	while i ** 2 <= n:
		if prime[i] == True:
			for j in range(i * 2, n + 1, i):
				prime[j] = False
		i += 1
	prime[0] = False
	prime[1] = False
	return prime[n]
n = int(input())
b = 8
a = b + n
if isPrime(a):
	b += 1
	a += 1
print(a, b)


import random

def modulo(base, exponent, mod):
	x = 1
	y = base
	while exponent > 0:
		if exponent % 2 == 1:
			x = x * y % mod
		y = y * y % mod
		exponent = exponent // 2
	return x % mod

def calculateJacobian(a, n):
	if a == 0:
		return 0
	ans = 1
	if a < 0:
		a = -a
		if n % 4 == 3:
			ans = -ans
	if a == 1:
		return ans
	while a:
		if a < 0:
			a = -a
			if n % 4 == 3:
				ans = -ans
		while a % 2 == 0:
			a = a // 2
			if n % 8 == 3 or n % 8 == 5:
				ans = -ans
		(a, n) = (n, a)
		if a % 4 == 3 and n % 4 == 3:
			ans = -ans
		a = a % n
		if a > n // 2:
			a = a - n
	if n == 1:
		return ans
	return 0

def solovoyStrassen(p, iterations):
	if p < 2:
		return False
	if p != 2 and p % 2 == 0:
		return False
	for i in range(iterations):
		a = random.randrange(p - 1) + 1
		jacobian = (p + calculateJacobian(a, p)) % p
		mod = modulo(a, (p - 1) / 2, p)
		if jacobian == 0 or mod != jacobian:
			return False
	return True
n = int(input())
iterations = 50
if n % 2 == 0:
	print(n + 4, 4)
else:
	h = 1
	m = 4
	while h:
		if solovoyStrassen(m, iterations) == False and solovoyStrassen(m + n, iterations) == False:
			print(m + n, m)
			h = 0
			break
		m += 1


def isprime(n):
	if n == 1:
		return False
	i = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += 1
	return True
n = int(input())
if isprime(n):
	num = n + 2
	steps = 2
	while True:
		b1 = not isprime(num)
		b2 = not isprime(steps)
		if b1 and b2:
			break
		num += 1
		steps += 1
	print(num, steps)
elif n == 1:
	print(9, 8)
else:
	print(2 * n, n)


import math
import sys

def prime(num):
	check = False
	for k in range(2, int(math.sqrt(num)) + 1):
		if num % k == 0:
			check = True
			break
	return check
n = int(input())
if n % 2 == 0:
	print(str(4 + n) + ' ' + '4')
else:
	for i in range(4, 1000000000):
		if prime(i) and prime(i + n):
			print(str(i + n) + ' ' + str(i))
			sys.exit()


from math import sqrt

def Nprime(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return True
	else:
		return False
a = int(input())
l = len(str(a))
n = ['1'] + ['0'] * l
n = int(''.join(n))
if n - a <= 4:
	n *= 10
while True:
	if Nprime(n) and Nprime(n - a):
		print(n, n - a)
		break
	if Nprime(n):
		pass
	else:
		n -= 1
	if Nprime(n - a):
		pass
	else:
		n -= 1


n = int(input())
t1 = 1024
c0 = 0
c1 = 0
while True:
	t = t1
	t2 = t + n
	for x in range(2, int(t ** 0.5) + 1):
		if t % x == 0:
			c1 = 1
			break
	for x in range(2, int(t2 ** 0.5) + 1):
		if t2 % x == 0:
			c0 = 1
			break
	if c1 == 1 and c0 == 1:
		print(str(t2) + ' ' + str(t))
		break
	c0 = 0
	c1 = 0
	t1 = t1 + 2


n = int(input())
a = 1

def composite(num):
	d = 0
	for i in range(2, num):
		if num % i == 0:
			d += 1
	if d > 0:
		return 1
	else:
		return 0
b = 1
while composite(a) == 0 or composite(b) == 0:
	a += 1
	b = n + a
print(b, a)


def kt(x):
	for i in range(2, x // 2):
		if x % i == 0:
			return 1
	return 0
n = int(input())
if n % 2 == 0:
	print(n + n + 2, n + 2)
else:
	a = 2 * n + 1
	t = kt(a)
	while t == 0:
		a += 2
		t = kt(a)
	b = a - n
	print(a, b)


from collections import deque
import math
import os
import random
import re
import sys

def main():
	n = int(input())
	print(n * 9, 8 * n)
main()


try:

	def div(a):
		c = 0
		for j in range(2, int((a + 1) / 2)):
			if a % j == 0:
				c += 1
		if c > 0:
			return True
		else:
			return False
	n = int(input())
	for i in range(2, 10 ** 9 + 1):
		if div(i) and div(i + n):
			print(i + n, end=' ')
			print(i)
			break
except:
	pass


def is_simple(n):
	if n % 2 == 0:
		return n == 2
	d = 3
	while d * d < n and n % d != 0:
		d += 2
	return d * d > n
i = 2
num = int(input())
while is_simple(i * num) or is_simple((i + 1) * num):
	i += 1
print((i + 1) * num, i * num)


n = eval(input())
if n == 1:
	print(9, 8)
else:
	print(3 * n, 2 * n)


n = int(input())
print(100 * n, 99 * n)


s = int(input())
if s == 1:
	print(9, 8)
elif s == 3:
	print(21, 18)
elif s % 2 == 0:
	print(4 + s, 4)
else:
	print(9 + s, 9)


import math
import sys

def is_prime(n):
	if n % 2 == 0 and n > 2:
		return False
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			return False
	return True
n = int(input())
for a in range(n + 2, 10 ** 9):
	b = a - n
	if not is_prime(a) and (not is_prime(b)):
		print(a, b)
		exit(0)


import math
n = int(input())
f = 3
a = True
b = True

def is_prime(x):
	root = int(math.sqrt(x))
	for i in range(2, root + 1):
		if x % i == 0:
			return False
	return True
if n % 2 == 0:
	print(n + 4, 4)
else:
	while a or b:
		f += 1
		a = True
		b = True
		a = is_prime(f)
		b = is_prime(f + n)
	print(f + n, f)


def isprime(n):
	if n == 1:
		return 0
	elif n == 2:
		return 1
	else:
		for i in range(2, int(n ** 0.5) + 1):
			if n % i == 0:
				return 0
		return 1
n = int(input())
for i in range(8, 10000000001):
	b = i + n
	if isprime(i) == 0 and isprime(b) == 0:
		print(b, i)
		break


from math import fmod as mod
n = int(input())
if mod(n, 2) == 0:
	print(n + 4, 4)
else:
	print(n + 9, 9)


import math

def iscomposite(n):
	if 0 < n <= 2:
		return False
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return True
	return False

def notokrange(n):
	if 2 <= n <= 10 ** 9:
		return False
	return True

def equ(n):
	for a in range(2, 10 ** 9 + 1):
		b = a - n
		if notokrange(b):
			continue
		elif iscomposite(a) and iscomposite(b):
			print(a, b)
			quit()
a = int(input())
equ(a)


N = int(input())
print(N * 9, N * 9 - N)


from sys import stdin
t = int(stdin.readline().rstrip())
print(str(9 * t) + ' ' + str(8 * t))


import math

def isComposite(num):
	if num < 4:
		return False
	for i in range(2, int(math.sqrt(num)) + 1):
		if num % i == 0:
			return True
	return False
n = int(input())
s = 4
while True:
	if isComposite(s) and isComposite(s + n):
		print(str(s + n) + ' ' + str(s))
		break
	else:
		s += 1


def chk(x):
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			return 1
	return 0
n = int(input())
for i in range(3, 10 ** 9):
	n2 = n * i
	n1 = n * (i - 1)
	if n == 1:
		if chk(n2) and chk(n1):
			break
	else:
		break
print(n2, n1)


def isComposite(n):
	i = 5
	if n <= 1:
		return 0
	if n <= 3:
		return 0
	if n % 2 == 0 or n % 3 == 0:
		return 1
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return 1
		i += 6
	return 0
n = int(input())
list_pri = []
list_pri.append(0)
for i in range(1, 10 ** 9):
	if isComposite(i) and isComposite(i + n):
		print(i + n, i)
		break


def prime(x):
	if x <= 3:
		return True
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			return False
	return True

def main():
	n = int(input())
	for a in range(1, 10 ** 5):
		if not prime(a) and (not prime(a + n)):
			print(a + n, a)
			return
main()


import sys
import math
input = sys.stdin.readline
n = int(input())
print(9 * n, 8 * n)


def prime(num):
	x = 2
	if num == 1:
		return False
	while x * x <= num:
		if num % x == 0:
			return False
		x += 1
	return True
a = 0
n = int(input())
if n == 1:
	a = 2
else:
	a = n
b = 0
while True:
	if not prime(a):
		b = a + n
		if not prime(b):
			break
		else:
			a += 1
	else:
		a += 1
print(b, a)


n = int(input())
(a, b) = (3 * n, 2 * n)
if n == 1:
	(a, b) = (10, 9)
if n == 0:
	(a, b) = (10, 10)
print(str(a) + ' ' + str(b))


n = int(input())
temp = 2

def composite(x):
	for i in range(2, x // 2):
		if x % i == 0:
			return 1
	return 0
while not composite(temp) or not composite(temp + n):
	temp += 1
print(str(temp + n) + ' ' + str(temp))


n = int(input())
b = n * 2 * 4
a = b + n
print(str(a) + ' ' + str(b))


n = int(input())
a = 2 * n
b = n
k = 0
if n == 1:
	print('9 8')
elif n == 2:
	print('12 10')
elif n == 3:
	print('9 6')
elif n == 5:
	print('15 10')
elif n == 11:
	print('99 88')
elif n == 29:
	print('261 232')
else:
	for i in range(2, a):
		if k == 1:
			break
		elif a % i == 0:
			for j in range(2, b):
				if b % j == 0:
					k = 1
					print(a, b)
					break
			a = a + 1
			b = b + 1
	a = a + 1
	b = b + 1


from sys import stdin
inp = lambda : stdin.readline().strip()
n = int(inp())
a = 0
b = 0
if n % 2:
	b = 9
else:
	b = 4
a = b + n
print(a, b)


n = int(input())
m = n * 10
o = n * 9
flag = 0
for i in range(2, 10 ** 9):
	if flag == 1:
		break
	if m % i == 0:
		for j in range(2, 10 * 9):
			if o % j == 0:
				print(m, o)
				flag = 1
				break
	else:
		o = o + 1
		m = m - 1


def prime(x):
	for i in range(2, int(x ** 0.5) + 1):
		if x % i == 0:
			return False
			break
	return True
a = int(input())
i = 2
while True:
	if prime(i + a) == prime(i) == False:
		print(i + a, i)
		break
	i += 1


def check(b):
	ct = 0
	for i in range(1, b + 1):
		if b % i == 0:
			ct += 1
		if ct > 2:
			return True
	return False

def find(n):
	(a, b) = (4, 4)
	while True:
		while check(a) == False:
			a += 1
		b = a + n
		if check(b):
			return (a, b)
		a += 1
n = int(input())
ans = find(n)
print(ans[1], ans[0])


n = int(input().strip())
from math import gcd

def is_prime(n):
	if n <= 2:
		return True
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True
a = n + 1
b = a - n
while is_prime(a) or is_prime(b):
	a += 1
	b = a - n
print(str(a) + ' ' + str(b))


(a, b) = (0, 0)
n = int(input())
if n == 1:
	(a, b) = (9, 8)
elif n % 2 == 0:
	(a, b) = (n + 4, 4)
else:
	(a, b) = (3 * n, 2 * n)
print(a, b)


given = int(input())
print(*[9 * given, 8 * given])


for i in range(1):
	n = int(input())
	if n == 1:
		print(9, 8)
		continue
	print(n * 3, n * 2)


def is_composite(n):
	i = 2
	while i < n:
		if n % i == 0:
			return True
		i += 1
	return False
num = int(input())
i = 1
while True:
	if is_composite(num * i) and is_composite(num * (i + 1)):
		print(num * (i + 1), num * i)
		break
	else:
		i += 1


n = int(input())

def prime(n):
	d = 2
	while d * d <= n and n % d != 0:
		d += 1
	return d * d > n
for i in range(1, int(10000000000.0)):
	if prime(i):
		continue
	else:
		if prime(n + i):
			continue
		print(n + i, i)
		quit()