A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstrate fonts in printing or test the output devices.You are given a string consisting of lowercase and uppercase Latin letters. Check whether this string is a pangram. We say that the string contains a letter of the Latin alphabet if this letter occurs in the string in uppercase or lowercase.

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of characters in the string. The second line contains the string. The string consists only of uppercase and lowercase Latin letters.

Output "YES", if the string is a pangram and "NO" otherwise.

s = raw_input()
s = raw_input().lower()
fl = sum(map(lambda x: s.find(x) >= 0, map(lambda x : chr(x + ord('a')), range(0,26)))) == 26
if fl:
    print 'YES'
else:
    print 'NO'

#!/usr/bin/env Python3
n = int(input())
word =  input()

letters=[]
for i in word:
	test =i.upper()
	if test not in letters:
		letters.append(test)
if(len(letters)==26):
	print("YES")
else:
    print("NO")

n=int(input())
s=input()
string=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
arr1=[]
arr2=[]
arr=[]

count=0
f=0
g=0
for i in range(n):
    if(s[i].isupper()):
        arr1.append(s[i].lower())
    else:
        arr2.append(s[i])
arr1=arr1+arr2
arr1=set(arr1)

for i in range(len(string)):
    if(string[i] in arr1):
        count=count+1
if(count==26):
    print("YES")
else:
    print("NO")

n=int(input())
arr=[]
s=input()
s=s.lower()
for x in s:
    if x not in arr:
        arr.append(x)
if len(arr)==26:
    print("YES")
else :
    print("NO")

lista = []

input()
m = raw_input()

for i in m:
  if i.lower() not in lista:
    lista.append(i.lower())
if len(lista) == 26:
  print "YES"
else:
  print "NO"

n=int(input())
s=input()
s=s.upper()
a=set(s)
if len(a)==26:
    print("YES")
else:
    print("NO")

n=int(input())
def checkPangram(s):
    List = []
    for i in range(26):
        List.append(False)
    for c in s.lower():
        if not c == " ":
            List[ord(c) -ord('a')]= True

    for ch in List:
        if ch == False:
            return False
    return True

S=input()
if (checkPangram(S)):
    print("YES")
else:
    print("NO")

def isPangram(s):
    alphabet = "abcdefghijklmnopqrstuvwxyz"
    return not (set(alphabet) - set(s))

n = int(raw_input())
s = raw_input().lower()
if isPangram(s):
    print "YES"
else:
    print "NO"

n = input()

string = list(raw_input().lower())
if(len(list(set(string))) == 26):
	print 'YES'
else:
	print 'NO'

b = input()
a = set(input().lower())
if len(a) == 26:
    print("YES")
else:
    print("NO")

n = int(input())
x = {i for i in input().lower()}
if len(x) == 26:
    print('YES')
else:
    print('NO')

t = input(); s = input(); s = s.lower(); counterLow = 0
for i in range(97, 123):
    if chr(i) in s: counterLow+=1
if counterLow == 26: print('YES')
else: print('NO')

egfiaweufw=raw_input()
bla=raw_input().lower()
good=True
for c in "qwertyuiopasdfghjklzxcvbnm":
    if c not in bla:
        good=False
if good:
    print "YES"
else:
    print "NO"

n=int(input())
s=input()
out=0
arr=[]
for i in s:
    if i.lower() in arr:
        continue
    else:
        arr.append(i.lower())
if(len(arr)==26):print('YES')
else:print('NO')

n = input()
a = raw_input()
a = a.lower()
ag = list(set(a))
if len(ag) == 26:
    print 'YES'
else:
    print 'NO'

def act(x):
    n=int(raw_input())
    if(n<26):
        return 'NO'
    else:
        s=list(raw_input())
        for i in range(n):
            if(ord(s[i])<97):
                s[i]=chr(ord(s[i])+32)
        s=set(s)
        if(len(s)>=26):
            return 'YES'
        return 'NO'
print act(1)

import  collections

n = int(input())

string = input()

alph = "abcdefghijklmnopqrstuvwxyz"
dic = collections.Counter(alph)

string = string.lower()

Is_pangram = True

if len(string) < 26:
     print("NO")
else:
    for i in range(len(string)):
        if string[i] in dic.keys():
            dic[string[i]] -=1
            continue
        else:
            print("NO")
            Is_pangram = False
            break
    while Is_pangram:
        for value in dic.values():
            if value > 0:
                print("NO")
                Is_pangram = False
                break
        if Is_pangram:
            print("YES")
            Is_pangram = False

def panagram(string):
    letterDict = {}
    for i in range(len(string)):
        if str(string[int(i)]) not in letterDict:
            letterDict[str(string[int(i)].lower())] = 0
    if len(letterDict) == 26:
        return "YES"
    return "NO"
nums = input()
#listOfInputs = input().split()
word = list(input())
print(panagram(word))

input()
s = input().lower()
from string import *
print(("NO","YES")[26 == len([c for c in ascii_lowercase if c in s])])

z=int(input())
s=input().lower()
d=[]
for i in s:
    if 97<=ord(i)<=122:
        if i not in d:
            d.append(i)
if len(d)==26:
    print("YES")
else:
    print("NO")

lenstr = int(raw_input())
lenstr += 1
def finde( a , str ):
      count = 0
      lol = 0
      while(count!=(lenstr - 1)):
            if str[count]==a[0]:
                lol = 1
            count +=1
      return lol;

str = (raw_input()).lower()
str = str + " "
alpha = "abcdefghijklmnopqrstuvwxyz"

counter = 0
ind = 0
while ( counter != 26 ):
    if finde(alpha[counter],str)==1:
        ind = ind + 1
    counter += 1
if(ind==26):
    print "YES"
else:
    print "NO"

import string
n=int(input())
t=input()
t=t.lower()
k=[]
l=0
if n<26:
    print("NO")
else:
    for i in t:
        if i in string.ascii_letters and i not in k:
            k.append(i)
    if len(k)==26:
          print("YES")
    else:
        print("NO")

n=input("")
s=raw_input("")
L=[]
for i in s:
    if (i not in L) and (chr(ord(i)+32) not in L) and (chr(ord(i)-32) not in L):
        L.append(i)
if len(L)==26:
    print "YES"
else:
    print "NO"

_ = input()
word = input()
word = word.lower()

# The dictionary named histogram will count the letters present.
# and assign each letter as a key and it's count as the value.
histogram = dict()
for i in word:
    histogram[i] = histogram.get(i, 0) + 1

# If the histogram has an element count of 26, that means every
# letter is present and it is a pangram.
if len(histogram) == 26:
    print("YES")
else:
    print("NO")

def main():
    num_chars = int(raw_input())
    s = raw_input()
    if (num_chars < 26):
        return "NO"
    else:
        return "YES" if len(set(s.lower())) == 26 else "NO"

print main()

n=int(input())
s=input()
s=s.upper()
a=set(s)
if len(a)==26:
    print("YES")
else:
    print("NO")

t = int(input())
s = input()
c = 0
if t<26 :
    print("NO")
else :
    if 'a' in s or 'A' in s:
        c = c+1
    if 'b' in s or 'B' in s:
        c = c+1
    if 'c' in s or 'C' in s:
        c = c+1
    if 'd' in s or 'D' in s:
        c = c+1
    if 'e' in s or 'E' in s:
        c = c+1
    if 'f' in s or 'F' in s:
        c = c+1
    if 'g' in s or 'G' in s:
        c = c+1
    if 'h' in s or 'H' in s:
        c = c+1
    if 'i' in s or 'I' in s:
        c = c+1
    if 'j' in s or 'J' in s:
        c = c+1
    if 'k' in s or 'K' in s:
        c = c+1
    if 'l' in s or 'L' in s:
        c = c+1
    if 'm' in s or 'M' in s:
        c = c+1
    if 'n' in s or 'N' in s:
        c = c+1
    if 'o' in s or 'O' in s:
        c = c+1
    if 'p' in s or 'P' in s:
        c = c+1
    if 'q' in s or 'Q' in s:
        c = c+1
    if 'r' in s or 'R' in s:
        c = c+1
    if 's' in s or 'S' in s:
        c = c+1
    if 't' in s or 'T' in s:
        c = c+1
    if 'u' in s or 'U' in s:
        c = c+1
    if 'v' in s or 'V' in s:
        c = c+1
    if 'w' in s or 'W' in s:
        c = c+1
    if 'x' in s or 'X' in s:
        c = c+1
    if 'y' in s or 'Y' in s:
        c = c+1
    if 'z' in s or 'Z' in s:
        c = c+1
    if c>25:
        print("YES")
    else:
        print("NO")

t=input()
r=raw_input()
alphabet= "abcdefghijklmnopqrstuvwxyz"
k=str.lower(r)
j=''.join(sorted(set(k)))
l= (set(alphabet) - set(j))
m=''.join(l)
if len(m)>0:
    print 'NO'
else:
    print 'YES'

l=int(input())
n=input()
print("YES" if len(set(n.lower()))==26 else "NO")

n = input()
s = raw_input().lower()
d = {}
for c in s:
	d[c] = 1
if len(d) == 26:
	print "YES"
else:
	print "NO"

letters=[0]*26
def index(x):
    x=ord(x)
    if x>=ord('a') and x<=ord('z'):
        return x-ord('a')
    elif x>=ord('A') and x<=ord('Z'):
        return x-ord('A')
n=int(input())
s=input().strip()
for x in s:
    x=index(x)
    letters[x]=1
if 0 in letters:
    print('NO')
else:
    print('YES')

n = int(input())
s = str(input())
s = s.lower()
li = []
for i in s:
    if i not in li:
        li.append(i)
if len(li) == 26:
    print("YES")
else:
    print("NO")

