Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of positive integers n, such that the factorial of n ends with exactly m zeroes. Are you among those great programmers who can solve this problem?


-----Input-----

The only line of input contains an integer m (1 ≤ m ≤ 100 000) — the required number of trailing zeroes in factorial.


-----Output-----

First print k — the number of values of n such that the factorial of n ends with m zeroes. Then print these k integers in increasing order.


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

Output
5
5 6 7 8 9 
Input
5

Output
0


-----Note-----

The factorial of n is equal to the product of all integers from 1 to n inclusive, that is n! = 1·2·3·...·n.

In the first sample, 5! = 120, 6! = 720, 7! = 5040, 8! = 40320 and 9! = 362880.

Difficulty: interview

Starter code:

Solutions:
m = int(input())
a = 0
while m > 0:
    a += 5
    b = a
    c = 0
    while b % 5 == 0:
        b //= 5
        c += 1
    m -= c
if m < 0: print(0)
else:
    print(5)
    print(a, a + 1, a + 2, a + 3, a + 4)


m, c2, c5, i, v = int(input()), 0, 0, 1, []
while min(c2, c5) <= m:
    c = i
    while c % 2 == 0:
        c, c2 = c // 2, c2 + 1
    while c % 5 == 0:
        c, c5 = c // 5, c5 + 1
    if min(c2, c5) == m:
        v.append(i)
    i += 1
print(len(v))
if v:
    print(' '.join(map(str, v)))

a = int(input())
i = 0
cnt = 0
while cnt < a:
    i += 5
    i1 = i
    while i1 % 5 == 0:
        i1 //= 5
        cnt += 1
if cnt == a:
    print(5)
    for s in range(i, i+5):
        print(s, end=' ')
else:
    print(0)

m = int(input())
col = 0
pos = 0
a1 = -1
a2 = -1
while True:
    pos += 1
    h = 1
    e = 0
    while pos % (5 * h) == 0:
        h *= 5
        e += 1
    col += e
    if a1 == -1 and col == m:
        a1 = pos
    if col > m:
        a2 = pos
        break
if a1 > 0 and a2 > 0:
    print(a2 - a1)
    for i in range(a1, a2):
        print(i, end = ' ')
else:
    print(0)
    
    


def count(x):
    result = 0
    while x:
        result += x // 5
        x //= 5
    return result


def find(n):
    l, r = 0, 25 * n
    while l + 1 < r:
        m = (l + r) >> 1
        if count(m) < n:
            l = m
        else:
            r = m
    return r


m = int(input())
l, r = find(m), find(m + 1)
print(r - l)
print(*list(range(l, r)))


m = int(input())
count5 = 1
n = 5
while count5<m:
    n += 5
    tn = n
    while tn % 5 == 0:
        tn /= 5
        count5+=1
if count5 == m:
    print(5)
    print(' '.join(map(str, range(n,n+5))))
else:
    print(0)

from itertools import count
n = int(input())

twos = 0
fives = 0

ans = []

def p_in_num(p, num):
    coun = 0
    while num % p == 0:
        num //= p
        coun += 1
    return coun

for i in count(2):
    twos += p_in_num(2, i)
    fives += p_in_num(5, i)
    zeroes = min(twos, fives)
    if zeroes == n:
        ans.append(i)
    elif zeroes > n:
        break

print(len(ans))
if len(ans) != 0:
    print(*ans)



n=int(input())
l,r=0,n*5
def kil(a):
    s=0
    while a>4: a//=5; s+=a
    return s
a=0
while l<=r:
    s=(l+r)//2
    t=kil(s)
    if t<n: l=s+1
    else: a=s; r=s-1
l=[]
while kil(a)==n:
    l+=[str(a)]; a+=1
print(len(l))
print(' '.join(l))

from math import *
n = int(input())
per = 0
per2 = 5
cou = 0
cou2 =1
while per < n:
    cou2+=1
    while per2 % 5 == 0:
        per2 = per2//5
        per+=1
    if per == n:
        cou = 1
        per2 = (cou2-1) * 5
        break
    
    per2 = cou2 * 5
if cou == 1:
    print(5)
    print(per2, per2+1,per2+2,per2+3,per2+4)
else:
    print(0)