raw_input()
s = raw_input()
print "YES" if len(set(s.upper())) >= 26 else "NO"

n = int(input())
s = input()
a = []
b = []
for i in range(0, n):
    a.append(s[i].lower())
a.sort()
a.append('0')
for i in range(0, n):
    if(a[i] != a[i + 1]):
        b.append(a[i])
if(len(b) < 26):
    print('NO')
else:
    print('YES')

x=int(input())
str=input().lower()
dict1 = {chr:str.count(chr) for chr in str}
if len(list(dict1.keys())) == 26:
    print("YES")
else:
    print("no")

import sys

args = []
alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
            'V', 'W', 'X', 'Y', 'Z']

for line in sys.stdin:
    args.append(line)

if int(args[0]) < 26:
    print("NO")
else:
    for x in args[1]:
        real = x.upper()
        if real in alphabet:
            del alphabet[alphabet.index(real)]
    if len(alphabet) > 0:
        print("NO")
    else:
        print("YES")

def isPangram(s):
    alphabet = "abcdefghijklmnopqrstuvwxyz"
    return not (set(alphabet) - set(s))

n = int(raw_input())
s = raw_input().lower()
if isPangram(s):
    print "YES"
else:
    print "NO"

import sys
input = sys.stdin.readline

############ ---- Input Functions ---- ############
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()))
dp=list("abcdefghijklmnopqrstuvwxyz")
n=inp()
ss=input()
s=ss.lower()
ans=list("".join(set(s)))
ans.remove("\n")
ans.sort()
if not dp==ans:
    print("NO")
else:
    print("YES")

input()  # exp
bakko=input()
bakko2=set(bakko.lower())
dhorgo=len(bakko2)
if dhorgo==26:
  print("YES")
else:
  print("NO")

b = input()
s = input()
s = s.upper()
a = set(s)
if(len(a) > 25):
    print('YES')
else:
    print('NO')

n=int(input())
a=input()
a=set(a.lower())
if len(a)==26:
    print('YES')
else:
    print('NO')

n = input()
print ["NO", "YES"][len(set(raw_input().lower())) == 26]

input()
n = input()
print(["YES","NO"][len(set(n.lower()))<26])

n = int(input())
s = list(input().lower())
a = ""
check = "abcdefghijklmnopqrstuvwxyz"
x = set(s)
y = list(x)
y.sort()
for i in range(0,len(y)):
    a+=y[i]
if a==check:
    print("YES")
else:
    print("NO")

b = input()
a = set(input().lower())
if len(a) == 26:
    print("YES")
else:
    print("NO")

l=['q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m']
input()
x=input()
for i in l:
    if i not in x and i.upper() not in x:
        print("NO")
        break
if i=='m':
    if 'm' in x or i.upper() in x:
        print("YES")

n=int(input())
s=input()
x=s.lower()
x=set(x)
if len(x)==26:
    print("YES")
else:
    print("NO")

input()
s = raw_input()
if len(set(s.lower()))== 26:
	print "YES"
else:
	print "NO"

n=int(input())
s=input()
a='abcdefghijklmnopqrstuvwxyz'
s=set(s.lower())
c=0
for i in a:
	if i not in s:
		break
	else:
		c+=1
if c==len(a):
	print("YES")
else:
	print("NO")

# pangram.py

stringlen = int(raw_input())
string = raw_input()
string = string.lower()
isPanagram = True

alphabet = 'abcdefghijklmnopqrstuvwxyz'

for i in range(stringlen):
    for ch in alphabet:
        if ch not in string:
            isPanagram = False

if isPanagram:
    print 'YES'
else:
    print 'NO'

n=int(input())
s=input()
l="asdfghjklzxcvbnmpoiuytrewq"
t=True
for i in l:
    if(i not in s and  i.upper() not in s):
        print("NO")
        t=False
        break
    else:
        continue
if(t==True):
    print("YES")

n = int(input())
s = input().lower()
s = set(sorted(s))
x = len(s)

if x == 26:
    print("YES")
else:
    print("NO")

import string

wordLen = input("")
word = input("")
##wordLen = len(word)

minLen = 26

FINAL = "YES"

def smallify(x):
    y = ""
    for i in x:
        if(i in string.ascii_lowercase):
            y = y + i
        elif(i in string.ascii_uppercase):
            index = string.ascii_uppercase.find(i)
            y = y + string.ascii_lowercase[index]
        else:
            y = y + i
    return y

if(int(wordLen) < minLen):
    FINAL = "NO"
    # exit(1)

else:
    word = smallify(word)
    for i in string.ascii_lowercase:
        if (i in word):
            pass
        else:
            FINAL = "NO"
            # exit(1)

print(FINAL)

n = raw_input()
str = raw_input()
print ["YES","NO"][len(set(str.lower())) != 26]

# cook your dish here
words = ["abcdefghijklmnopqrstuvwxyz"]
char_list = []
for x in words:
    char_list.extend(x)
input()
for x in input().lower():
    if x in char_list:
        char_list.remove(x)
        if len(char_list) == 0:
            break

if len(char_list) == 0:
    print("YES")
else:
    print("NO")

n = input()

string = list(raw_input().lower())
if(len(list(set(string))) == 26):
	print 'YES'
else:
	print 'NO'

alph = "abcdefghijklmnopqrstuvwxyz"
n = int(input())
string = input().strip()
if sorted(set(string.lower())) == sorted(set(alph)):
    print("YES")
else:
    print("NO")

import sys

def minus(a):
    a=set(sorted(a))
    if len(a) >26:
        print ('YES')
    else:
        print('NO')

def main():
    num=int(sys.stdin.readline())
    entrada = list(sys.stdin.readline().lower())
    a=minus(entrada)
main()

def isPangram(s):
    alphabet = "abcdefghijklmnopqrstuvwxyz"
    return not (set(alphabet) - set(s))

n = int(raw_input())
s = raw_input().lower()
if isPangram(s):
    print "YES"
else:
    print "NO"

num = int(raw_input())
palavra = raw_input()
d = []

for i in palavra:
    if i.lower() not in d:
        d.append(i.lower())

if len(d) == 26:
    print 'YES'
else:
    print 'NO'

number=input("")

myPhrase = input("")

def is_pangram(myPhrase):
    c = 0
    alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    phraseLetters = ""
    for char in myPhrase.upper():
        for letter in alphabet:
            if char == letter and char not in phraseLetters:
                phraseLetters += char
    for char in phraseLetters:
        for letter in alphabet:
            if char == letter:
                c += 1
    if c >= 26:
        return True
    else:
        return False

if (is_pangram(myPhrase)) == True:
    print ("YES")
else:
    print ("NO")

n = int(input())

string = input()
if n < 26:
    print('NO')
else:
    string = string.lower()

    string_test = 'qwertyuiopasdfghjklzxcvbnm'

    string = set(string)

    for i in string_test:
        if i not in string:
            print('NO')
            break
    else:
        print('YES')

n=int(raw_input())
x=list(raw_input().upper())
sum=0

for i in range(26):
    if x.count(chr(i+65))>=1:
        sum+=1
if sum==26:
    print 'YES'
else:
    print 'NO'

x=int(input())
a=input()
b="abcdefghijklmnopqrstuvwxyz"
a=a.lower()
flag="YES"
for i in range (26):
    if b[i]  not in a:
        flag="NO"
        break

print (flag)

import sys
import string

n = int(sys.stdin.readline().split()[0])

s = list(sys.stdin.readline()[:-1].lower())
s.sort()

if "".join(dict.fromkeys(s)) == string.ascii_lowercase:
    print("YES")
else:
    print("NO")

a=int(raw_input())
g=raw_input()
#print len(g)
b=g.lower()
c=set(b)
#print len(c),len(b)
if len(g)<26:
	print "NO"
if len(g)>=26:
	if len(c)==26:
		print "YES"
	else:
		print "NO"

def ni():
    return int(raw_input())

n = ni()

print 'YES' if len(set(raw_input().lower())) == 26 else 'NO'

#!/bin/python2
n = int(raw_input())
s = str(raw_input())
print "YES" if len(set(s.lower())) == 26 else "NO"

import string

# Getting input
number = raw_input()
entry = raw_input()

# Performing some string operations
entry = entry.lower()
entry = set(entry)
entry = list(entry)
entry = sorted(entry)
entry = "".join(entry)

# Getting alphabet
alphabet = string.ascii_lowercase

# If two strings are matching, print 'YES'.
# Otherwise, print 'NO'
if entry == alphabet:
    print 'YES'
else:
    print 'NO'

userInput = int(input())

string = set(input().lower())

if len(string)<26:
    print('NO')
else:
    print('YES')

n = input()
string = raw_input()
ascii = []
string = string.upper()
if (n < 26):
    print "NO"
    exit
else:
    for i in range(n):
        temp = ord(string[i])
        if temp not in ascii:
            ascii.append(temp)

    for j in range(65,91):
        if j not in ascii:
            print "NO"
            exit(0)

    print "YES"

y=int(input())
x=input().upper()
x=set(x)
if len(x)==26:
    print('YES')
else:
    print('NO')

numLet = input()
phrase = raw_input().lower()

alphabeta = "abcdefghijklmnopqrstuvwxyz"

if(len(phrase) == int(numLet)):
    if(len(phrase) >= 26):
        counter = 0
        result = 1
        while(counter < 26):
            if(phrase.count(alphabeta[counter]) == 0):
                result = 0

            counter += 1

        if(result == 1):
            print("YES")
        if(result == 0):
            print("NO")
    else:
        print("NO")
else:
    print("NO")

import string

def ispangram(str):
	alphabet = "abcdefghijklmnopqrstuvwxyz"
	for char in alphabet:
		if char not in str.lower():
			return False

	return True

# Driver code
n=int(input())
string = input()
if(n<26):
    print("No")
elif(ispangram(string) == True):
	print("Yes")
else:
	print("No")

n=int(input())
s=input()
s=s.upper()
a=set(s)
if len(a)==26:
    print("YES")
else:
    print("NO")

def solve(n, string):

    charSet = set()

    for i in range(0, n):
        charSet.add(string[i].lower())
    return "YES" if len(charSet) == 26 else "NO"

if __name__ == "__main__":

   n = int(raw_input())
   string = raw_input()

   print solve(n, string)

n = raw_input()
str = raw_input()
dic = {}
for i in range(len(str)):
    if dic.has_key(str[i]):
        dic[str[i].lower()]+=1
    else:
        dic[str[i].lower()]=1
temp = 0;
for key in dic:
    temp += 1
if temp >= 26:
    print "YES"
else:
    print "NO"

k=raw_input()
s=raw_input().lower()
def process():
    for i in range(ord('a'),ord('z')+1):
        if s.find(chr(i))==-1:
            print "NO"
            return
    print "YES"
process()

def main():
    raw_input()
    S = raw_input()
    S = S.lower()
    H = {}
    for i in S:
        H[i] = 1

    if len(H) == 26:
        print "YES"
    else:
        print "NO"

main()

import sys

def minus(a):
##    print('a',a)
    a=set(sorted(a))
##    print('a1',a,len(a))
    if len(a) >=26:
        print ('YES')
    else:
        print('NO')

def main():
    num=int(sys.stdin.readline())
    entrada = list(sys.stdin.readline().strip().lower())
    a=minus(entrada)
main()

num = int(raw_input())
palavra = raw_input()
d = []

for i in palavra:
    if i.lower() not in d:
        d.append(i.lower())

if len(d) == 26:
    print 'YES'
else:
    print 'NO'

from sys import stdin
N = int(stdin.readline())
string = stdin.readline().strip()
if len(set(string.lower())) == 26:
  print("YES")
else:
  print("NO")

# echo hey | python3 pangram.py
# echo 'The quick brown fox jumps over the lazy dog' | python3 pangram.py
# echo '35\n The quick brown fox jumps over the lazy dog\n' | python3 pangram.py
# echo '12\n toosmallword\n' | python3 pangram.py
# echo '48\n thereisasyetinsufficientdataforameaningfulanswer\n' | python3 pangram.py

import sys
import re

lines_entered = 0
is_panagram = None
for line in sys.stdin:
  lines_entered += 1
  # pangram is at least 26 characters long
  if lines_entered == 1:
    num = int(line)
    if num < 26:
      print('NO')
      sys.exit(0)
  # every character of abcs appears at least onece
  elif lines_entered == 2:
    lowerCase = line.lower()
    uniq = ''.join(set(lowerCase))
    matches = re.findall('[A-z]', uniq)
    if len(matches) == 26:
       print('YES')
    else:
      print('NO')

n=int(input())
s=str(input())
s2=s.lower()
aset=set(s2)
if len(aset)>=26:
    print("YES")
else:
    print("NO")

a = []
F = input()
s = input()
for i in s:
    if i.lower() not in a:
        a.append(i.lower())
if len(a) == 26:
    print("YES")
else: print("NO")

a=input()
b=set(str.upper(input()))
if len(b)==26:
    print('YES')
else:
    print('NO')

print("YES" if len(set(input().lower()))>=26 else "NO")

Length=input()
sen=input()
counters=int(Length)
check=False
for x in range(0,counters):
	if(sen[x].islower()):
		check=False
	else:
		check=True
		break;

if(check==False):
	print("NO")
else:
	print("YES")

n=int(input())
dict={}
s=input()
for i in s:
    if i in dict:
        dict[i]+=1
    else:
        dict[i]=1
if len(dict)>=26:
    print("YES")
else:
    print("NO")

length = int(input())
string = input()
string = string.upper()
x= set(string)
y = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if length <25:
	print('NO')
else:
	for i in range(26):
		if y[i] in x:
			p = "YES"
		else:
			p = 'NO'

	print(p)

import sys

args = []
alphabet = ["A", 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']

for line in sys.stdin:
    args.append(line)
if int(args[0]) < 26:
    print("NO")
else:
    for x in args[1]:
        real = x.upper()
        if x in alphabet:
            del alphabet[alphabet.index(x)]
    if len(alphabet) > 0:
        print("NO")
    else:
        print("YES")

input()
s=raw_input()
s.upper()
print s
ans=[0]*150
for i in s :
    if not ans[ord(i)] :
        ans[ord(i)] = 1
if sum(ans) == 26 :
    print "YES"
else :
    print "NO"

a=int(input())
b=input()
k=0
f=b.lower()
g=[]
for i in range(26):
    g.append(chr(97+i))
for u in f:
    if u in g:
        k+=1
if k==26:
    print('YES')
else:
    print('NO')

l = int(input())
s = input()
d = 0
if l < 26:
  print("NO")
else:
  for i in range (l):
    y= s[i]
    count = s.count(y)
    d += (count-1)
  if (d-len(s)) >= 26:
    print ("YES")
  if (d-len(s)) <26:
    print("NO")

n=input()
s=input()
x=set(s)
if len(x)>=26:
    print("YES")
else:
    print("NO")

a=input()
b=input().upper()
al='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
pp=0
for i in al:
    if not (i in b):
        pp+=1
        print(i)
if pp==0:
    print('YES')
else:
    print('NO')

while int(input()) > 26:
    n = input().upper()
    alfa = 65
    for i in n:
        if chr(alfa) in n:
            alfa += 1

    if alfa == 91:
        print("YES")
    else:
        print("NO")
    break
else:
    input()
    print("NO")

#Hassan alkanash
x=int(input())
h=input()
h.lower()
name=list(h)
name.sort()
name=list(set(name))
if len(name)<27 or len(name)>27 :
    print("NO")
else:
    print("YES")

n = input()
a = input()
tmp = 0
for i in a:
    if i.isupper():
        tmp = 1
        break
if tmp == 0:
    print('NO')
else:
    print('YES')

n=int(input())
l=[]
s=input()
for i in range(0,n):
    if s[i] not in l:
        l.append(s[i])
if len(l)==26:
    print("YES")
else:
    print("NO")

length = int(input())
string = input()
string = string.upper()
x= set(string)
y = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if length <26:
	print('NO')
else:
	for i in range(26):
		if y[i] in x:
			p = "YES"
		else:
			p = 'NO'

	print(p)

test_list = [chr(x) for x in range(ord('a'), ord('z') + 1)]
n = int(input())
arr = set(input())
arr = [i.lower() for i in arr]

print(arr)

flag = True

for i in test_list:
    if i not in arr:
        flag = False
        break

if flag:
    print("YES")
else:
    print("NO")

n = int(input())
word = list(map(str,input()))[:n]
s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
st = []
for w in word:
    if w in s:
        st.append(w)
st = set(st)
if len(st) >= 26:
    print("YES")
else:print("NO")

#35
#TheuoxOrezyo

# A. Pangram
# time limit per test2 seconds
# memory limit per test256 megabytes
# inputstandard input
# outputstandard output
# A word or a sentence in some language is called a pangram if all the characters of the alphabet of this language appear in it at least once. Pangrams are often used to demonstrate fonts in printing or test the output devices.

# You are given a string consisting of lowercase and uppercase Latin letters. Check whether this string is a pangram. We say that the string contains a letter of the Latin alphabet if this letter occurs in the string in uppercase or lowercase.

# Input
# The first line contains a single integer n (1 ≤ n ≤ 100) — the number of characters in the string.

# The second line contains the string. The string consists only of uppercase and lowercase Latin letters.

# Output
# Output "YES", if the string is a pangram and "NO" otherwise.
from collections import defaultdict

LATIN_LETTERS = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j, k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'v', 'x', 'y', 'z']

def calculate_frequency(word):
	d = defaultdict(int)

	for i in word:
		d[i] += 1
	return d

def solve_the_problem():
	size = int(input())
	word = input()

	if size < 23:
		print("NO")
		return
	our_letters = calculate_frequency(word.lower()).keys()
	for letter in LATIN_LETTERS:
		if letter not in our_letters:
			print("NO")
			return

	print("YES")

if __name__ == "__main__":
    solve_the_problem()

n = int(input())
s = str(input())
li = []
for i in s:
    if i not in li:
        li.append(i)
if len(li) == 26:
    print("YES")
else:
    print("NO")

n=int(input())
s=input()
string=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
arr1=[]
arr2=[]
count=0
f=0
g=0
for i in range(n):
    if(s[i].isupper()):
        arr1.append(s[i].lower())
    else:
        arr2.append(s[i])
arr=arr1+arr2
for i in range(len(arr)):
    if(arr[i] in string):
        count=count+1
if(count>=26):
    print("YES")
else:
    print("NO")

n = input()
string = raw_input()
ascii = []
string = string.upper()
if (n < 26):
    print "NO"
    exit
else:
    for i in range(n):
        temp = ord(string[i])
        if temp not in ascii:
            ascii.append(temp)

    for j in range(67,91):
        if j not in ascii:
            print "NO"
            exit(0)

    print "YES"

n = int(input())
m = 'QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm'
stroka = input()
m = list(m)
not_found = False
for elem in m:
    if elem not in stroka:
        not_found = True
        break
if not_found is True:
    print('NO')
else:
    print('YES')

a=input()
a=set(a)
if len(a)==26:
    print('YES')
else:
    print('NO')

n=int(input())
a=input()
i=0;
cnt=0;
while(i<n):
    if(a[i] in 'qwertyuioplkjhgfdsazxcvbnm' or a[i] in 'QWERTYUIOPLKJHGFDSAZXCVBNM'):
        cnt=cnt+1;
    i=i+1;