__author__ = 'Utena'
def t(x):
    c=0
    if x%5==0:return t(x//5)+1
    else:return 0
m=int(input())
i=5
n=0
c=[]
t1=0
while True:
    n+=t(i)
    if n==m:
        t1+=1
        c.append(str(i))
    if n>m:break
    i+=1
if t1==0:
    print(0)
else:
    print(t1)
    print(' '.join(c))

import itertools
import bisect

m = int(input())
degs = [0 for i in range(5*m+6)]
deg = 5
while deg < 5*m+1:
    for i in range(deg, 5*m+6, deg):
        degs[i] += 1
    deg *= 5
prefix = list(itertools.accumulate(degs))
i = bisect.bisect_left(prefix, m)
ans = []
for j in range(i, min(i+5, 5*m+6)):
    if prefix[j] == m:
        ans.append(j)
print(len(ans))
for j in ans: print(j, end = ' ')


def Pow5(n):
    s = 0
    while n:
        s+= (n // 5)
        n//= 5
    return s

k = int(input())
r = -1
for n in range(0, 5 * k + 1, 5):
    t = Pow5(n)
    if(t == k):
        r = n

if r == -1:
    print(0)
else:
    print(5)
    s = ""
    for i in range(0, 5):
        s+= (str)(r + i) + ' '
    print(s)


m = int(input())

pw = 0
cur = 1
f = 1

while pw < m:
    cur += 1
    k = cur
    while k % 5 == 0:
        k //= 5
        pw += 1

if pw > m:
    print(0)
else:
    print(5)
    print(cur, cur + 1, cur + 2, cur + 3, cur + 4)

def cnt_zeroes(n):
    p5 = 1
    i = 0
    while 5 * p5 <= n:
        p5 *= 5
        i += 1
    ans = 0
    all_cnt = 0
    while p5 > 1:
        ans += i * (n // p5 - all_cnt)
        all_cnt += (n // p5 - all_cnt)
        p5 //= 5
        i -= 1
    return ans

def bin_search(n):
    l = 1
    r = 1000000
    while r - l > 1:
        m = (l + r) // 2
        if cnt_zeroes(m) < n:
            l = m + 1
        else:
            r = m
    if cnt_zeroes(l) == n:
        return l
    else:
        return r

n = int(input())
f = bin_search(n)
if cnt_zeroes(f) == n:
    print(5)
    for x in range(f, f + 5):
        print(x,end=' ')
    print()
else:
    print(0)


import math
m=int(input())
def f(k):
    res=0
    power=5
    l=math.ceil(math.log(k,5))
    for i in range(1,l+2):
        res+=k//power
        power*=5
    return res
def pok(k):
    res=0
    
    while k%5==0:
        res+=1
        k=k//5
    return res
s=4*m+5-((4*m)%5)
t=f(s)
out=0
while t<m:
    s+=5
    
    t+=pok(s)
if t!=m:
    print(0)
else:
    print(5)
    print(" ".join([str(z) for z in [s,s+1,s+2,s+3,s+4]]))

    



m = int(input())
k = 0
num = 0
mem = 0
r = 0
while k < m + 1:
    num += 1
    n = num
    while n > 1 :
        if n % 5 == 0:
            r += 1
            n //= 5
        else:
            break
    mem = k
    k += r
    r = 0
if (mem - m != 0):
    print(0)
else:
    print(5)
    print(' '.join(map(str, list(range(num-5, num)))))


a = int(input())
s = 0
i = 0
while s < a:
	i += 5
	t = i
	while t % 5 == 0:
		s += 1
		t /= 5

if s == a:
	print(5)
	for j in range(0, 5):
		print(i + j, end = ' ')
else:
	print(0)

def zeroes(x):
    n = 0
    while x:
        d = x // 5
        n += d
        x = d
    return n

m = int(input())
i = 0
j = 500000
while j - i > 1:
    k = (i + j) // 2
    n = zeroes(k)
    if n < m:
        i = k
    elif n > m:
        j = k
    else:
        k = k // 5 * 5
        print(5)
        print(' '.join([str(k + i) for i in range(5)]))
        break
else:
    print(0)


m = int(input())

zeros = {}
z = 0
i = 5
while z <= m:
    i_temp = i
    while i_temp % 5 == 0:
        i_temp //= 5
        z += 1

    zeros[z] = i
    i += 5

z = zeros.get(m, None)
if z is None:
    print(0)
else:
    x = m + 1
    while zeros.get(x, None) is None:
        x += 1
    print(5)
    for i in range(zeros[m], zeros[x]):
        print(i, end=" ")
    print()

import collections
import math

#a, b, c = map(int, input().split())
n = int(input())
i, ans = 0, 0
while i < n:
    ans += 5
    x = ans
    while x % 5 == 0:
        i += 1
        x //= 5
    
    if i > n:
        print(0)
        return
print(5)
print(ans, ans + 1, ans + 2, ans + 3, ans + 4, sep=' ')
    

m = int(input())
curr = 5
power = 1
while power < m:
    curr += 5
    s = curr
    while s % 5 == 0:
        s //= 5
        power += 1
if power > m:
    print(0)
else:
    print(5)
    for i in range(curr, curr + 5):
        print(i, end=' ')

def test():
    from math import factorial as f
    cnt = 0
    i = 1
   #while cnt != 100000+1: 
    for i in range(1, 100+1):
        s = str(f(i))
        cnt = 0
        for j in range(len(s)-1,-1,-1):
            if s[j] == "0":
                cnt += 1
            else:
                break
        print(cnt, end= " ")#, f(i))
        i += 1
    print(cnt, end=" ")
    


def func(x):
    ans = 0
    while x % 5 == 0:
        x //= 5
        ans += 1
    return ans

def main():
    n = int(input())
    cnt = 0
    i = 1
    while True:
        if i % 5 == 0:
            cnt += func(i)
        if cnt == n:
            print(5)
            print(i, i+1, i+2, i+3, i+4)
            break
        if cnt > n:
            print(0)
            break
        i += 1

main()

def f(num):
    temp = 0
    while num % 5 == 0:
        num //= 5
        temp += 1
    return temp
m = int(input())
num = 0
i = 5
while 500001 > i and m > num:
    num += f(i)
    i += 5
if m == num:
    print(5)
    i -= 5
    for j in range(5):
        print(i+j,end=" ")
else:
    print(0)


n = int(input())

def zrs(n):
    ret = 0
    while n >= 5:
        n //= 5
        ret += n
    return ret

def bins(n):
    a,b = 1, n * 5 +1
    while a < b:
        mid = (a+b) // 2
        guess = zrs(mid)
        #print (guess)
        #print(a,b)
        if guess < n:
            a = mid +1
        elif guess > n:
            b = mid -1
        else:
            return mid
    return 0

x = bins(n)
x = x - x%5

if x == 0:
    print('0')
else:
    print('5')
    print(' '.join(map(str,list(range(x, x+5)))))


import math
n = int(input())
c = 0
num = 0
while c < n:
    num += 5
    tnum = num
    while tnum % 5 == 0:
        tnum //= 5;
        c += 1
if c > n:
    print(0)
else:
    print(5)
    for i in range(5):
        print(num+i, end=' ')