if(cnt==n):
    print("YES")
else:
    print("NO")

strr=str(input())
if len(set(strr))==len(strr):
    print("YES")
else:
    print("NO")

lenstr = int(raw_input())
lenstr += 1
def finde( a , str ):
      count = 0
      lol = 0
      while(count!=(lenstr - 1)):
            if str[count]==a[0]:
                lol = 1
            count +=1
      return lol;

str = (raw_input()).lower()
str = str + " "
alpha = "abcdefghijklmnopqrstuvwxyz"

counter = 0
ind = 0
while ( counter != 26 ):
    if finde(alpha[counter],str)==1:
        ind = ind + 1
    counter += 1
    print ind
if(ind==26):
    print "YES"
else:
    print "NO"

egfiaweufw=raw_input()
bla=raw_input()
good=True
for c in "qwertyuiopasdfghjklzxcvbnm":
    if c not in bla:
        good=False
if good:
    print "YES"
else:
    print "NO"

str=input().lower()
dict1 = {chr:str.count(chr) for chr in str}
if len(list(dict1.keys())) == 26:
    print("YES")
else:
    print("NO")

n = int(input())
q = "abcdefghijklmnopqrstuvwxyz"
a = input().lower()
if len(q)<26:
   print("NO")
else:
   k=0
   for i in range(len(q)):
      if q[i] in a:
         a = a.replace(q[i],"")
      else:
         print("NO")
         k+=2
   if len(a) == 0 and k == 0:
      print("YES")

k=int(input())
a=input().lower()
for i in a:
    if(ord(i)>=ord('a' or ord(i)<=ord('z'))):
        a=a.replace(i,'')
if(a==""):
    print('YES')
else:
    print('NO')

n=int(input())
u,l=0,0
word=input()
for i in range(n):
	if word[i]>='a' and word[i]<='A':
		l=1
		continue
	else:
		u=1
		continue
if u==1 and l==1 :
	print("YES")
else:
	print("NO")

s = raw_input()
s = raw_input().lower()
fl = sum(map(lambda x: s.find(x) > 0, list('qazwsxedcrfvtgbyhnujmikolp'))) == 26
if fl:
    print 'YES'
else:
    print 'NO'

a = int(input())
n =input()
l,b=[],[]
for i in n:
    if ord(i) in range(ord('A'),ord('Z')+1):
        l.append(i)
    if ord(i) in range(ord('a'),ord('z')+1):
        b.append(i)

# print(len(set(l)),len(set(b)))
if len(set(l))+len(set(b))>=26:
    print("YES")
else:
    print("NO")

n=input()
a=raw_input()
l=[]
if n<26:
    print 'NO'
else:
    for i in a:
        if i.islower() or i.isupper() and i.lower() not in l:
            l.append(i.lower())
if len(l)==26:
    print 'YES'
else:
    print 'NO'

n=int(input())
a=input()
b=a.lower()
c=list()
for i in range(0,len(a)):
    c.append(a[i])
m=list(set(c))
print(m)
if(len(m)>=26):
    print('YES')
else :
    print('NO')

n = int(input())
m = 'qQwWeErRtTyYuUiIoOpPaAsSdDfFgGhHjJkKlLzZxXcCvVbBnNmM'
stroka = input()
not_found = False
for i in range(n):
    if m not in stroka[i]:
        not_found = True
        break
if not_found is True:
    print('NO')
else:
    print('YES')

# -*- coding: utf-8 -*-
n=input()
t=input().lower()

t=list(t)
if ('a'and'b'and'c'and'd'and'e'and'f'and'g'and'h'and'i'and'j'and'k'and'm'and'n'and'o'and'p'and'q'and'r'and's'and't'and'u'and'v'and'w'and'x'and'y'and'z')in t:
    print('YES')
else:
    print('NO')

n = int(input())

string = input()
if n < 26:
    print('NO')
else:
    string.lower()

    string_test = 'qwertyuiopasdfghjklzxcvbnm'

    string = set(string)

    for i in string_test:
        if i not in string:
            print('NO')
            break
    else:
        print('YES')

s = input()
s = s.lower()
s = set(s)
if len(s) == 26:
    print("YES")
else:
    print("NO")

a = input()
A = set(a.lower())
if 26 == len(A):
    print('YES')
else:
    print('NO')

# Je déteste que j'aime que je déteste

s = input().casefold()
s = set(s)
if len(s) >= 26:
    print('YES')
else:
    print('NO')

n=int(input())
s=input()
l=len(s)
s=s.lower()
for i in range(l):
	j=i+1
	if(l<=n):
		while(j<l):
			if(s[i]==s[j]):
				print('NO')
				l+=1
				break
			else:
				j+=1
if(l<=n):
	print('YES')

a=input()
b=input().upper()
al='ABCDEFGHIKLMNOPQRSTVXYZ'
pp=0
for i in al:
    if not (i in b):
        pp+=pp
if pp==0:
    print('YES')
else:
    print('NO')

a = int(input())
b = str(input()[:a])
for i in b:
    if "A"<=i<="Z":
        n="YES"
        break
    else:
        n ="NO"
print(n)

#Pangram

if __name__ == '__main__':
    n = int(raw_input())
    s=raw_input().lower()
    a = set(s)
    if len(a) >= 24:
        print 'YES'
    else:
        print 'NO'

l = int(input())
s = input()
d = 0
if l < 26:
  print("NO")
else:
  for i in range (l):
    y= s[i]
    count = s.count(y)
    d += (count-1)
  if (d-len(s)) >= 26:
    print ("YES")
  if (d-len(s)) <26:
    print("NO")

n=int(input())
s=input()
if any(x.isupper() for x in s ):
        print("Yes")
else :
        print("No")

n=int(input())
word=input()
if n<26:
	print('NO')
else:
	word.lower()
	wordset=set(word)
	if len(wordset)<26:
		print('NO')
	else:
		print('YES')

n = int(input())
s = input()
ind, ln = [], []
ket = False
kata = []
for i in range (len(s)):
    if(ord(s[i]) >= 65 and ord(s[i]) <= 90):
        ind += [i]
        ket = True
ind += [len(s)]

if(n == 1):
    ket = "No"
elif (ket == False):
    for i in range (len(s)):
        if(s[i] not in kata):
            kata += s[i]
            ket = "Yes"
        else:
            ket = "No"
            break
elif (ket == True):
    new = ""
    for i in range (len(ind)):
        if(i == len(ind)-1):
            break
        else:
            a = ind[i+1] - ind[i]
            ln += [a]
    for i in s:
        if(ord(i) >= 65 and ord(i) <= 90):
            i = (chr(ord(i)+32))
        new += i
    k = 0
    for i in range (len(ln)):
        kata = []
        for j in range (ln[i]):
            if(new[k] not in kata):
                kata += new[k]
                ket = "Yes"
            else:
                ket = "No"
                break
            k += 1
        break
print (ket)

s="abcdefghijklmnopqrstuvwxyz"
s1=input()
s1.lower()
c=0
for o in s:
    if o in s:
        c+=1
if(c==len(s)):
    print("YES")
else:
    print("NO")

n = int(input())
m = input()
k = m.lower()
a = 0
if n < 26:
    print('NO')
else:
    for i in range(len(m)):
        for j in range(i,len(m)):
            if m[i]!=m[j]:
                a+=1
    if a>=26:
        print('YES')
    else:
        print('NO')

sa = raw_input()
sa = sa.lower()
s = set(sa)
if len(s) == 26:
	print 'YES'
else:
	print 'NO'

n=input()
print("YES" if len(set(n))==26 else "NO")

n = int(input())
s = input()
s = s.lower()
state = True
if n < 26:
    print("NO")
else:
    s = ''.join(sorted(s))
    for i in range(n-1):
        if ord(s[i]) != ord(s[i+1]) and ord(s[i]) != (ord(s[i+1]) - 1):
            print("NO")
            state = False
            break

    if state == True:
        if s[-1] != 'z':
            print("NO")
        else:
            print("YES")

n=int(input())
s=input()
l=list(map(chr,range(97,122)))
f=0
s=s.lower()
for i in l:
    if i not in s:
        f=1
        break
if(f==1):
    print("NO")
else:
    print("YES")

#list(map(int,input().split()))
cnt = 0
n = int(input())
word = list(input().lower())
if(n>=26):
   for i in range(len(word)-1):
      if(ord(word[i])>=97 and ord(word[i])<=122):
         cnt += 1
   if(cnt >= 26):
      print("YES")
   else:
      print("NO")

else:
   print("NO")

s = input()
st = set(s.lower())
long = len(st)

if long == 26:
    print("YES")
else:
    print("NO")

def isPangram(s):
    alphabet = "abcdefghijklmnopqrstuvwxyz"
    for char in alphabet:
        if char not in s:
            return "NO"

    return "YES"

n = int(raw_input())
s = raw_input().strip()
print isPangram(s)

n = int(input())
s = str(input())
count = 1
if n < 26:
    print("NO")
else:
    for i in range(0,len(s)-1):
        if s[i] != s[i+1]:
            count = count+1
    if count >= 26:
        print("YES")
    else:
        print("NO")

t=int(input())
s=input()
s.lower()
d={}
for i in s:
    d[i]=d.get(i,0)+1
f=0
for i,j in d.items():
    if j<1:
        f=1
        break
if f==0:
    print('YES')
else:
    print('NO')

s=int(input())
k=input()
c=0
if s==1:
    print('NO')
else:
    for i in range(s-1):
    	if k[i] == k[i+1]:
    	    c=c+1
    if c==0:
        print('YES')
    else:
        print('NO')

a = [0] * 26

raw_input()

for c in raw_input().strip():
	if 0 <= ord(c) - ord('a') < 26:
		a[ord(c) - ord('a')] += 1

print "YES" if min(a) > 0 else "NO"

import string

def pangram(s, a):
    if n > 26:
        if set(s.lower()) == a:
            return "YES"
    else:
        return "NO"

a = set(string.ascii_lowercase)
n = int(input())
s = input()
print(pangram(s, a))

n=int(input())
s=input()
if (n>15) :
        print("yes")
else :
        print("no")

# -*- coding: utf-8 -*-
t=input().lower()

t=list(t)
if ('a'and'b'and'c'and'd'and'e'and'f'and'g'and'h'and'i'and'j'and'k'and'm'and'n'and'o'and'p'and'q'and'r'and's'and't'and'u'and'v'and'w'and'x'and'y'and'z')in t:
    print('YES')
else:
    print('NO')

# http://codeforces.com/problemset/problem/520/A

num = int(raw_input())
palavra = raw_input()
d = []

for i in palavra:
    if i.lower() not in d:
        d.append(i.lower())

print d
if len(d) == 26:
    print 'YES'
else:
    print 'NO'

a="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
c,b=int(input()),str(input())
s=0
for k in a:
    if b.count(k):
        s+=1
if s*2>=len(a):
    print("YES")
else:
    print("No")

n=int(input())
s=input()
l=len(s)
s=s.lower()
check=0
for i in range(l):
	j=i+1
	if(check==0):
		while(j<l):
			if(s[i]==s[j]):
				print('NO')
				check+=1
				break
			else:
				j+=1
if(check==0):
	print('YES')

a=input()
b="abcdefghijklmnopqrstuvwxyz"
a.lower()
y=len(b)
for i in (0,y-1):
    if b[i] in a:
        flag="YES"
        continue
    else:
        flag="NO"
        break

print (flag)

import string
n=int(input())
t=input()
t=t.lower()
k=[]
l=0
if n<26:
    print("NO")
else:
    for i in t:
        if i in string.ascii_letters and i not in k:
            k.append(i)
if len(k)==26:
    print("YES")

n = input()
string = raw_input()
ascii = []
string = string.upper()
if (n < 26):
    print "NO"
    exit
else:
    for i in range(n):
        temp = ord(string[i])
        if temp not in ascii:
            ascii.append(temp)

    for j in range(67,91):
        if j not in ascii:
            print "NO"
            exit

    print "YES"

s = raw_input()
s = raw_input().lower()
fl = sum(map(lambda x: s.find(x) > 0, list('qazwsxedcrfvtgbyhnujmikolp'))) == 26
if fl:
    print 'YES'
else:
    print 'NO'

#Pangram

alpha= 'abcdefghijklmnopqrstuvwxyz'
bigAlpha='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
h=int(input(''))
g=input('')
x=False

for i in g:
        if (i not in alpha) or (i not in bigAlpha):
            print('NO')
            break
        else:
            x=True

if x:
    print('YES')

from string import ascii_lowercase
n = int(raw_input())
if n < 26:
    print "NO"
s = raw_input().lower()
ans = "YES"
for i in ascii_lowercase:
    if i not in s:
        ans = "NO"
        break
print ans

n=int(input())
word=input()
if n<24:
	print('NO')
else:
	wordset=set(word)
	if len(wordset)<24:
		print('NO')
	else:
		print('YES')

n=int(input())
a=input()
b=a.lower()
c=list()
for i in range(0,len(a)):
    c.append(a[i])
m=list(set(c))
if(len(m)==26):
    print('YES')
else :
    print('NO')

from string import ascii_lowercase as letters
n=raw_input()
s=raw_input()
print(s)

if set(list(letters))==set(list(s.lower())):
    print("YES")
else:
    print("NO")

n=int(input())
s=input()
l="asdfghjklzxcvbnmpoiuytrewq"
t=True
for i in l:
    if(i not in s or (i.upper() not in s)):
        print("NO")
        t=False
        break
    else:
        continue
if(t==True):
    print("YES")

l = int(input())
s = input()
d = 0
if l < 26:
  print("NO")
else:
  for i in range (l):
    y= s[i]
    count = s.count(y)
    d += (count-1)/count
  if (len(s)-d) >= 26:
    print ("YES")
  if (len(s)-d) <26:
    print("NO")

n = int(input())
s = input().lower()

alphabet = []

if n < 26:
    print("NO")
    exit

for i in range(0, n):
    if s[i] not in alphabet:
        alphabet.append(s[i])

if len(alphabet) < 26:
    print("NO")
else:
    print("YES")

str=input().lower()
dict1 = {chr:str.count(chr) for chr in str}
if len(list(dict1.keys())) == 26:
    print("YES")
else:
    print("no")

a= int(input())
b= input()
c= 65
d= 97
for k in range(26):
	e= chr(c)
	f= chr(d)
	if e in b or f in b:
		c += 1
		d += 1
	else:
		break
if k== 25:
	print("YES")
else:
	print("NO")

def solve(n,string):
            char=set()
            for i in range(0,n):

                        char.add(string[i].lower())
            return "YES" if len(char)==26 else"NO"

n = int(input())
s = input()
s = s.lower()
s = [i for i in s]
s = list(set(s))
s.sort()
if n < 26:
    print('NO')
else:
    print('YES')

n = int(input())
t = input().lower()
flag = 1
for i in range(len(t)-1):
	if(t[i]==t[i+1] and t[i]<=t[i+1]):
		flag = 0
		break
	else:
		flag = 1
if(flag==1 and len(t)!=1):
	print("YES")
else:
	print("NO")

import sys

def minus(a):

    print('YES' if len(a) > 26 else 'NO')

def main():
    num=int(sys.stdin.readline())
    entrada = list(sys.stdin.readline().lower())
    a=minus(entrada)
main()

n=int(input())
b=input()
a=set(b)
if len(a)>26:
   print('YES')
else:
   print('NO')

n=int(input())
t=input()
if len(set(t))==26:
    print('Yes')
else:
    print('No')

from string import ascii_lowercase as asc_lower
def check(s):
         return set(asc_lower) - set(s.lower()) == set([])
strng=input()
if (check(strng)==True):
         print("YES")
else:
         print("NO")

n = input()
n = int(n)
word = input()
mylist = []

if len(word) < 27:
    print("NO")
else:
    for c in word:
        if c not in mylist:
                mylist.extend(c)
    if len(mylist)-1 == 26:
        print("YES")
    else:
        print("NO")

k = int(raw_input().split()[0])
mm = raw_input().strip()
al = 'abcdefghijklmnopqrstuvwxyz00'
ALL = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ00'
for i in mm:
    if len(ALL) == 2:
        break
    if i in al:
        k = al.find(i)
        al = al[0:k] + al[k+1:]
        ALL = ALL[0:k] + ALL[k+1:]
    if i in ALL:
        k = al.find(i)
        al = al[0:k] + al[k + 1:]
        ALL = ALL[0:k] + ALL[k + 1:]
if len(al) == 2:
    print 'YES'
else:
    print 'NO'


Little X has met the following problem recently. Let's define f(x) as the sum of digits in decimal representation of number x (for example, f(1234) = 1 + 2 + 3 + 4). You are to calculate Of course Little X has solved this problem quickly, has locked it, and then has tried to hack others. He has seen the following C++ code:     ans = solve(l, r) % a;    if (ans <= 0)      ans += a; This code will fail only on the test with . You are given number a, help Little X to find a proper test for hack.

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

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

'''
Genius Idea from editorial solution 4:
Since f(x+1e18)=f(x)+1,
g(l+1,l+1e18+1)=1+g(l,l+1e18)
Now let x=g(0,1e18-1)%a
Therefore, we can construct the answer as: l=(a-x),r=(a-x+1e18-1), here we are shifting by a-x so that g(a-x,a-x+1e18-1)%a becomes 0
'''
def solve():
	a=input()
	x=(45*18*(10**17))%a
	print(str(a-x)+' '+str(a-x+(10**18)-1))
solve()

import itertools
import math

a = int(raw_input())

for k in range(1,1000):
    x = a * k
    for keta in range(1,20):
        pow10keta = 1
        for i in range(0,keta):
            pow10keta = pow10keta * 10
        start = 45 * keta * pow10keta/10 + 1
        end   = start + 9 * pow10keta - 1
        if start<=x and x<= end:
            r = pow10keta + x - start
            l = r + 1 - pow10keta
            print int(l),int(r)
            exit(0)

a=int(input())

x=a-((10**21)*9)%a

print(x,10**20+x-1)

# Made By Mostafa_Khaled

try:
    while True:
        a = int(input())
        b = (10 ** 17) % a
        b = (b * 45 * 18+ 1) % a
        print(1 + (a-b), int(1e18) + (a-b))
except EOFError:
    pass

import random
import sys

def f(n, mod):
	l=[]
	while n>0:
		l.append(n%10)
		n//=10
	ret=0
	num=0
	suma=0
	war=1
	for i in l:
		a=0
		b=0

		for j in range(i):
			a=(a+suma+j*war)%mod
		a=(a+ret+i*(num+1))%mod

		for j in range(10):
			b=(b+suma+j*war)%mod

		ret=a
		suma=b

		num=(num+war*i)%mod
		war=(war*10)%mod
	return ret

def los(dlu):
	ret=0
	for i in range(dlu):
		ret=ret*10+random.randint(0, 9)
	return ret

def ans(a, b):
	print(a, b)
	sys.exit(0)

pam=[(0, 0)]

mod=int(input())

while True:
	a=los(42)
	b=a+los(20)
	if a==b:
		continue
	if a>b:
		a,b=b,a
	wa=f(a, mod)
	wb=f(b, mod)
	if wa==wb:
		ans(a+1, b)
	if wa<wb:
		continue
	#~ print("jade")
	while a+1<b:
		s=(a+b)//2
		ws=f(s, mod)
		#~ if ws==0:
			#~ ans(1, s)
		if ws<=wb:
			b=s
			wb=ws
		else:
			a=s
			wa=ws
	for i in pam:
		if i[1]==wb:
			ans(min(i[0], b)+1, max(i[0], b))
	pam.append((b, wb))

#!/usr/bin/env python

import random

def read():
    return input()

def g(n):
    strNum = str(n)

    ret = 0
    for idx in range(len(strNum)):
        digit = int(strNum[idx])

        leftNum     = int(strNum[:idx]    ) if idx > 0 else 0
        rightNum    = int(strNum[idx + 1:]) if idx + 1 < len(strNum) else 0
        rightDigits = len(strNum) - idx - 1

        # i < digit:
        ret += (digit * (digit - 1) / 2)              * (leftNum  + 1) * (10 ** rightDigits)

        # i > digit:
        ret += (9 * 10 / 2 - digit * (digit + 1) / 2) * (leftNum     ) * (10 ** rightDigits)

        # i == digit:
        ret += digit * (leftNum     ) * (10 ** rightDigits)
        ret += digit * (rightNum + 1)

    return ret

def work(a):
    mul = 1
    while mul:
        L = 0
        R = mul * a
        while L < R:
            mid = (L + R) / 2

            if g(mid) >= mul * a:
                R = mid
            else:
                L = mid + 1

        if g(L) == mul * a:
            print 1, L
            break

        mul += 1

if __name__ == "__main__":
    work(read())

n = input()
n = int(n)
#print(n)
if (n < 46):
    a = 0
    while n:
        if (n >= 10):
            a = a * 10 + 9
            n -= 9;
        else:
            a = a * 10 + n
            n = 0
    print(a, a)
    exit(0)
p = 1
for i in range(1,n):
    p *= 10
    m = p // 10 * i * 45 + 1
    #print(m, p, m + p)
    if (m + p > n):
        k = n - m
        while k < 0:
            k += n
        if (k >= p):
            continue
        print(k + 1, p + k)
        exit(0)

A = int(input());
start = (45*10**18*19+1)%A;
start = A-start;
print(start+1, start+10**19);

# test code from internet
n = int( input() )
x,t=10**100-1,n-100*45*10**99%n
print(t,t+x)

a = int(input())

l = 1
r = 10**200

cur = [0]
cnt = [1]
for i in range(300):
	cur.append(cur[-1] * 10 + 45 * cnt[-1])
	cnt.append(cnt[-1] * 10)

def calc(x):
	global cur
	global cnt
	res = 0
	a = [int(i) for i in str(x)]
	tot = 0
	for i in range(len(a)):
		if (a[i] != 0):
			for j in range(a[i]):
				res += (tot + j) * cnt[len(a) - i - 1]
			res += a[i] * cur[len(a) - i - 1]
		tot += a[i]
	res += tot
	return res

while (l < r - 1):
	m = (l + r) // 2
	if (calc(m) < a):
		l = m
	else:
		r = m

if (calc(l) >= a):
	r = l

cur = calc(r)
l = 1

def get(x):
	res = 0
	while (x):
		res += x % 10
		x //= 10
	return res

while (cur % a != 0):
	cur -= get(l)
	l += 1
	while (cur < a):
		r += 1
		cur += get(r)

print(l, r)

#!/usr/bin/python3
import math

A = [0]*250

A[0] , A[1] = 0 , 45

for i in range(2,250):
	A[i] = A[i-1]*10 + 45*pow(10,i-1)

def tot(n):
	if n < 10: return (n*(n+1))//2
	d = len(str(n))-1
	p = pow(10,d)
	msd = n//p
	return msd*A[d] + ((msd*(msd-1))//2)*p + msd*(1+n%p) + tot(n%p)

a = int(input())
lo , hi = 1 , a

while lo < hi:
	mid = (lo+hi)>>1
	if tot(mid) >= a: hi = mid
	else : lo = mid+1

i1 , i2 = 1 , hi
total = tot(hi)

def digSum(n):
	total = 0
	while n>0:
		total += n%10
		n //= 10
	return total

while total%a != 0:
	if total < a:
		i2 += 1
		total += digSum(i2)
	else:
		total -= digSum(i1)
		i1 += 1
print(i1,i2)

def dig(n):
	return sum(map(int, list(str(n))))

def dig_sum(n): # sum of digit sum from 1 to n
	l = len(str(n))
	res = 0
	for i in range(l)[::-1]:
		a = n / 10 ** i
		if i: res += a * 45 * 10 ** (i - 1) * i
		n -= a * 10 ** i
		res += a * (a - 1) / 2 * 10 ** i
		res += (n + 1) * a
	return res

def binary(val):
	l, r = 0, val + 1
	while r - l > 1:
		mid = (l + r) / 2
		if dig_sum(mid) < val:
			l = mid
		else :
			r = mid
	return l

magic = 1000
ans = [-1] * magic
ans[0] = 0

a = int(raw_input())
x = 1

while True:
	val = dig_sum(x)
	if val % a >= magic:
		nval = val + (a - val % a)
		x = binary(nval) + 1
		continue
	val %= a
	if ans[val] != -1:
		print ans[val] + 1, x
		break
	else :
		ans[val] = x
	x += 1

from random import *
pw=[1]
for i in range(1,40): pw.append(pw[i-1]*10)
def f(x):
    	r=[]
    	while x!=0:
    		r.append(x%10)
    		x/=10
    	ans=0
    	s=0
    	r.reverse()
    	for i in range(len(r)):
    		if (i==len(r)-1): ans+=(2*s+r[i]-1)*r[i]/2
    		else: ans+=(2*s+r[i]-1)*r[i]/2*pw[len(r)-i-1]+r[i]*45*(len(r)-i-1)*pw[len(r)-i-2]
    		s+=r[i]
    	return ans
mod=input()
pos=[-1]*1000
for i in range(2,40):
  	pos[f(i)]=i
while True:
    	x=randint(1,10**30)
    	p=f(x)
    	q=p%mod
    	l,r=0,mod-q
    	while l+1<r:
    		md=(l+r)>>1
    		if (f(x+md)-p<mod-q): l=md
    		else: r=md
    	P=f(x+r)
    	Q=P%mod
    	if pos[Q]!=-1 and pos[Q]!=x+r:
    		a,b=pos[Q],x+r
    		if a>b: a,b=b,a
    		print a,b-1
    		break
    	pos[Q]=x+r

from random import randint

def stupid(n):
    ret = 0
    for i in range(1, n + 1):
        ret += sum([int(c) for c in str(i)])
    return ret

ans_10 = [0]
for i in range(1, 202):
    ans_10.append(45 * 10 ** (i - 1) + ans_10[-1] * 10)

def solve(n):
    s = str(n)
    sz = len(s)
    ans = 0
    so_far = 0
    for i in range(sz):
        cur = int(s[i])
        for j in range(cur):
            ans += (so_far + j) * 10 ** (sz - i - 1) + ans_10[sz - i - 1]
        so_far += cur
    return ans + so_far

def f(L, R):
    return solve(R) - solve(L - 1)

a = input()

for i in range(1500):
    t = randint(10 ** 6, 10 ** 18)

    val = solve(t) % a

    L = 2
    R = t
    while R - L > 1:
        M = (L + R) // 2
        if solve(t + M) % a > val:
            R = M
        else:
            L = M

    if f(t + 1, t + L) % a == 0:
        print t + 1, t + L
        break

n=int(input())
x=10**18
k=(774*x)%n
def inv(a):
  for i in range(a):
    if i*n+1==(i*n+1)//a*a:
      return (i*n+1)//a

if n%9==0:
  offset=k//9
elif n%3==0:
  n//=3
  k//=3
  offset=(k*inv(3))%n
else:
  offset=(k*inv(9))%n
l=x-offset
r=10*x-1-offset
print(str(l)+" "+str(r))

#!/usr/bin/python

from sys import stdin

def f(x):
   return sum(map(int, list(str(x))))

def fsum(x):
    n = len(str(x))
    res = 0
#    res2 = sum([f(i) for i in range(x+1)])
    for i in range(n)[::-1]:
        a = x // 10**i
        if i:
           res += a * (45 * 10**(i-1) * i)
        x = x - a * 10**i
        res += a * (a - 1) // 2 * 10**i
        res += (x + 1) * a
    return res;
#    print res, res2
#    assert(res == res2)

def lb(val):
    l = 0
    r = val + 1
    while r - l > 1:
        m = (l + r) // 2
        if fsum(m) < val:
            l = m
        else:
            r = m
    return l

magic = 1000

anss = [-1] * magic
anss[0] = 0

a = int(stdin.read())

x = 1

while True:
    val = fsum(x)
    if val % a >= magic:
       nval = val + (a - val % a)
       x = lb(nval) + 1
       continue
    val = val % a
    if anss[val] != -1:
       print anss[val]+1, x
#       assert((fsum(x) - fsum(anss[val])) % a == 0)
       break
    else:
       anss[val] = x
    x = x + 1

a = int(raw_input())

def s(n):
    r = 0
    while n > 0:
        r += n % 10
        n /= 10
    return r

def s1(n):
    if n < 10:
        return sum(range(0, n + 1))
    D = n % 10
    r = 0
    for d in range(10):
        if d <= D:
            r += d*(n / 10 + 1)
        else:
            r += d*(n / 10)
    r += s(n / 10) * (D + 1)
    r += s1((n / 10) - 1) * 10
    return r

def s2(n):
    r = 0
    for i in range(n + 1):
        r += s(i)
    return r

was = {}
was[0] = 0

x = 0
while True:
    assert x / a < 30
    x += a
    l = 0
    r = max(a, 100)
    while l + 1 < r:
        m = (l + r) / 2
        if s1(m) < x:
            l = m
        else:
            r = m
    k = s1(r) % a
    assert k < 2000
    if k in was:
        print was[k] + 1, r
        break

    was[k] = r

pow_l = 50
cnt = 10 ** (pow_l - 1)
cnt *= 45
cnt *= pow_l
cnt += 1

l = 1
r = 10 ** pow_l

mod = int(raw_input())
cnt %= mod
if (cnt == 0):
    print l, r
else:
    print l + (mod - cnt), r + (mod - cnt)

def g (x):
    global arr
    z = 0
    while 10 ** z <= x:
        z += 1
    z -= 1
    ans = 0
    while x > 0:
        y = x // 10 ** z
        ans += 10 ** z * y * (y - 1) // 2
        ans += y * arr[z]
        ans += y * (x % 10 ** z)
        x %= 10 ** z
        z -= 1
    return ans

def f(x):
    r = 0
    while x > 0:
        r += x % 10
        x //= 10
    return r

n = 100
arr = [0] * n
for i in range(1, n):
    arr[i] = 45 * 10 ** (i - 1) + 10 * arr[i - 1]
for i in range(n):
    arr[i] += 1
a = int(input())
ans = [-1] * 1000
for i in range(1, 1000):
    L, R = 1, 10 ** 30
    while R - L > 1:
        M = (L + R) // 2
        if g(M) - f(M) > i * a:
            R = M
        else:
            L = M
    x = g(R) % a
    if ans[x] != -1:
        print(ans[x], R)
        break
    else:
        ans[(g(R) - f(R)) % a] = R

#!/usr/bin/env python
#-*- coding:utf-8 -*-

import math

a = int(raw_input())
r = int(math.ceil(math.log(a, 10))) + 1
z = (45 * r * pow(10, r - 1, a) + 1) % a
x = a - z
print x, 10 ** r + x
# print fsum(10**5 + 100) - fsum(100) - fsum(10**5)
# print fsum(11010), fsum(10000) + 1010 + fsum(1000) + 10 + fsum(10)

#!/usr/bin/env python
#-*- coding:utf-8 -*-

import math

a = int(raw_input())
r = int(math.ceil(math.log(a, 10))) + 1
z = (45 * r * pow(10, r - 1, a) + 1) % a
x = a - z
print 10 ** r + x, x
# print fsum(10**5 + 100) - fsum(100) - fsum(10**5)
# print fsum(11010), fsum(10000) + 1010 + fsum(1000) + 10 + fsum(10)

#Thanks to http://codeforces.com/profile/ZhouYuChen

'''def s(x):
	if(x==0):
		return 0
	return x+s(x-1)

def calc(x):
	m=1
	ans=0
	while(x):
		ans2=s(x%10)
		x/=10
		ans2+=(45*x)
		ans2*=m
		ans+=ans2
		m*=10
	return ans

def bc(x):
	ans=0
	while(x):
		ans+=x%10
		x/=10
	return ans

def brute(x):
	ans=0
	while(x>0):
		ans+=bc(x)
		x-=1
	return ans

a=int((raw_input()))
print calc(a), brute(a) '''

a=int(raw_input())
s=(45*(10**101))
k=(a-s)%a
print k,(10**100)+k-1

#Thanks to http://codeforces.com/profile/ZhouYuChen

'''def s(x):
	if(x==0):
		return 0
	return x+s(x-1)

def calc(x):
	m=1
	ans=0
	while(x):
		ans2=s(x%10)
		x/=10
		ans2+=(45*x)
		ans2*=m
		ans+=ans2
		m*=10
	return ans

def bc(x):
	ans=0
	while(x):
		ans+=x%10
		x/=10
	return ans

def brute(x):
	ans=0
	while(x>0):
		ans+=bc(x)
		x-=1
	return ans

a=int((raw_input()))
print calc(a), brute(a) '''

a=int(raw_input())
s=45*(10**102)%a
k=(a-s)%a
print k,(10**101)+k-1

#Thanks to http://codeforces.com/profile/ZhouYuChen

'''def s(x):
	if(x==0):
		return 0
	return x+s(x-1)

def calc(x):
	m=1
	ans=0
	while(x):
		ans2=s(x%10)
		x/=10
		ans2+=(45*x)
		ans2*=m
		ans+=ans2
		m*=10
	return ans

def bc(x):
	ans=0
	while(x):
		ans+=x%10
		x/=10
	return ans

def brute(x):
	ans=0
	while(x>0):
		ans+=bc(x)
		x-=1
	return ans

a=int((raw_input()))
print calc(a), brute(a) '''

a=int(raw_input())
s=(45*(10**101))
k=(a-s)%a
print k,(10**101)+k-1

#!/usr/bin/env python

import random

def read():
    return input()

def g(n):
    strNum = str(n)

    ret = 0
    for idx in range(len(strNum)):
        if idx == 0:
            digit = int(strNum[idx])
            for i in range(1, digit):
                ret += i * (10 ** (len(strNum) - idx - 1))
            ret += digit * (int(strNum[1:]) + 1)
        else:
            for i in range(1, 10):
                ret += i * (10 ** (len(strNum) - idx - 1))

    return ret

def work(a):

    while 1:
        v = random.randrange(2, 10 ** 199)
        gv = g(v)

        L = 0
        R = a + 1
        while L < R:
            mid = (L + R) / 2

            if g(v + mid) - gv >= a + 1:
                R = mid
            else:
                L = mid + 1

        if g(v + L) - gv == a + 1:
            print 1, v + L
            break

if __name__ == "__main__":
    work(read())

#!/usr/bin/env python

import random

def read():
    return input()

def g(n):
    strNum = str(n)

    if len(strNum) == 1:
        return n * (n + 1) / 2

    ret = 0
    for idx in range(len(strNum)):
        if idx == 0:
            digit = int(strNum[idx])
            for i in range(1, digit):
                ret += i * (10 ** (len(strNum) - idx - 1))
            ret += digit * (int(strNum[1:]) + 1)
        else:
            for i in range(1, 10):
                ret += i * (10 ** (len(strNum) - idx - 1))

    return ret

def work(a):
    while 1:
        v = random.randrange(2, 10 ** 199)
        gv = g(v)

        L = 0
        R = a
        while L < R:
            mid = (L + R) / 2

            if g(v + mid) - gv >= a:
                R = mid
            else:
                L = mid + 1

        if g(v + L) - gv == a:
            print 1, v + L
            break

if __name__ == "__main__":
    work(read())

from math import inf as inf
from math import *
from collections import *
import sys
from itertools import permutations
input=sys.stdin.readline
t=1
while(t):
    t-=1
    n=int(input())
    f=45*20*(10**19)%n
    print(f,f+(10**20-1))

n = input()
n = int(n)
#print(n)
if (n < 46):
    a = 0
    while n:
        if (n >= 10):
            a = a * 10 + 9
            n -= 9;
        else:
            a = a * 10 + n
            n = 0
    if a == 1:
        a = a + 1
    print(a - 1, a)
    exit(0)
p = 1
for i in range(1,n):
    p *= 10
    m = p // 10 * i * 45 + 1
    #print(m, p, m + p)
    if (m + p > n):
        k = n - m
        while k < 0:
            k += n
        if (k >= p):
            continue
        print(k + 1, p + k)
        exit(0)

n = input()
n = int(n)
#print(n)
if (n < 46):
    a = 0
    while n:
        if (n >= 10):
            a = a * 10 + 9
            n -= 9;
        else:
            a = a * 10 + n
            n = 0
    print(a, a - 1)
    exit(0)
p = 1
for i in range(1,n):
    p *= 10
    m = p // 10 * i * 45 + 1
    #print(m, p, m + p)
    if (m + p > n):
        k = n - m
        while k < 0:
            k += n
        print(k + 1, p + k)
        exit(0)

n = input()
n = int(n)
#print(n)
if (n < 46):
    a = 0
    while n:
        if (n >= 10):
            a = a * 10 + 9
            n -= 9;
        else:
            a = a * 10 + n
            n = 0
    print(a, a - 1)
    exit(0)
p = 1
for i in range(1,n):
    p *= 10
    m = p // 10 * i * 45 + 1
    #print(m, p, m + p)
    if (m + p > n):
        k = n - m
        while k < 0:
            k += n
        if (k >= p):
            continue
        print(k + 1, p + k)
        exit(0)

n = input()
n = int(n)
#print(n)
if (n < 46):
    a = 0
    while n:
        if (n >= 10):
            a = a * 10 + 9
            n -= 9;
        else:
            a = a * 10 + n
            n = 0
    if a == 1:
        a = a + 1
    print(a, a - 1)
    exit(0)
p = 1
for i in range(1,n):
    p *= 10
    m = p // 10 * i * 45 + 1
    #print(m, p, m + p)
    if (m + p > n):
        k = n - m
        while k < 0:
            k += n
        if (k >= p):
            continue
        print(k + 1, p + k)
        exit(0)

from random import randint
def main():
    a = int(raw_input())
    t = 0
    dp = [0, 45 % a]
    d = [1, 10]
    for i in xrange(1, 21):
        dp.append((dp[-1] * 10 + 45 * d[-1]) % a)
        d.append(d[-1] * 10 % a)
    def f(xx, x):
        res = 0
        i = 0
        t = 1
        while x:
            y = x % 10
            res += dp[i] * y % a
            res += y * (y - 1) / 2 * d[i] % a
            res %= a
            res += t * y
            res %= a
            t = y * d[i] + t
            t %= a
            x /= 10
            i = i + 1
        xx = x
        while x:
            y = x % 10
            res += dp[i] * y % a
            res += y * (y - 1) / 2 * d[i] % a
            res %= a
            res += t * y
            res %= a
            t = y * d[i] + t
            t %= a
            x /= 10
            i = i + 1
        return res
    di = dict()
    while 1:
        ru, rd = randint(1, 10 ** 9), randint(1, 10 ** 9)
        k = f(ru, rd)
        if k in di:
            if di[k] != (ru, rd):
                s, t = di[k], (ru, rd)
                if s > t: s, t = t, s
                s = s[0] * 1000000000 + s[1] + 1
                t = t[0] * 1000000000 + t[1]
                print s, t
            return
        else:
            di[k] = (ru, rd)
main()

from random import randint
def main():
    a = int(raw_input())
    t = 0
    dp = [0, 45 % a]
    d = [1, 10]
    for i in xrange(1, 21):
        dp.append((dp[-1] * 10 + 45 * d[-1]) % a)
        d.append(d[-1] * 10 % a)
    def f(x, xx):
        res = 0
        i = 0
        t = 1
        while x:
            y = x % 10
            res += dp[i] * y % a
            res += y * (y - 1) / 2 * d[i] % a
            res %= a
            res += t * y
            res %= a
            t = y * d[i] + t
            t %= a
            x /= 10
            i = i + 1
        xx = x
        while x:
            y = x % 10
            res += dp[i] * y % a
            res += y * (y - 1) / 2 * d[i] % a
            res %= a
            res += t * y
            res %= a
            t = y * d[i] + t
            t %= a
            x /= 10
            i = i + 1
        return res
    di = dict()
    while 1:
        ru, rd = randint(1, 10 ** 9), randint(1, 10 ** 9)
        k = f(ru, rd)
        if k in di:
            if di[k] != (ru, rd):
                s, t = di[k], (ru, rd)
                if s > t: s, t = t, s
                s = s[0] * 1000000000 + s[1] + 1
                t = t[0] * 1000000000 + t[1]
                print s, t
            return
        else:
            di[k] = (ru, rd)
main()

A = int(raw_input())
pow10 = 10 ** 20

s = (int(4.5 * 20) * pow10) % A
#think about the offset
A = (A - s) % A
print A, A + pow10 - 1

#!/usr/bin/env python2

def sumfunc(k):
  return 45 * 10 ** (k - 1) * k

a = int(input())
val = sumfunc(18)
val %= a
rev = (a - val) % a
if rev == 0:
  print(1, 10 ** 18 - 1)
else:
  print(rev, 10 ** 18 + rev - 1)

import itertools
import math

a = int(raw_input())

for k in range(1,11):
    x = a * k
    for keta in range(1,20):
        pow10keta = 1
        for i in range(0,keta):
            pow10keta = pow10keta * 10
        start = 45 * keta * pow10keta/10 + 1
        end   = start + 9 * pow10keta - 1
        if start<=x and x<= end:
            r = pow10keta + x - start
            l = r + 1 - pow10keta
            print int(l),int(r)
            exit(0)

import itertools
import math

a = int(raw_input())

for k in range(1,1000000):
    x = a * k
    for keta in range(1,100):
        pow10keta = 1
        for i in range(1,keta):
            pow10keta = pow10keta * 10
        start = 45 * keta * pow10keta/10 + 1
        end   = start + 9 * pow10keta - 1
        if start<=x and x<= end:
            r = pow10keta + x - start
            l = r + 1 - pow10keta
            print int(l),int(r)
            exit(0)

import itertools
import math

a = int(raw_input())

for k in range(1,1000):
    x = a * k
    for keta in range(1,100):
        pow10keta = math.pow(10,keta)
        start = 45 * keta * pow10keta/10 + 1
        end   = start + 9 * pow10keta - 1
        if start<=x and x<= end:
            r = pow10keta + x - start
            l = r + 1 - pow10keta
            print int(l),int(r)
            exit(0)

import itertools
import math

a = int(raw_input())

for k in range(1,1000000):
    x = a * k
    for keta in range(1,100):
        pow10keta = math.pow(10,keta)
        start = 45 * keta * pow10keta/10 + 1
        end   = start + 9 * pow10keta - 1
        if start<=x and x<= end:
            r = pow10keta + x - start
            l = r + 1 - pow10keta
            print int(l),int(r)
            exit(0)

A = int(input());
start = (45*10**18*18+1)%A;
start = A-start;
print(start+1, start+10**19);

#!/usr/bin/env python3

def sumfunc(k):
    return 45 * 10 ** (k - 1) * k

a = int(input())
val = sumfunc(18)
val %= a
rev = (a - val) % a
if rev == 0:
    print(1, 10 ** 18)
else:
    print(rev, 10 ** 18 + rev - 1)

def c(x):
    return int(45 * x * 10**x//10 + 1)

a = int(input())
for i in range(1, 100):

    x = c(i)
    x %= a
    want = (1-x)%a
    if want != 0:
        print(want, want + 10**i - 1)
        quit()

def c(x):
    return int(45 * x * 10**x//10 + 1)

a = int(input())
for i in range(18, 100):

    x = c(i)
    x %= a
    want = (1-x)%a
    if want != 0:
        print(want, want + 10**i - 1)
        quit()

def main():
    a = int(input())

    def digits(n):
        while n > 0:
            yield n % 10
            n //= 10

    def F(n):
        res = 5 * n
        _r = 0
        for di in digits(n):
            _r += di * (di - 9)
        return res + _r//2

    #j = 1
    #while (F(a+j-1)-F(j-1)) % a:
    #    j*=2
    for i in [9, 99, 999, 9999, 99999]:
        res = 0
        for j in range(i+1):
            for di in digits(j):
                res += di
        print(i, F(i), res)

if __name__ == '__main__':
    main()

from math import ceil, log10

def main():
    a = int(input())

    n = ceil(log10(a))
    x = (45*n*10**(n-1)+1)%a
    print(a-x+1, 10**n+a-x)

    def digits(n):
        while n > 0:
            yield n % 10
            n //= 10

    for i in range(200):
        res = 0
        for j in range(i+1):
            for di in digits(j):
                res += di
        print(i, res)

if __name__ == '__main__':
    main()

def main():
    a = int(input())

    def digits(n):
        while n > 0:
            yield n % 10
            n //= 10

    def F(n):
        res = 5 * n
        _r = 0
        for di in digits(n):
            _r += di * (di - 9)
        return res + _r//2

    j = 1
    while (F(a+j-1)-F(j-1)) % a:
        j*=2

    print(j, a+j-1)

if __name__ == '__main__':
    main()

from math import ceil, log10

def main():
    a = int(input())

    n = ceil(log10(a))
    x = (45*n*10**(n-1)+1)%a
    print(a-x+1, 10**n+a-x)

if __name__ == '__main__':
    main()

def main():
    a = int(input())

    def digits(n):
        while n > 0:
            yield n % 10
            n //= 10

    def F(n):
        res = 5 * n
        _r = 0
        for di in digits(n):
            _r += di * (di - 9)
        return res + _r//2

    j = 1
    while (F(a+j)-F(j-1)) % a:
        j*=2

    print(j, a+j)

if __name__ == '__main__':
    main()

n=int(input())
x=10**18
k=(774*x)%n
def inv(a):
  for i in range(a):
    if i*n+1==(i*n+1)//a*a:
      return (i*n+1)//a

if n%9==0:
  offset=k//9
elif n%3==0:
  n//=3
  k//=3
  offset=(k*inv(3))%n
else:
  offset=(k*inv(9))%n
l=x-1-offset
r=10*x-1-offset
print(str(l)+" "+str(r))

def g (x):
    global arr
    z = 0
    while 10 ** z <= x:
        z += 1
    z -= 1
    ans = 0
    while x > 0:
        y = x // 10 ** z
        ans += 10 ** z * y * (y - 1) // 2
        ans += y * arr[z]
        ans += y * (x % 10 ** z)
        x %= 10 ** z
        z -= 1
    return ans

def f(x):
    r = 0
    for i in range(x + 1):
        j = i
        while j > 0:
            r += j % 10
            j //= 10
    return r

n = 100
arr = [0] * n
for i in range(1, n):
    arr[i] = 45 * 10 ** (i - 1) + 10 * arr[i - 1]
for i in range(n):
    arr[i] += 1
a = int(input())
ans = [-1] * 1000
for i in range(1, 1000):
    L, R = 1, 10 ** 100
    while R - L > 1:
        M = (L + R) // 2
        if g(M) > i * a:
            R = M
        else:
            L = M
    x = g(R) % a
    if ans[x] != -1:
        print(ans[x], R)
        break
    else:
        ans[x] = R

pow_l = 50
cnt = 10 ** (pow_l - 1)
cnt *= 45
cnt += 1

l = 1
r = 10 ** pow_l

mod = int(raw_input())
cnt %= mod
if (cnt == 0):
    print l, r
else:
    print l + (mod - cnt), r + (mod - cnt)

pow_l = 1
cnt = 10 ** (pow_l - 1)
cnt *= 45
cnt += 1

l = 1
r = 10 ** pow_l

mod = int(raw_input())
cnt %= mod
if (cnt == 0):
    print l, r
else:
    print l + (mod - cnt), r + (mod - cnt)

import sys

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

rem = (19 * 45 * 10**18) % n
rem = (n-rem) % n

lo = 10**19 - (10**19 - rem)
hi = lo + 10**19 - 1

print str(lo) + ' ' + str(hi)

try:
    while True:
        a = int(input())
        x = a - ((10**20)*9) % a
        print(x, 10**19+x-1)
except EOFError:
    pass

try:
    while True:
        a = int(input())
        x = a - ((10**19)*9) % a
        print(x, 10**18+x-1)
except EOFError:
    pass