JATC's math teacher always gives the class some interesting math problems so that they don't get bored. Today the problem is as follows. Given an integer $$$n$$$, you can perform the following operations zero or more times:  mul $$$x$$$: multiplies $$$n$$$ by $$$x$$$ (where $$$x$$$ is an arbitrary positive integer).  sqrt: replaces $$$n$$$ with $$$\sqrt{n}$$$ (to apply this operation, $$$\sqrt{n}$$$ must be an integer). You can perform these operations as many times as you like. What is the minimum value of $$$n$$$, that can be achieved and what is the minimum number of operations, to achieve that minimum value?Apparently, no one in the class knows the answer to this problem, maybe you can help them?

The only line of the input contains a single integer $$$n$$$ ($$$1 \le n \le 10^6$$$) — the initial number.

Print two integers: the minimum integer $$$n$$$ that can be achieved using the described operations and the minimum number of operations required.

NoteIn the first example, you can apply the operation mul $$$5$$$ to get $$$100$$$ and then sqrt to get $$$10$$$.In the second example, you can first apply sqrt to get $$$72$$$, then mul $$$18$$$ to get $$$1296$$$ and finally two more sqrt and you get $$$6$$$.Note, that even if the initial value of $$$n$$$ is less or equal $$$10^6$$$, it can still become greater than $$$10^6$$$ after applying one or more operations.

import math
def primeFactorize(n):
	dic = {}
	i = 2
	while(n>1):
		while(n%i==0):
			try:
				dic[i]+=1
			except:
				dic[i] = 1
			n = n//i
		i += 1
	return dic

def noofoperation(lis):
	temp = max(lis)
	z = math.ceil(math.log(temp,2))
	y = 2**z
	t = False
	for i in lis:
		if i!=y:
			t=True
			break
	if t:
		return z+1
	else:
		return z

if __name__=="__main__":
	n = int(input())
	if n==1:
		print(1,0)
		exit()
	count = 0
	dic = primeFactorize(n)
	count = noofoperation(list(dic.values()))
	pro = 1
	for i in dic:
		pro *= i
	print(pro,count)

n = int(input())

if n == 1:
    print(1, 0)
    exit(0)

factors = {}
mindegree = float("inf")
maxdegree = 0
answer = 1

for x in range(2, int(n ** 0.5) + 1):
    if n == 1: break
    multiplicity = 0
    while n % x == 0:
        n = n // x
        multiplicity += 1
    if multiplicity:
        answer *= x
        #factors[x] = multiplicity
        mindegree = min(mindegree, multiplicity)
        maxdegree = max(maxdegree, multiplicity)

if n != 1:
    #factors[n] = 1
    answer *= n
    mindegree = min(mindegree, 1)
    maxdegree = max(maxdegree, 1)

deg = 0
while 2 ** deg < maxdegree:
    deg += 1

result = deg + 1
if 2 ** deg == maxdegree == mindegree:
    result -= 1
print(answer, result)

#!/usr/bin/env python
"""
This file is part of https://github.com/Cheran-Senthil/PyRival.
Copyright 2019 Cheran Senthilkumar <hello@cheran.io>

"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op
import random
import sys
from atexit import register
from bisect import bisect_left, bisect_right
from collections import Counter
# from copy import deepcopy
# from decimal import Decimal
# from difflib import SequenceMatcher
from functools import reduce
# from heapq import heappop, heappush
from io import BytesIO, FileIO, StringIO

if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x

INP_FILE = 0
OUT_FILE = 1

if sys.version_info[0] < 3:
    sys.stdin = BytesIO(FileIO(INP_FILE).read())
    sys.stdout = BytesIO()
    register(lambda: FileIO(OUT_FILE, 'w').write(sys.stdout.getvalue()))
else:
    sys.stdin = StringIO(FileIO(INP_FILE).read().decode())
    sys.stdout = StringIO()
    register(lambda: FileIO(OUT_FILE, 'w').write(sys.stdout.getvalue().encode()))

input = lambda: sys.stdin.readline().rstrip('\r\n')

def memodict(f):
    """ Memoization decorator for a function taking a single argument. """
    class memodict(dict):
        def __missing__(self, key):
            ret = self[key] = f(key)
            return ret
    return memodict().__getitem__

def is_prime(n):
    """
    Deterministic variant of the Miller-Rabin primality test to determine
    whether a given number (upto 2**64) is prime.

    Parameters
    ----------
    n : int
        n >= 0, an integer to be tested for primality.

    Returns
    -------
    bool
        False if n is composite, otherwise True.
    """
    if n in [2, 3, 5, 13, 19, 73, 193, 407521, 299210837]:
        return True

    if (n in [0, 1]) or (any((n % p) == 0 for p in [2, 3, 5, 13, 19, 73, 193, 407521, 299210837])):
        return False

    d, s = n - 1, 0
    while not d % 2:
        d, s = d >> 1, s + 1

    def try_composite(a):
        if pow(a, d, n) == 1:
            return False
        for i in range(s):
            if pow(a, 2**i * d, n) == n - 1:
                return False
        return True

    return not any(try_composite(w) for w in [2, 325, 9375, 28178, 450775, 9780504, 1795265022])

@memodict
def pollard_rho(n):
    if n == 1:
        return Counter()

    if is_prime(n):
        return Counter({n: 1})

    y, c, m = random.randint(1, n - 1), random.randint(1, n - 1), random.randint(1, n - 1)
    g, r, q = 1, 1, 1

    while g == 1:
        x, k = y, 0

        for _ in range(r):
            y = (y*y + c) % n

        while (k < r) and (g == 1):
            ys = y

            for _ in range(min(m, r - k)):
                y = (y*y + c) % n
                q = (q * abs(x - y)) % n

            g = gcd(q, n)
            k += m

        r *= 2

    if g == n:
        while True:
            ys = (ys*ys + c) % n
            g = gcd(abs(x - ys), n)
            if g > 1:
                break

    return pollard_rho(g) + pollard_rho(n // g)

def factors(n):
    """
    Prime factorization using Pollard's rho algorithm.

    Parameters
    ----------
    n : int
        n > 0, an integer to be factorized.

    Returns
    -------
    prime_factors : Counter
        Counter of the prime factors of n.
    """
    prime_factors = Counter()

    def ilog(n, p):
        cnt = 0
        while n % p == 0:
            n, cnt = n // p, cnt + 1
        return n, cnt

    if n % 2 == 0:
        n, prime_factors[2] = ilog(n, 2)
    if n % 3 == 0:
        n, prime_factors[3] = ilog(n, 3)

    i = 5
    while i * i <= min(n, 4294967295):
        if n % i == 0:
            n, prime_factors[i] = ilog(n, i)
        i += 2 if i % 3 == 2 else 4

    if n == 1:
        return prime_factors

    if n <= 4294967295:
        prime_factors[n] = 1
        return prime_factors

    return prime_factors + pollard_rho(n)

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

    if n == 1:
        print(1, 0)
        return

    f = factors(n)
    p = list(f.values())

    a2 = (max(p) - 1).bit_length()
    print(reduce(op.mul, f.keys()), (set(p) != {1 << a2}) + a2)

if __name__ == '__main__':
    main()

'''input
1

'''

from collections import defaultdict as df
from bisect import bisect_left as bl
import sys

n=input()
if n==1:
	print 1,0
else:
	p=[]
	for i in range(2,int(n**0.5)+1 ):
		while n%i==0:
			p.append(i)
			n/=i

	if n>1:
			p.append(n)
	c={}
	for i in p:
		if i not in c:
			c[i]=0
		c[i]+=1
	a1=max(c.values())
	p=set(p)
	ans=1
	for i in p:
		ans*=i
	nn=1
	cc=0
	while nn<a1:
		nn*=2
		cc+=1
	add=0
	for i in c:
		if c[i]!=nn:
			add=1

	print ans,cc+add

n=int(input())
ans=1
temp=n
ans=1
c=0
for i in range(2,n+1):
    if(n%i==0):
        ans*=i
        while(n%i==0):
            n/=i
ans2=ans
while(ans%temp>0):
    ans*=ans
    c+=1
if ans>temp:
    c+=1
print(ans2,c)

from collections import Counter
import functools
import operator
import sys

n = int(input())
num = n
c = Counter()

if n == 1:
    print("1 0")
    sys.exit()

for i in range(2, n + 1):
    if i > n:
        break

    freq = 0
    while n % i == 0:
        c[i] += 1
        n //= i

min_product = functools.reduce(operator.mul, c.keys(), 1)
if min_product == num:
    # number is prime or only has 1 of each factor
    print("{} 0".format(num))
    sys.exit()

most_common = c.most_common()[0][1]
all_same = c.most_common()[0][1] == c.most_common()[-1][1]

def is_pow2(val):
    if val == 1: return True
    if val % 2 == 1: return False
    return is_pow2(val // 2)

def count2(val):
    if val == 1: return 0
    times = 0
    while val != 1:
        val //= 2
        times += 1

    return times

if not is_pow2(most_common):
    num_ops = 2 + count2(most_common)
elif all_same:
    num_ops = count2(most_common)
else:
    num_ops = 1 + count2(most_common)

print("{} {}".format(min_product, num_ops))

def inint():
    return int(input())
def inlist():
    return list(map(int,input().split()))
def pf(a):
    factor=[]
    i=2
    while i*i<=a:
        ch=0
        while a%i==0:
            ch+=1
            a//=i
        if ch!=0:factor.append([i,ch])
        i+=1
    if a>1:
        factor.append([a,1])
    return factor
def main():
    n=inint()
    f=pf(n)
    sol=1
    mxp=0
    for i,j in f:
        mxp=max(mxp,j)
    from math import log,ceil
    ans=0
    if mxp>0:ans=ceil(log(mxp,2))
#    print(ans,mxp,f)
    for i,j in f:
        if j<2**ans:ans+=1;break
    for i,j in f:
        sol*=i
    print(sol,ans)

if __name__ == "__main__":
    #import profile
    #profile.run("main()")
    main()

from math import sqrt
n=int(input())
s=0
f=0
while int(sqrt(n))==sqrt(n) and n>1:
    n=int(sqrt(n))
    s+=1
for i in range(int(sqrt(n)),1,-1):

    while n%(i*i)==0:
        s+=1
        n//=i
        f=1
print(n,s+f)

from math import *
def primeFactors(n,dict1):

    # Print the number of two's that divide n
    while n % 2 == 0:
        try:
            dict1[2]+=1
        except:
            KeyError
            dict1[2]=1
        n = n//2

    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3,floor(sqrt(n))+1,2):

        # while i divides n , print i ad divide n
        while n % i== 0:
            try:
                dict1[i]+=1
            except:
                KeyError
                dict1[i]=1

            n = n//i

    # Condition if n is a prime
    # number greater than 2
    if n > 2:
        try:
            dict1[n]+=1
        except:
            KeyError
            dict1[n]=1

# Driver Program to test above function

n = int(input())
if(n==1):
    print(1,0)
else:
    dict1={}
    primeFactors(n,dict1)
    #print(dict1)
    ans=1
    arr=[]
    for i in dict1.keys():
        ans=ans*i
        arr.append(dict1[i])
    if(len(arr)==arr.count(arr[0])):
        if(ceil(log2(arr[0]))==floor(log2(arr[0]))):
            print(ans,floor(log2(arr[0])))
        else:
            print(ans,1+ceil(log2(arr[0])))
    else:
        maxval=max(arr)
        print(ans,1+ceil(log2(maxval)))

import math
mul2 = [2**x for x in range(1,7)]
n = int(input())
ncopy = n
facto = [0]*1000001
ans = 1
cnt = 0

for i in range(2,math.ceil(n/2)+1):
    if n % i == 0:
        while n % i == 0:
            facto[i] += 1
            n //= i
        ans *= i
        cnt += 1
m = max(facto)

if m == 0:
    print(n,0)
elif ncopy ** .5 == ans:
    print(ans,1)
elif m == 1:
    print(ans,0)
else:
    mi = 64
    lim = 0
    for each in mul2:
        if each-m >= 0 and each-m <= mi:
            mi = abs(m - each)
            lim = each
    times = int(math.log(lim,2)) if (cnt==1 and lim == m) else int(math.log(lim,2))+1
    print(ans,times)

import math

n = int(input())
yin = []
ans1 = 1
for i in range(2, n):
    if n % i == 0:
        num = 0
        while n % i == 0:
            num += 1
            n /= i
        s = [num, i]
        yin.append(s)
        ans1 = ans1 * i
if ans1 == 1:
    print(n, 0)
else:
    yin.sort(reverse=True)
    maxy = yin[0][0]
    miny = yin[-1][0]
    ans2 = 0
    x = 1
    while maxy > x:
        x = x * 2
        ans2 += 1
    if x == maxy and maxy == miny:
        ans2 += 0
    else:
        ans2 += 1
    print(ans1, ans2)

from __future__ import division
from collections import deque, defaultdict, Counter
from math import *

def count_prime(n):
    for i in range(2, n):
        if not prim[i]:
            for j in range(i, n, i):
                prim[j] = i

    for i in range(1, n):
        if not prim[i]:
            prim[i] = i

def prime_factor(x):
    fac = []
    while x > 1:
        div = prim[x]
        fac.append(div)
        x //= div
    return fac

ispow2 = lambda x: x and (not (x & (x - 1)))
n, ans, N = int(input()), [1, 0], 10 ** 6 + 1
if n == 1:
    print('1 0')
    exit()

prim = [0] * (N)
count_prime(N)
mem = Counter(prime_factor(n))
ma = max(mem.values())

for i, j in mem.items():
    ans[0] *= i
    if j != ma:
        ans[1] = 1

if not ispow2(ma):
    ans[1] = 1

ans[1] += int(ceil((log(ma, 2))))
print(' '.join(map(str, ans)))

import math
from collections import defaultdict
import functools

primes = [2]
N = 1001

def generate_primes():
  for i in range(2, N):
    isPrime = True
    sqr = math.ceil(math.sqrt(i))
    for p in primes:
      if i % p == 0:
        isPrime = False
        break
      if p > sqr:
        break
    if isPrime:
      primes.append(i)

def find_factors(n):
  prime_counter = 0
  prime_dict = defaultdict(int)
  while n > 1 and prime_counter < len(primes):
    while n > 1 and n % primes[prime_counter] == 0:
      n = n // primes[prime_counter]
      prime_dict[primes[prime_counter]] += 1
    prime_counter += 1
  if n > 1:
    prime_dict[n] += 1
  return prime_dict

def get_num_steps(arr):
  def find_power(mx):
    two_power = 1
    i = 0
    while two_power < mx:
      two_power *= 2
      i += 1
    return i, two_power == mx

  mx = arr[0]
  all_equal = True
  for i in range(1, len(arr)):
    mx = max(mx, arr[i])
    if arr[i] != arr[i-1]:
      all_equal = False
  pw, pw_equal = find_power(mx)
  if all_equal and pw_equal: #all equal
    return pw
  return pw+1

def solution(n):
  generate_primes()
  prime_dict = find_factors(n)
  max_power = get_num_steps(list(prime_dict.values()))
  return functools.reduce(lambda x, y:x*y, prime_dict.keys(), 1), max_power

n = int(input())
if n == 1:
  print(1, 0)
else:
  print(*solution(n))

from sys import stdin
from collections import deque
mod = 10**9 + 7
import sys
sys.setrecursionlimit(10**5)
from queue import PriorityQueue
# def rl():
#     return [int(w) for w in stdin.readline().split()]
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt,factorial,gcd,log2,inf,ceil
# map(int,input().split())
# # l = list(map(int,input().split()))
# from itertools import permutations
import heapq
# input = lambda: sys.stdin.readline().rstrip()
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop

# Python3 program to find prime factorization
# of a number n in O(Log n) time with
# precomputation allowed.
import math as mt

MAXN = 1000001

# stores smallest prime factor for
# every number
spf = [0 for i in range(MAXN)]

# Calculating SPF (Smallest Prime Factor)
# for every number till MAXN.
# Time Complexity : O(nloglogn)
def sieve():
    spf[1] = 1
    for i in range(2, MAXN):

        # marking smallest prime factor
        # for every number to be itself.
        spf[i] = i

        # separately marking spf for
    # every even number as 2
    for i in range(4, MAXN, 2):
        spf[i] = 2

    for i in range(3, mt.ceil(mt.sqrt(MAXN))):

        # checking if i is prime
        if (spf[i] == i):

            # marking SPF for all numbers
            # divisible by i
            for j in range(i * i, MAXN, i):

                # marking spf[j] if it is
                # not previously marked
                if (spf[j] == j):
                    spf[j] = i

                # A O(log n) function returning prime
# factorization by dividing by smallest
# prime factor at every step
def getFactorization(x):
    ret = list()
    while (x != 1):
        ret.append(spf[x])

        x = x // spf[x]

    return ret

n = int(input())

sieve()
z = getFactorization(n)
hash = defaultdict(int)

for i in z:
    hash[i]+=1
ans = 1
maxi = 0
flag = 0
seti =  set()
for i in hash:
    ans*=i
    maxi = max(maxi,ceil(log2(hash[i])))

for i in hash:
    if (log2(hash[i]))!=maxi:
        flag+=1
        break

print(ans,maxi+flag)

n = int(input())
ans = 1
cnt = 0
k = n
for i in range(2, n + 1):
    if n % i == 0:
        ans *= i
        while n % i == 0:
            n //= i

rec = ans
while rec % k > 0:
    rec *= rec
    cnt += 1
if rec > k:
    cnt += 1
print(ans, cnt)

from sys import stdin, stdout
import cProfile, math
from collections import Counter
from bisect import bisect_left,bisect,bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction

printHeap = str()
memory_constrained = False
P = 10**9+7
import sys
sys.setrecursionlimit(10000000)

class Operation:
    def __init__(self, name, function, function_on_equal, neutral_value=0):
        self.name = name
        self.f = function
        self.f_on_equal = function_on_equal
def add_multiple(x, count):
    return x * count
def min_multiple(x, count):
    return x
def max_multiple(x, count):
    return x
sum_operation = Operation("sum", sum, add_multiple, 0)
min_operation = Operation("min", min, min_multiple, 1e9)
max_operation = Operation("max", max, max_multiple, -1e9)
class SegmentTree:
    def __init__(self,
                 array,
                 operations=[sum_operation, min_operation, max_operation]):
        self.array = array
        if type(operations) != list:
            raise TypeError("operations must be a list")
        self.operations = {}
        for op in operations:
            self.operations[op.name] = op
        self.root = SegmentTreeNode(0, len(array) - 1, self)
    def query(self, start, end, operation_name):
        if self.operations.get(operation_name) == None:
            raise Exception("This operation is not available")
        return self.root._query(start, end, self.operations[operation_name])
    def summary(self):
        return self.root.values
    def update(self, position, value):
        self.root._update(position, value)
    def update_range(self, start, end, value):
        self.root._update_range(start, end, value)
    def __repr__(self):
        return self.root.__repr__()
class SegmentTreeNode:
    def __init__(self, start, end, segment_tree):
        self.range = (start, end)
        self.parent_tree = segment_tree
        self.range_value = None
        self.values = {}
        self.left = None
        self.right = None
        if start == end:
            self._sync()
            return
        self.left = SegmentTreeNode(start, start + (end - start) // 2,
                                    segment_tree)
        self.right = SegmentTreeNode(start + (end - start) // 2 + 1, end,
                                     segment_tree)
        self._sync()
    def _query(self, start, end, operation):
        if end < self.range[0] or start > self.range[1]:
            return None
        if start <= self.range[0] and self.range[1] <= end:
            return self.values[operation.name]
        self._push()
        left_res = self.left._query(start, end,
                                    operation) if self.left else None
        right_res = self.right._query(start, end,
                                      operation) if self.right else None
        if left_res is None:
            return right_res
        if right_res is None:
            return left_res
        return operation.f([left_res, right_res])
    def _update(self, position, value):
        if position < self.range[0] or position > self.range[1]:
            return
        if position == self.range[0] and self.range[1] == position:
            self.parent_tree.array[position] = value
            self._sync()
            return
        self._push()
        self.left._update(position, value)
        self.right._update(position, value)
        self._sync()
    def _update_range(self, start, end, value):
        if end < self.range[0] or start > self.range[1]:
            return
        if start <= self.range[0] and self.range[1] <= end:
            self.range_value = value
            self._sync()
            return
        self._push()
        self.left._update_range(start, end, value)
        self.right._update_range(start, end, value)
        self._sync()
    def _sync(self):
        if self.range[0] == self.range[1]:
            for op in self.parent_tree.operations.values():
                current_value = self.parent_tree.array[self.range[0]]
                if self.range_value is not None:
                    current_value = self.range_value
                self.values[op.name] = op.f([current_value])
        else:
            for op in self.parent_tree.operations.values():
                result = op.f(
                    [self.left.values[op.name], self.right.values[op.name]])
                if self.range_value is not None:
                    bound_length = self.range[1] - self.range[0] + 1
                    result = op.f_on_equal(self.range_value, bound_length)
                self.values[op.name] = result
    def _push(self):
        if self.range_value is None:
            return
        if self.left:
            self.left.range_value = self.range_value
            self.right.range_value = self.range_value
            self.left._sync()
            self.right._sync()
            self.range_value = None
    def __repr__(self):
        ans = "({}, {}): {}\n".format(self.range[0], self.range[1],
                                      self.values)
        if self.left:
            ans += self.left.__repr__()
        if self.right:
            ans += self.right.__repr__()
        return ans

def display(string_to_print):
    stdout.write(str(string_to_print) + "\n")

def primeFactors(n): #n**0.5 complex
    factors = dict()
    for i in range(2,math.ceil(math.sqrt(n))+1):
        while n % i== 0:
            if i in factors:
                factors[i]+=1
            else: factors[i]=1
            n = n // i
    if n>2:
        factors[n]=1
    return (factors)

def isprime(n):
    """Returns True if n is prime."""
    if n < 4:
        return True
    if n % 2 == 0:
        return False
    if n % 3 == 0:
        return False
    i = 5
    w = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += w
        w = 6 - w
    return True

def test_print(*args):
    if test:
        print(args)

def display_list(list1, sep=" "):
    stdout.write(sep.join(map(str, list1)) + "\n")

def get_int():
    return int(stdin.readline().strip())

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

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

memory = dict()
def clear_cache():
    global memory
    memory = dict()
def cached_fn(fn, *args):
    global memory
    if args in memory:
        return memory[args]
    else:
        result = fn(*args)
        memory[args] = result
        return result

# ----------------------------------------------------------------------------------- MAIN PROGRAM
TestCases = False
test = False

def main():
    n = get_int()
    factors = primeFactors(n)
    if n==1:
        print(1,0)
        return
    ma = max(factors.values())
    times = math.ceil(math.log2(ma))
    r =1
    for i in factors.keys():
        r=r*i
    vals = list(factors.values())
    a = vals[0]
    for i in vals:
        if i!=a or math.log2(i)%1!=0:
            times+=1
            break
    print(r,times)

# --------------------------------------------------------------------------------------------- END

if TestCases:
    for _ in range(get_int()):
        cProfile.run('main()') if test else main()
else: cProfile.run('main()') if test else main()

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

def main():
    n = int(input())
    l = factorize(n)
    anscnt = 0

    ma = 0
    for i in range(len(l)):
        ma = max(ma, l[i][1])
    c = 0
    a = 1
    while True:
        if a >= ma:
            break
        a *= 2
        c += 1

    v = 1
    for i in range(len(l)):
        for j in range(a - l[i][1]):
            v *= l[i][0]
            anscnt = 1
    n *= v
    for i in range(c):
        n = n**(1/2)
        anscnt += 1
    print(int(n), anscnt, sep=" ")

if __name__ == '__main__':
    main()

from math import log2, sqrt

def main():
    n = int(input())
    d = {}
    cur = n
    for i in range(2, int(sqrt(n)) + 2):
        while cur % i == 0:
            t = d.get(i, 0) + 1
            d[i] = t
            cur //= i
    if cur != 1:
        d[cur] = 1
    if d == {} or max(d.values()) == 1:
        return print(n, 0)
    cur = []
    action = False
    for k in d:
        q = log2(d[k])
        if q - int(q) != 0 or q == 0:
            if not action:
                action = True
            cur.append(int(q) + 1)
        else:
            cur.append(int(q))
    ans_2 = max(cur)
    if action or len(set(cur)) != 1:
        ans_2 += 1
    ans_1 = 1
    for k in d:
        ans_1 *= k
    return print(ans_1, ans_2)

if __name__=="__main__":
    main()

__author__ = 'tanunia'

from sys import stdin
import math

n = int(stdin.readline())
nums = {}

end = int(math.sqrt(n))
total_n = n
for i in range(2, end+1):
    while total_n % i == 0:
        if i not in nums:
            nums[i] = 0
        nums[i] += 1
        total_n /= i
if total_n > 1:
    nums[total_n] = 1

max_pow = 0
ans1 = 1
for k in nums.keys():
    ans1 *= k
    if nums[k] > max_pow:
        max_pow = nums[k]

pow2 = 1
cnt = 0
while pow2 < max_pow:
    pow2 *= 2
    cnt += 1

ans2 = cnt
for k in nums.keys():
    if nums[k] < pow2:
        ans2 += 1
        break
print(str(int(ans1)) + " " + str(ans2))

#!/usr/bin/env python3
import math

from typing import Dict, List, Tuple

def input_lst() -> List[int]:
    return [int(x) for x in input().split()]

def print_out(res: List[int]):
    print(' '.join([str(x) for x in res]))

def get_primes(n: int) -> List[int]:
    #max_n = int(n**0.5)
    max_n = n
    rng = list(range(max_n+1))
    rng[0] = 1
    rng[1] = 1
    primes = []
    for i in range(2, max_n+1):
        if rng[i] > 1:
            primes.append(i)
            for j in range(i + i, max_n+1, i):
                rng[j] = 0

    return primes

def main():
    n,  = (int(x) for x in input().split())
    if n == 1:
        print('1 0')
        return

    primes = get_primes(n)
    #print(len(primes))
    factors = [0]*len(primes)
    # n_sum = 0
    for prime_id in range(len(primes)):
        prime = primes[prime_id]
        i = 1
        #print(n, prime, i, prime ** i, n % (prime ** i))
        while n % (prime ** i) == 0:
            i+=1

        factors[prime_id] = i - 1

    #print(factors)
    max_factor = max(factors)
    need_to_mul = False
    min_number = 1
    for i, factor in enumerate(factors):
        if not (factor == 0 or factor == max_factor):
            need_to_mul = True
        if factor > 0:
            min_number*=primes[i]

    #print(max_factor)
    squares_count_float = math.log(max_factor, 2)
    squares_count = math.ceil(squares_count_float)
    if squares_count != math.floor(squares_count_float):
        need_to_mul = True

    if need_to_mul:
        squares_count += 1

    print('{} {}'.format(min_number, squares_count))

    #a = input_lst()

if __name__ == '__main__':
    main()

from math import *
def fct(n):

  res = []
  sqfree = 1
  for p in range(2, int(sqrt(n) + 10)):
    cnt = 0
    while n % p == 0:
      cnt += 1
      n //= p
    if cnt > 0:
      res.append(cnt)
      sqfree *= p

  if n != 1:
    res.append(1)
    sqfree *= n
  return res, sqfree

def solve(n):
  if n == 1: return (1, 0)
  fctr, sqfree = fct(n)
  # print("fctr = ", fctr)
  mx = max(fctr)
  # print("mx = ", mx)
  next_pow2 = 2**ceil(log(mx)/log(2))

  # print("next_pow2  = ", next_pow2)
  times = 0
  if (any(x != next_pow2 for x in fctr)):
    times += 1

  while next_pow2 != 1:
    next_pow2 //= 2
    times += 1

  return sqfree, times

print(*solve(int(input())))

#
import collections, atexit, math, sys, bisect

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass

inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit

N, = getIntList()
#print(N)
re = 1
mc = 1
zc = []
for i in range(2, 10000):
    if N%i != 0 : continue
    re *= i
    c = 0
    while N%i==0:
        N//=i
        c+=1

    zc.append(c)
if N>1:
    re*=N
    zc.append(1)
if zc:
    mc = max(zc)
t =1
for i in range(100):
    if mc<=t:
        break
    t*=2
dprint(t)
dprint(zc)
g = i
for x in zc:
    if x<t:
        g+=1
        break

print(re,g)

n = int(input())

if n == 1:
	print('1 0')
else:
	d = 2
	decomp = []
	while d * d <= n:
		cnt = 0
		while n % d == 0:
			cnt += 1
			n //= d
		if cnt > 0:
			decomp += [(d, cnt)]
		if d == 2:
			d += 1
		else:
			d += 2
	if n > 1:
		decomp += [(n, 1)]

	tar = 1
	maxExp = 0
	for e in decomp:
		tar *= e[0]
		maxExp = max(maxExp, e[1])

	divCnt = 0
	curExp = 1
	while curExp < maxExp:
		divCnt += 1
		curExp *= 2

	mulRequired = False
	for e in decomp:
		if e[1] != curExp:
			mulRequired = True
			break
	if mulRequired:
		divCnt += 1

	print('%s %s' % (tar, divCnt))

import sys
n=int(input())
k=n
s=dict()
if n==1:
    print(1,0)
    sys.exit()
for p in range(2,int(n**0.5)+1):
    while(n%p==0):
        if p not in s:
            s.update({p:1})
        else:
            s[p]+=1
        n//=p
if n>1:
    s.update({n:1})
sm=1
for j in s:
    sm*=j
m=max(s.values())
p=1
e=0
#print(m)
while(p<m):
    p*=2
    e+=1
if sm**p==k:
    e-=1
print(sm,e+1)

n=int(input())
x=n
k=2
num=1
m1=1
m2=100
while k*k<=x:
	count=0
	while x%k==0:
		count+=1
		x//=k
	if count>0:
		num*=k
		m1=max(m1,count)
		m2=min(m2,count)
	k+=1
if x>1:
	num*=x
	m2=1

s=bin(m1)[2:]
a= 1 if s.count('1')==1 else -1
b=0
if a==1 and m1!=m2:
	b=1
c=len(s)
m=c-a+b
if n==1:
	m=0
print(num,m)

#In the name of GOD!
m = n = int(input())
ans = 1
num = 0
for i in range(2, m + 1):
	if n % i == 0:
		ans *= i
		while n % i == 0:
			n //= i
hlp = ans
while hlp % m > 0:
	hlp *= hlp
	num += 1
if hlp > m:
	num += 1
print(ans, num)

from math import sqrt
n=int(input())
s=0
f=0
while int(sqrt(n))==sqrt(n) and n>1:
    n=int(sqrt(n))
    s+=1
for i in range(int(sqrt(n)),1,-1):

    while n%(i*i)==0:
        s+=1
        n//=i
        f=1
print(n,s+f)

import math

# A function to print all prime factors of
# a given number n
def pr(n):
    a=[]
    # Print the number of two's that divide n
    while n % 2 == 0:
        a.append(2)
        n = n / 2

    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3,int(math.sqrt(n))+1,2):

        # while i divides n , print i ad divide n
        while n % i== 0:
            a.append(int(i))
            n = n / i
    # Condition if n is a prime
    # number greater than 2
    if n > 2:
        a.append(int(n))
    return list(a)

from collections import defaultdict

a=int(input())
if a==1:
    print(1,0)
else:
    b=pr(a)
    c=defaultdict(int)
    for i in range(len(b)):
        c[b[i]]+=1
    d=[]
    for i in c:
        d.append([c[i],i])
    d=max(d)[0]
    e=0
    while 1>0:
        if (2**e)>=d:
            break
        else:
            e+=1
    f=0
    for i in c:
        if c[i]!=2**e:
            f=1
    c=1
    d=list(set(b))
    for i in range(len(d)):
        c=c*d[i]
    print(c,f+e)

from fractions import gcd
from operator import __mul__

def factor(n):
    res = []
    p = 2
    while p * p <= n:
        if n % p == 0:
            a = 0
            while n % p == 0:
                a += 1
                n /= p

            res.append((p, a))

        p += 1

    if n > 1:
        res.append((n, 1))

    return dict(res)

n = int(raw_input())

import sys
if n == 1:
    print "1 0"
    sys.exit()

F = factor(n)
m = max(F.values())
p2 = 1
lp2 = 0
while p2 < m:
    p2 = p2 * 2
    lp2 += 1

moves = lp2 + (1 if any(e < p2 for e in F.values()) else 0)

print reduce(__mul__, F.keys(), 1), moves

# use this as the main template for python problems
from collections import Counter
import math

def primeFactors(n):

    # Print the number of two's that divide n
    while n % 2 == 0:
        yield 2
        n = n / 2

    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3,int(math.sqrt(n))+1,2):

        # while i divides n , print i ad divide n
        while n % i== 0:
            yield i
            n = n / i

    # Condition if n is a prime
    # number greater than 2
    if n > 2:
        yield n

def get_prime_factorization(n):
    if(n == 1):
        return {1 : 1}
    primes = {}
    for prime in primeFactors(n):
        prime = int(prime)
        if(prime in primes):
            primes[prime] += 1
        else:
            primes[prime] = 1
    return primes

def next_power_of_2(n):
    return int(math.pow(2, math.ceil(math.log(n)/math.log(2))))

def solution(n):

    pf = get_prime_factorization(n)

    lp = 0
    for key, val in pf.items():
        lp = max(lp, val)

    # lp is the largest power in the prime factorization
    # we need the nearest power of two
    np2 = next_power_of_2(lp)
    ans = 1
    for key, val in pf.items():
        ans *= key

    moves = 0
    for key, val in pf.items():
        if(val != np2):
            moves = 1
            break
    moves += int(math.log2(np2))

    print(ans, moves)

if __name__ == "__main__":

    # single variables
    n = [int(val) for val in input().split()][0]

    # solve it!
    solution(n)

import math
import sys
x=int(input())

if x==1:
    print(1,0)
    sys.exit()

TWO=[2**i for i in range(30)]

xr=math.ceil(math.sqrt(x))

LIST=[]
for i in range(2,xr+2):
    if x%i==0:
        while x%i==0:
            LIST.append(i)
            x=x//i
    else:
        i+=1
if x!=1:
    LIST.append(x)

from collections import Counter
counter=Counter(LIST)

ANS=1
for l in counter.keys():
    ANS*=l

count=max(counter.values())

for i in range(30):
    if count<=TWO[i]:
        break

if max(counter.values())==min(counter.values()) and TWO[i]==max(counter.values()):
    ANS2=i
else:
    ANS2=i+1

print(ANS,ANS2)

import collections
import math
import sys
def isPowerOfTwo (x):
    return (x and (not(x & (x - 1))))
def primefactors(n):
	d = collections.defaultdict(int)
	while n%2 == 0:
		d[2]+=1
		n/=2
	for i in range(3, int(n**0.5)+1, 2):
		while n%i==0:
			d[i]+=1
			n/=i
	if n > 2:
		d[n]+=1
	return d
n = int(input())
if n == 1:
	print(1, 0)
	sys.exit()
x = primefactors(n)
y = max(x.values())
z = x.keys()
k = 1
for i in z:
	k*=i
if y == 1:
	print(int(k), 0)
elif isPowerOfTwo(y):
	if len(set(x.values())) == 1:
		print(int(k), int(math.log2(y)))
	else:
		print(int(k), int(math.log2(y)+1))
else:
	print(int(k), math.ceil(math.log2(y))+1)

import math
from collections import Counter
# A function to print all prime factors of
# a given number n
def primeFactors(n):
    l=[]
    # Print the number of two's that divide n
    while n % 2 == 0:
        #print 2,
        l.append(2)
        n = n / 2

    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3,int(math.sqrt(n))+1,2):

        # while i divides n , print i ad divide n
        while n % i== 0:
            #print i,
            l.append(i)
            n = n / i

    # Condition if n is a prime
    # number greater than 2
    if n > 2:
        l.append(n)
    return l

n=input()
if n==1:
    print 1,0
    exit()
l=primeFactors(n)
d=Counter(l)
ans1=1
for i in d.keys():
    ans1*=i
mx=max(d.values())
ans=1
step=0
while ans<mx:
    ans*=2
    step+=1
extra=0
for i in d.keys():
    if d[i]!=ans:
        extra=1
print ans1,step+extra

from functools import reduce

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

	if n == 1:
		print(1, 0)
		return

	fact = dict()
	d = 2
	c = 0
	while n % d == 0:
		c += 1
		n //= d
	if c > 0:
		fact[d] = c

	d = 3
	while n != 1:
		c = 0
		while n % d == 0:
			c += 1
			n //= d
		if c > 0:
			fact[d] = c
		d += 2

	ans = reduce(lambda x,y: x*y, fact.keys())
	maxPow = max(fact.values())

	x = 0
	while maxPow > (1 << x):
		x += 1

	if maxPow == (1 << x) and all([y == maxPow for y in fact.values()]):
		print(ans, x)
		return
	else:
		print(ans, x + 1)
		return

if __name__ == "__main__":
	main()

n = int(input())
if n == 1: print(1, 0); exit()
lis1 = []
lis2 = []
x = int(n**0.5)
for i in range(2, x+1):
    if n%i == 0:
        cnt = 0
        while(n%i == 0):
            cnt += 1
            n//=i
        lis1.append(i)
        lis2.append(cnt)
if n-1: lis1.append(n); lis2.append(1)
su = 1
for i in lis1:
    su *= i
m = max(lis2)
import math
k = int(math.log(m, 2))
if 2**k == m:
    if m == min(lis2): m = k
    else: m = k + 1
else: m = k + 2
print(su, m)

m = 10**6+5
cri = [0]*m
for i in range(2, m):
	if cri[i] == 0:
		cri[i] = i
		for j in range(i*i, m, i):
			cri[j] = i
cri[1] = 1
n = int(input())
a = n
res = []
pp = 1
while a > 1:
	b = cri[a]
	pp *= b
	c = 0
	while a % b == 0 and a > 1:
		a //= b
		c += 1
	res.append(c)
if not res:
	res.append(1)
maxres = max(res)
minres = min(res)
aa = 1
ne = 0
while aa < maxres:
	aa*=2
	ne += 1
ne += 1 if minres < aa else 0
print(pp, ne)

#encoding:utf-8

class Rookie(object):

    def _input(self):
        l1 = raw_input()
        n = int(l1.strip())
        return n

    def _output(self):
        pass

    def solve(self):
        n = self._input()
        count = {}
        maxx = 1
        ans = 1
        ne = 0
        first = True
        for i in range(2,n+1):
            cnt = 0
            while n % i == 0:
                cnt += 1
                n /= i
            if cnt > 0:
                #print i,cnt
                if not first and maxx != cnt:
                    ne = 1
                ans *= i
                maxx = max(cnt,maxx)
                first = False
        ops = 0
        if maxx == 1:
            print ans,0
        else:
            tmp = 1
            while tmp < maxx:
                tmp *= 2
                ops += 1
            #print tmp,maxx
            #print ops
            #print ne
            if maxx == tmp:
                if ne == 1:
                    ops += 1
            elif maxx < tmp:
                ops += 1
            print ans,ops
        #self._output()
if __name__ == '__main__':
    Rookie().solve()

n = int(input())
m = n
d = 2
A = []
if n != 1:
    while d * d <= n:
        if n % d == 0:
            A.append(d)
            n //= d
        else:
            d += 1

    if n > 1:
        A.append(n)

    D = dict()
    p = 1
    for i in range(len(A)):
        if A[i] not in D.keys():
            D[A[i]] = 1
            p *= A[i]
        else:
            D[A[i]] += 1
    s_max = max(D.values())
    k = 1
    for i in range(50):
        if k >= s_max:
            break
        k *= 2

    for q in D.values():
        if q != k:
            i += 1
            break

else:
    p = 1
    i = 0

if p == m:
    i = 0

print(p, i)

import math
n=input()
if n==1:
	print 1, 0
else:
	flag=1
	k=n
	t=0
	while flag:
		c=int(math.sqrt(k))
		if c*c==k:
			k=c
			t+=1
		else:
			flag=0
	res=[]
	vals=[]
	for j in range(2,k+1):
		c=0
		while k%j==0:
			k=k/j
			c+=1
		if c>0:
			res.append(j)
			vals.append(c)
	ma1=max(vals)
	ma=ma1
	et=0
	f2=1
	if ma and not (ma&(ma-1)):
	#	et=1
		f2=0
	else:
		while ma!=0:
			ma=ma/2
			et+=1

	if f2==0:
		while ma>1:
			ma=ma/2
			et+=1

	#print et
	zz=1
	out=1
	f3=0
	for i in vals:
		if i!=ma1:
			zz=0
	for i in res:
		out*=i
#	if ma1!=1:
	yy=et+t+1
	if f2==1 and ma1==1:
		yy-=1
	if f2==0:
		for j in vals:
			if j!=ma1:
				f3=1
				break
		if f3==0:
			yy-=1
	#else:
	#	yy=et+t
	print out,yy

# Python program to print prime factors
import math
def primeFactors(n):
    # Print the number of two's that divide n
    dic = {}
    while n % 2 == 0:
        if 2 in dic:
            dic[2] += 1
        else:
            dic[2] = 1
        n = n / 2
    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3,int(math.sqrt(n))+1,2):
        # while i divides n , print i ad divide n
        while n % i== 0:
            if i in dic:
                dic[i] += 1
            else:
                dic[i] = 1
            n = n / i
    # Condition if n is a prime
    # number greater than 2
    if n > 2:
        if n in dic:
            dic[n] += 1
        else:
            dic[n] = 1
    return dic
n = int(input())
arr = primeFactors(n)
arr2 = []
for key in arr:
    arr2.append(arr[key])
length = len(arr2)
ans = 0
#print("ura")
while True:
    sqrt = True
    if len(arr2) == 0:
        break
    for i in arr2:
        if i%2 == 1:
            sqrt = False
            break
    if sqrt:
        ans += 1
        for i in range(length):
            arr2[i] = arr2[i]/2
    else:
        break
p = 0
start = 1
if len(arr2) ==0:
    a = 1
else:
    a = max(arr2)
for i in range(1000):
    if start<a:
        start *= 2
        p += 1
    else:
        break
plus1 = False
for i in range(length):
    if arr2[i] <start:
        plus1 = True
        break
if plus1:
    ans += p + 1
else:
    ans += p
ans0 = 1
for i in arr:
    ans0 *= i
print(int(ans0),ans)

n=int(input())
def pr(r, k=2):
    while k <= r:
        if r % k:
            k += 1
        else:
            r //= k
            yield k

k=list(pr(n))
p=1
z=0
y=0
q=1000000
for i in range(len(k)):
    g=k.count(k[i])
    if g>=p:
        p=g
    if g<=q:
        q=g
f=p
if q==1000000:
    q=1
while p!=1:
    if p%2!=0:
        p+=1
        y+=1
    else:
        p=p//2
        z+=1
k=set(k)
k=list(k)
s=1
for i in range(len(k)):
    s=s*int(k[i])
if (y!=0)or(q!=f):
    print(s,z+1)
else:
    print(s,z)

import math
n=int(input())
if n==1:
    print(1,0)
else:
    factors=[]
    for i in range(1,round(n**0.5)+2):
        if n%i==0:
            factors+=[i,n//i]
    factors=list(set(factors))
    def isprime(n):
        if n==1:
            return False
        if n<4:
            return(True)
        for i in range(2,round(n**0.5)+2):
            if n%i==0:
                return False
        return True
    primes=[]
    for factor in factors:
        if isprime(factor):
            primes.append(factor)
    exps=[]
    for prime in primes:
        x=prime
        expo=0
        while n%x==0:
            x*=prime
            expo+=1
        exps.append(expo)
    b=max(exps)
    decs=math.ceil(math.log2(b))
    cheat=True
    exp=2**decs
    for guy in exps:
        if guy!=exp:
            cheat=False
            break
    prod=1
    for guy in primes:
        prod*=guy
    if cheat:
        print(prod,decs)
    else:
        print(prod,decs+1)

import math

def primeFactors(n):
    d={}
    while n%2==0:
        if 2 not in d.keys():
            d[2]=1
        else:
            d[2]+=1
        n=n//2
    for i in range(3,int(math.sqrt(n)+1),2):
        while n%i==0:
            if i not in d.keys():
                d[i]=1
            else:
                d[i]+=1
            n=n//i
    if n>2:
        d[n]=1
    return d

def all_one(d):
    for i in d.keys():
        if d[i]!=1:
            return False
    return True

def solve(d):
    maxx=0
    n=1
    for i in d.keys():
        maxx=max(maxx,d[i])
        n=n*i
    flag=1
    curr=-1
    for i in d.keys():
        if curr==-1:
            curr=d[i]
        elif curr!=d[i]:
            flag=0
            break
    if flag==1 and int(math.log(curr,2))==math.log(curr,2):
        count=0
    else:
        count=1
    i=1
    while i<maxx:
        i=i*2
        count+=1
    return n,count

n=int(input())

if n==1:
    print(1,0)
else:
    d=primeFactors(n)
    if all_one(d):
        print(n,0)
    else:
        n,count=solve(d)
        print(n,count)

import math

n = int(input())
ans, anssq, flag = 1, 0, 0
maxsq = 1
tempn = n
for i in range(2, n + 1):
    tempsq = 0
    tempflag = 0
    while tempn % i == 0:
        tempn = tempn // i
        tempsq += 1
        tempflag += 1
    if tempsq > 0:
        ans = ans * i
    if flag == 0 and tempflag != 0:
        flag = tempflag
    elif flag > 0 and tempflag != 0 and tempflag != flag:
        flag = -1
    if tempsq > maxsq:
        maxsq = tempsq
if math.log2(maxsq) == 0.0:
    print(ans, 0)
elif flag == -1:
    print(ans, math.ceil(math.log2(maxsq) + 1))
else:
    if math.ceil(math.log2(maxsq)) == math.log2(maxsq):
        print(ans, math.ceil(math.log2(maxsq)))
    else:
        print(ans, math.ceil(math.log2(maxsq) + 1))

from collections import defaultdict as dif
dic=dif(lambda:0)
x=int(input())
if x==1:
    print(1,0)
    exit(0)

while x%2==0:
    dic[2]+=1
    x//=2

mx=dic[2]

n=3
while n*n<=x:
    while x%n==0:
        dic[n]+=1
        x//=n
    mx=max(mx,dic[n])
    n+=2
if x>1:
    dic[x]=1
    mx=max(1,mx)
from math import log2,ceil
lg =ceil(log2(mx))
mxt=1<<lg
nm=1
stp=0
for n in dic:
    if dic[n]!=mxt and dic[n]:
        stp=1
        break

for n in dic:
    if dic[n]:
        nm*=n

stp+=lg
print(nm,stp)

import math
N=int(input())
if N==1:
    print(1,end=" ")
    print(0)
    exit()
dic={}
while(N!=1):
    z=int(math.sqrt(N))

    for i in range(2,z+1):
        if N%i==0:
            dic[i]=dic.get(i,0)+1
            N=N//i
            break

    else:
        dic[N]=dic.get(N,0)+1
        N=1
output1=1
output2=0
max1=0
count=0

for i in dic:
    output1*=i
    max1=max(max1,dic[i])

if math.log(max1,2)==int(math.log(max1,2)):
    matchwith=max1
    x=math.log(matchwith,2)
else:
    x=math.ceil(math.log(max1,2))
    matchwith=2**x

for i in dic:
    if dic[i]!=matchwith:
        output2+=1
        break
print(output1,end=" ")
print(int(x+output2))

import math

def sieve(n):
    mark = [0]*(n+1)
    prime = []
    for i in range(3, n+1, 2):
        if not mark[i]:
            for j in range(3*i, n+1, i+i):
                mark[j] = 1
    prime.append(2)
    for i in range(3, n+1, 2):
        if not mark[i]:
            prime.append(i)

    return prime

def ispowerof2(x):
    if x and not (x & (x-1)):
        return 0
    else:
        return 1

n = int(input())
h = n
prime = sieve(n)
l = []

countp = 0

ans = 1
for i in prime:
    countp = 0
    if n % i == 0:
        ans *= i
        while n % i == 0:
            n //= i
            countp += 1
        l.append(countp)

    if n == 1:
        break
if h > 1:
    maxp = max(l)
else:
    maxp = 0
flag = 0
for i in l:
    if i != maxp:
        flag = 1

temp = 0

if flag:
    temp = 1
else:
    temp = ispowerof2(maxp)

if maxp == 1:
    maxp -= 1
elif maxp != 0:
    maxp = math.ceil(math.log2(maxp)) + temp

print(ans, maxp)

import math
def is_power(n):
    return bin(n).count('1') == 1

n = int(input())
x = n
i = 2
factors = {}
if n > 1:
    while i  <= int(math.sqrt(x))+1:
        if n % i:
            i += 1
        else:
            n //= i
            if i in factors.keys():
                factors[i] += 1
            else:
                factors[i] = 1

    if n > 1:
        factors[n] = 1
    result = 1
    for x in factors:
        result *= x

    value_max = max(factors.values())
    result_max = 0

    if value_max > min(factors.values()) or not is_power(value_max):
        result_max += 1
    if is_power(value_max):
        result_max += int(math.log2(value_max))
    else:
        result_max += int(math.log2(value_max)) + 1

    print(' '.join([str(result), str(result_max)]))

else:
    print(' '.join(['1', '0']))

def main():
    buf = input()
    n = int(buf)
    op_count = 0
    factor = prime_factorization(n)
    c_max = 1
    first_c = None
    all_same = True
    min_number = 1
    for f, c in factor.items():
        if c > c_max:
            c_max = c
        if first_c == None:
            first_c = c
        elif c != first_c:
            all_same = False
        min_number *= f
    if check_power_of_2(c_max) and all_same:
        pass
    else:
        op_count += 1
    if not check_power_of_2(c_max):
        c_max = c_max << 1
        c_max = c_max & (c_max - 1)
    while c_max > 1:
        c_max //= 2
        op_count += 1
    print(min_number, op_count)

def check_power_of_2(x):
    return (x != 0) and ((x & (x - 1)) == 0)

def prime_factorization(number):
    n = number
    i = 2
    factor = {}
    while i * i <= n:
        while n % i == 0:
            if i in factor:
                factor[i] += 1
            else:
                factor.update({i : 1})
            n //= i
        i += 1
    if n > 1 or not factor:
        if n in factor:
            factor[n] += 1
        else:
            factor.update({n : 1})
    return factor

if __name__ == '__main__':
    main()

n = int(input())

if n == 1:
	print('1 0')
else:
	d = 2
	decomp = []
	while d * d <= n:
		cnt = 0
		while n % d == 0:
			cnt += 1
			n //= d
		if cnt > 0:
			decomp += [(d, cnt)]
		if d == 2:
			d += 1
		else:
			d += 2
	if n > 1:
		decomp += [(n, 1)]

	tar = 1
	maxExp = 0
	for e in decomp:
		tar *= e[0]
		maxExp = max(maxExp, e[1])

	divCnt = 0
	curExp = 1
	while curExp < maxExp:
		divCnt += 1
		curExp *= 2

	mulRequired = False
	for e in decomp:
		if e[1] != curExp:
			mulRequired = True
			break
	if mulRequired:
		divCnt += 1

	print('%s %s' % (tar, divCnt))

n=int(input())
if n==1:
    from sys import exit
    print(1,0);exit()
d,k,mx,result={},2,0,1
while n>1:
    x=1000000000
    for i in range(k,n+1):
        if n%i==0:d[i]=0;x=i;break
    while n%x==0:n=n//x;d[x]+=1
    k=x+1
    result*=x
    mx=max(mx,d[x])
res,item=0,1
while item<mx:
    item*=2
    res+=1
if item==mx:
    ans=0
    for i,x in enumerate(d):
        if d[x]!=mx:break
        ans+=1
    if ans<len(d):res+=1
else:res+=1
print(result,res)

def primfacs(n):
   i = 2
   primfac = []
   while i * i <= n:
       while n % i == 0:
           primfac.append(i)
           n = n / i
       i = i + 1
   if n > 1:
       primfac.append(n)
   return primfac

n = int(input())
l = primfacs(n)
d = {}
t = []
k = 1

while 2**k < 10**9:
    t.append(2**k)
    k = k + 1

for i in range(len(l)):
    if l[i] not in d:
        d[l[i]] = 0

for i in range(len(l)):
    d[l[i]] += 1

smax = 0

for i in d:
    if d[i] > smax:
        smax = d[i]

k = 0
fl = True
for i in d:
    if d[i] != smax:
        k = 1
        fl = False
        break

if smax not in t:
    i = 0
    while smax > t[i]:
        i += 1

    smax = t[i]

    if fl:
        k = k + 1

while smax > 1:
    smax = smax // 2
    k = k + 1

s = 1
for i in d:
    s = s * i
if int(s) == n:
    print(int(s),0)
else:
    print(int(s),k)

from collections import defaultdict
from math import log2, ceil

n = int(input())
if n == 1:
	print(1, 0)
	exit()

d = defaultdict(int)

while n%2 == 0:
	d[2] += 1
	n //= 2

ind = 3
while ind <= int(n**0.5)+1:
	while n%ind == 0:
		d[ind] += 1
		n //= ind
	ind += 2

if n != 1:
	d[n] += 1

# print(d)

ma = -1
ans = 1
arr = []
for x in d:
	ma = max(ma, d[x])
	arr += [d[x]]
	ans *= x

if arr.count(ma) == len(arr) and (2**30)%ma == 0:
	print(ans, ceil(log2(ma)))
else:
	print(ans, 1 + ceil(log2(ma)))

# if arr.count(1) == len(arr):
# 	print(ans, 0)
# elif arr.count(2)

from math import *
primes = [x for x in range(2, 1001) if 0 == len([y for y in range(2,x) if x % y == 0])]

n = input()
if n == 1:
    print("1 0")
    exit(0)

l = []
A = 1
for i in primes:
    cnt = 0
    while n % i == 0:
        cnt+=1
        n/=i
    if cnt > 0:
        A *= i
        l.append(cnt)
if (n > 1):
    A*=n
    l.append(1)

f = 0

for i in l:
    f = max(f, int(ceil(log(i, 2))))

ans = f
if min(l) != 2**f:
    ans+=1

print A, ans

'''input
20
'''
from sys import stdin
import math

def find_prime(n):
	num = n
	prime_factors = [0] * (num + 1)
	while n % 2 == 0:
		prime_factors[2] += 1
		n = n // 2

	for i in range(3,num+1,2):
		while n % i == 0:
			n = n // i
			prime_factors[i] += 1

	return prime_factors, n

def check_prime(number):
	if number > 2:
		return True
	else:
		return False

def check_all_equal(prime_factors):
	i = 2
	equal = 0
	while i < len(prime_factors):
		if prime_factors[i] != 0:
			equal = prime_factors[i]
			break
		i += 1

	while i < len(prime_factors):
		if prime_factors[i] != 0:
			if prime_factors[i] != equal:
				return False
		i += 1
	return True

def find_nearest_2_power(num, steps):
	power = 0
	while  (2 ** power) < num:
		power += 1

	steps += power

	if 2 ** power == num:
		return steps, 0
	else:
		return steps + 1, 1

def print_the_number(prime_factors, steps):
	product = 1
	for i in range(2, len(prime_factors)):
		if prime_factors[i] != 0:
			product = product * i
	print(product, steps)

# main starts
n = int(stdin.readline().strip())
prime_factors, modified = find_prime(n)
if n == 1:
	print(1, 0)

else:
	steps = 0
	if check_all_equal(prime_factors):
		maxfactor = max(prime_factors)
		steps, c = find_nearest_2_power(maxfactor, steps)
		print_the_number(prime_factors, steps)
	else:
		steps += 1
		maxfactor = max(prime_factors)
		steps, c = find_nearest_2_power(maxfactor, steps)
		if c == 1:
			steps -= 1
		print_the_number(prime_factors, steps)

#Afsoos ke bee fayede farsoode shodim       vaz aase sepehre sarnegoon soode shodim
#Darda o nedamata ke ta cheshm zadim         naboode be kame kheesh, naboode shodim
n = int ( input ( ) )
copy=n
q=[]
bas=[]
co=0
while n%2==0:
    n//=2
    co+=1
if co!=0:
    q+=[co]
    bas+=[2]
for i in range ( 3 , n+1 , +2):
    co=0
    while n%i==0:
        n//=i
        co+=1
    if co!=0:
        q+=[co]
        bas+=[i]
x=0
w=1
if copy==1:
    exit(print(copy,0))
for i in bas:
    w*=i
while 2**x<max(q):
    x+=1
if 2**x==max(q):
    if all( i == max(q) for i in q):
        print( w,x)
    else:
        print(w,x+1)
else:
    print(w,x+1)

from math import sqrt,ceil,log
class Solve:
  def __init__(self):
    n = int(input())
    prime = {}
    sq = int(sqrt(n)) + 1
    N, cnt = 1, 0
    for i in range(2,sq):
      if n%i == 0:
        prime[i] = 0
        N *= i
        while n%i == 0:
          n //= i
          prime[i] += 1
    if n > 1:
      prime[n] = 1
      N *= n
    mx, mn = 0, 35
    for data in prime:
      mx = max(mx, prime[data])
      mn = min(mn, prime[data])
    if N == 1:
      cnt = 0
    else:
      cnt = int(ceil(log(mx, 2))) + (0 if mx == mn and mx in [1,2,4,8,16] else 1)
    print(N, cnt)

def main():
  s = Solve()

main()

n = int(input())
primes = {}
for i in range(2, n):
	while n%i == 0:
		n /= i
		if i in primes:
			primes[i] += 1
		else:
			primes[i] = 1
if len(primes) == 0:
	print(n, 0)
	exit(0)
from math import ceil, log2
pow2 = pow(2, ceil(log2(max(primes.values()))))
flag = 0
for i in primes:
	if primes[i] != pow2:
		flag = 1
		break
ans = 1
for i in primes:
	ans*=i
print(ans, int(log2(pow2)) + flag)

from functools import reduce

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

	if n == 1:
		print(1, 0)
		return

	fact = dict()
	d = 2
	c = 0
	while n % d == 0:
		c += 1
		n //= d
	if c > 0:
		fact[d] = c

	d = 3
	while n != 1:
		c = 0
		while n % d == 0:
			c += 1
			n //= d
		if c > 0:
			fact[d] = c
		d += 2

	ans = reduce(lambda x,y: x*y, fact.keys())
	maxPow = max(fact.values())

	x = 0
	while maxPow > (1 << x):
		x += 1

	if maxPow == (1 << x) and all([y == maxPow for y in fact.values()]):
		print(ans, x)
		return
	else:
		print(ans, x + 1)
		return

if __name__ == "__main__":
	main()

#int(input())
#map(int,input().split())
#[list(map(int,input().split())) for i in range(q)]
#print("YES" * ans + "NO" * (1-ans))
n = int(input())
n2 = n
flag = 0
i = 0
ans = 1
flag2= 0
ans2 = 0
for i in range(2,int(n**0.5)+1):
    if n % i == 0:
        ans *= i
    num = 0
    while n % i == 0:
        n //= i
        num += 1
    num2 = 0
    num3 = bin(num)[3:]
    flag = 0
    for j in num3:
        if j == "1":
            flag = 1
            break
    if flag == 1 or num == 1:
        num2 = len(num3) + 1
        flag2 = 1
    else:
        num2 = len(num3)
    if num2 != ans2 and ans2 != 0 and num2 != 0:
        flag2 = 1
    ans2 = max(ans2,num2)
    if n < i:
        break
num3 = ans * n
if num3 == n2:
    print(num3,0)
else:
    if n!=1:
        num2 = 2
        flag2 = 1
    else:
        num2 = 1
    print(num3,max(ans2+flag2,num2))

def primfacs(n):
   i = 2
   primfac = []
   arr = [0] * int(n)
   D = dict()
   while i * i <= n:
      while n % i == 0:
         if int(i) in D.keys():
            D[int(i)] += 1
         else:
            D[int(i)] = 1
         n = n / i
      i = i + 1
   if n > 1:
      if n in D.keys():
         D[n] += 1
      else:
         D[n] = 1
   return D

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

   go = 1
   op = 0
   res = 0

   D = primfacs(n)
   if n == 1:
      print('1', '0')
   else:
      while (n ** (1 / 2)) % 1 == 0:
         op += 1
         n = n ** (1 / 2)
      st = 0

      D = primfacs(n)
      for i in range(0, 25):
         ok = 1
         for el in D.keys():
            if not D[el] <= 2 ** i:
               ok = 0
         if ok == 1:
            st = i
            break

      op += st
      if st != 0:
         op += 1
      n = 1

      for el in D.keys():
         n *= el
      print(int(n), op)
main()

n=int(input())
ans=1
temp=n
ans=1
c=0
for i in range(2,n+1):
    if(n%i==0):
        ans*=i
        while(n%i==0):
            n/=i
ans2=ans
while(ans%temp>0):
    ans*=ans
    c+=1
if ans>temp:
    c+=1
print(ans2,c)

from __future__ import division
from sys import stdin, stdout
from collections import defaultdict
from math import log, floor, ceil

def sieveOfEratosthenes(n):
    """sieveOfEratosthenes(n): return the list of the primes < n."""
    # Code from: <dickinsm@gmail.com>, Nov 30 2006
    # http://groups.google.com/group/comp.lang.python/msg/f1f10ced88c68c2d
    if n <= 2:
        return []
    sieve = range(3, n, 2)
    top = len(sieve)
    for si in sieve:
        if si:
            bottom = (si * si - 3) // 2
            if bottom >= top:
                break
            sieve[bottom::si] = [0] * -((bottom - top) // si)
    return [2] + [el for el in sieve if el]

primes = sieveOfEratosthenes(1002)

def factors(x):
    out = defaultdict(int)

    while True:
        for prime in primes:
            if x % prime == 0:
                out[prime] += 1
                x //= prime
                break
        else:
            if x != 1:
                out[x] += 1
            return out

def write(x):
    stdout.write(str(x) + "\n")

def number(x):
    if x == 1:
        return 0, False
    l = int(log(x, 2))
    if 2 ** l == x:
        return l, False
    return int(ceil(log(x, 2))), True

def alleq(l):
    l = list(l)
    f = l[0]
    for i in range(1, len(l)):
        if l[i] != f:
            return False
    return True

n = int(stdin.readline())
if n == 1:
    write("1 0")
    exit()
fac = factors(n)
r1 = 1
r2 = 0

hh = False
for k, v in fac.iteritems():
    r1 *= k
    nn, harb = number(v)
    if nn > r2:
        r2 = max(r2, nn)
        hh = harb

if hh:
    r2 += 1
elif not alleq(fac.itervalues()):
    r2 += 1

write(str(r1) + " " + str(r2))

n=int(input())
x=n
k=2
num=1
m1=1
m2=100
while k*k<=x:
	count=0
	while x%k==0:
		count+=1
		x//=k
	if count>0:
		num*=k
		m1=max(m1,count)
		m2=min(m2,count)
	k+=1
if x>1:
	num*=x
	m2=1

s=bin(m1)[2:]
a= 1 if s.count('1')==1 else -1
b=0
if a==1 and m1!=m2:
	b=1
c=len(s)
m=c-a+b
if n==1:
	m=0
print(num,m)

import sys
import math

def starting(N):
    a = []
    b = {}
    ans_one = 1
    ans_two = 0
    d = -1

    for i in range(2,N):
        if N%i:
                continue
        c = 0
        while not (N%i):
                c += 1
                N /= i

        if c&-c != c:
            ans_two = 1
        elif d != -1 and c != d:
            ans_two = 1

        if d < c:
            d = c
        ans_one *= i

    if N > 1:
        ans_one *= N
        if d != 1 and d != -1:
            ans_two = 1

    i = 1
    while i < d:
        ans_two += 1
        i *= 2

    print ans_one, ans_two

n=int(input())

if n == 1:
        print 1,0
else:
        starting(n)

from math import log2, sqrt

def main():
    n = int(input())
    d = {}
    cur = n
    for i in range(2, int(sqrt(n)) + 2):
        while cur % i == 0:
            t = d.get(i, 0) + 1
            d[i] = t
            cur //= i
    if cur != 1:
        d[cur] = 1
    if d == {} or max(d.values()) == 1:
        return print(n, 0)
    cur = []
    action = False
    for k in d:
        q = log2(d[k])
        if q - int(q) != 0 or q == 0:
            if not action:
                action = True
            cur.append(int(q) + 1)
        else:
            cur.append(int(q))
    ans_2 = max(cur)
    if action or len(set(cur)) != 1:
        ans_2 += 1
    ans_1 = 1
    for k in d:
        ans_1 *= k
    return print(ans_1, ans_2)

if __name__=="__main__":
    main()

#_________________ Mukul Mohan Varshney _______________#

#Template
import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt,floor,factorial,gcd,log,ceil
from collections import deque,Counter,defaultdict
from itertools import permutations, combinations
import itertools

#define function
def Int(): return int(sys.stdin.readline())
def Mint(): return map(int,sys.stdin.readline().split())
def Lstr(): return list(sys.stdin.readline().strip())
def Str(): return sys.stdin.readline().strip()
def Mstr(): return map(str,sys.stdin.readline().strip().split())
def List(): return list(map(int,sys.stdin.readline().split()))
def Hash(): return dict()
def Mod(): return 1000000007
def Ncr(n,r,p): return ((fact[n])*((ifact[r]*ifact[n-r])%p))%p
def Most_frequent(list): return max(set(list), key = list.count)
def Mat2x2(n): return [List() for _ in range(n)]
def Lcm(x,y):  return (x*y)//gcd(x,y)
def dtob(n): return bin(n).replace("0b","")
def btod(n): return int(n,2)
def common(l1, l2):
    return set(l1).intersection(l2)

# Driver Code
def solution():
     #for i in range(Int()):
          n=Int()
          s=0
          c=0
          while(int(n**0.5)==n**0.5 and n>1):
               n=n**0.5
               s+=1
          for i in range(int(n**0.5),1,-1):
               while(n%(i*i)==0):
                    n=n//i
                    s+=1
                    c=1
          print(int(n),s+c)

#Call the solve function
if __name__ == "__main__":
     solution()

import sys
from math import sqrt, log, ceil
input_file = sys.stdin

n = int(input_file.readline())

def factor(n):
    lst = []
    prod = 1
    for i in range(2, n+1):
        if n % i == 0:
            prod *= i
            lst.append(0)
            while n % i == 0:
                lst[-1] += 1
                n /= i
        if n < i:
            break
    return lst, prod

if n == 1:
    print(1, 0)
else:
    lst, ans = factor(n)
    maxi, mini = max(lst), min(lst)
    if maxi == mini and log(maxi, 2) == int(log(maxi, 2)):
        print(ans, int(log(maxi, 2)))
    else:
        print(ans, int(ceil(log(maxi, 2)) + 1))

from math import log, ceil
d = {}
n = int(input())
if n == 1:
    print('1 0')
    exit(0)
i = 2
while True:
    if i > n:
        break
    if n % i == 0:
        if i in d:
            d[i] += 1
        else:
            d[i] = 1
        n //= i
    else:
        i += 1

maxpow = max(d.values())
minpow = min(d.values())
ans = int(ceil(log(maxpow, 2)))
if maxpow & (maxpow - 1) != 0:
    ans += 1
elif minpow != maxpow:
    ans += 1
value = 1
for i in d.keys():
    value *= i
print(value, ans)

from fractions import gcd
from operator import __mul__

def factor(n):
    res = []
    p = 2
    while p * p <= n:
        if n % p == 0:
            a = 0
            while n % p == 0:
                a += 1
                n /= p

            res.append((p, a))

        p += 1

    if n > 1:
        res.append((n, 1))

    return dict(res)

n = int(raw_input())

import sys
if n == 1:
    print "1 0"
    sys.exit()

F = factor(n)
m = max(F.values())
p2 = 1
lp2 = 0
while p2 < m:
    p2 = p2 * 2
    lp2 += 1

moves = lp2 + (1 if any(e < p2 for e in F.values()) else 0)

print reduce(__mul__, F.keys(), 1), moves

from sys import stdin
n=int(stdin.readline().strip())
if n==1:
    print(1,0)
    exit(0)
ans=0
aux=n**0.5
while aux==int(aux):
    n=aux
    ans+=1
    aux=n**0.5
n=int(n)
sieve=[]
vis=[False for i in range(n+1)]
for i in range(2,n+1):
    if not vis[i]:
        sieve.append(i)
        for j in range(i,n+1,i):
            vis[j]=True
arr=[]
y=1
n1=n
for i in sieve:
    if n%i==0:
        x=0
        while n%i==0:
            n//=i
            x+=1
        y*=i
n=n1
x=y
while y%n!=0:
    y*=y
    ans+=1
if y!=n:
    ans+=1
print(x,ans)

def prime_factors(a):
	if a==1:
		return(1,0)
	factors={}
	i=2
	orig=a
	while i <= (int(orig**0.5)+1):
		while a%i==0:
			a=a//i
			if i in factors:
				factors[i]+=1
			else:
				factors[i]=1
		i+=1
	if a>1:
		factors[a]=1
	#print(factors)
	if sorted(factors)[-1]==orig:
		return(N,0)
	multiple=1
	for i in factors:
		multiple*=i
	if orig==multiple**2:
		return(int(orig**0.5),1)
	elif orig==multiple:
		return (orig,0)
	something=sorted([factors[i] for i in factors])
	counter=0
	#print(something[-1])
	while 2**(counter)<something[-1]:
		counter+=1
	if all([x==something[0] for x in something]) and something[0]&(something[0]-1)==0:
		return multiple,counter
	return multiple,counter+1

N=int(input())
print(*prime_factors(N))

# -*- coding: utf-8 -*-
"""
Created on Sat Jun  8 10:08:27 2019

@author: plosi
"""
import math

def issame(arr,m):
    for i in range(len(arr)):
        if arr[i]!=m:
            return False
    return True

def ispower(m):
    if m%2==0:
        m=int(m/2)
        while m%2==0:
            m=m/2
        if m!=1:
            return False
        else:
            return True
    return False

def SOE(n):
    p=2
    global ps
    primes=[True for i in range(n+1)]
    primes[0]=False
    primes[1]=False
    while p<=n**(0.5):
        cur=p
        cur=cur+p
        while cur<=n:

            primes[cur]=False
            cur=cur+p
        p=p+1
        while not primes[p]:
            p=p+1
    ps=[i for i in range(len(primes)) if primes[i]]
    global pset
    pset=set(ps)

def fact(n):
    val=ps[0]
    bs=[]
    fs=[]
    ct=0
    if n in pset:
        return (n,0)

    while n>1:
        if n%val==0:
            a=1
            n=int(n/val)
            bs.append(val)
            while n%val==0:
                n=n/val
                a=a+1
            fs.append(a)
        ct=ct+1
        val=ps[ct]
    m=max(fs)
    p=1
    for val in bs:
        p=p*val
    if m==1:
        return (p,0)

    if issame(fs,m):
        if ispower(m):
            num=int(math.log2(m))
        else:
            num=int(math.log2(m))+1
            num=num+1
    else:
        if ispower(m):
            num=int(math.log2(m))
        else:
            num=int(math.log2(m))+1
        num=num+1

    return (p,num)

def main():
    n=int(input())
    if n==1:
        print(str(1)+" "+str(0))
        return None
    SOE(n)
    p,ct=fact(n)
    print(str(p)+" "+str(ct))
main()

import sys
from math import sqrt, gcd, ceil, log
from bisect import bisect
from collections import defaultdict
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

# sys.setrecursionlimit(10**6)

def solve():
	n = int(inp());
	if n == 1:print(1, 0);exit()
	arr = []; m_c = 1
	sett = set()
	for i in range(2, int(sqrt(n)+1)):
		c = 0
		if n%i == 0:
			arr.append(i)
			while n%i == 0:
				c += 1
				n //= i
			sett.add(c)
		m_c = max(m_c, c)
	if n > 1:
		arr.append(n)
		sett.add(1)

	# print(m_c, sett, arr)
	m_c = ceil(log(m_c, 2))
	if len(sett) == 1 and 2**m_c in sett:
		ans = 1
		for i in arr: ans *= i
		print(ans, m_c)
	else:
		ans = 1
		for i in arr: ans *= i
		print(ans, m_c+1)

if __name__ == "__main__":
	solve()

n = int(input())
if n == 1: print(1, 0); exit()
lis = []
x = int(n**0.5)
for i in range(2, x+1):
    if n%i == 0:
        cnt = 0
        while(n%i == 0):
            cnt += 1
            n//=i
        lis.append([i, cnt])
if n-1: lis.append([n, 1])
su = 1
for i in lis:
    su *= i[0]
m = max([i[1] for i in lis])
import math
if 2**int(math.log(m, 2)) == m:
    if m == min([i[1] for i in lis]): m = int(math.log(m, 2))
    else: m = int(math.log(m, 2)) + 1
else: m = int(math.log(m, 2)) + 2

print(su, m)

import math

def myf(n):
	if n==1:
		return [(1,1)]
	a = list()
	for i in range(2,n+1):
		if n%i == 0:
			count = 0
			while n%i == 0:
				n /= i
				count += 1
			a.append((i,count))
	return a

n = int(input())

s = -1
x = myf(n)
h = True

#print(x)
for i in range(1,len(x)):
	if x[i][1] != x[i-1][1]:
		h = False

if h:
	if x[0][1] & (x[0][1]-1) == 0:
		s = math.log2(x[0][1])
	else:
		mym = x[0][1]
		if mym & (mym-1) != 0:
			s = 0
		while mym != 0:
			mym = mym >> 1
			s +=1
		s +=1
else:
	mym = x[0][1]
	for each in x:
		if each[1]>mym:
			mym = each[1]
	if mym & (mym-1) != 0:
		s = 0

	while mym != 0:
		mym = mym >> 1
		s +=1
	s += 1

v = 1
for each in x:
	v *= each[0]
print(v,int(s),sep=" ")

def smol(n):
    prod = 1
    orig = n
    d = 2
    while d*d <= orig and n>1:
        if n%d == 0:
            prod *= d
            while n % d == 0:
                n //=d
        d += 1
    if n > 1:
        prod *= n
    return prod
num = int(input())
small = smol(num)
ans = 0
while small%num > 0:
    small *= small
    ans += 1
if small != num:
    ans += 1
print(smol(num),ans)

import math
N=int(input())
if N==1:
    print(1,end=" ")
    print(0)
    exit()
dic={}
while(N!=1):
    z=int(math.sqrt(N))

    for i in range(2,z+1):
        if N%i==0:
            dic[i]=dic.get(i,0)+1
            N=N//i
            break

    else:
        dic[N]=dic.get(N,0)+1
        N=1
output1=1
output2=0
max1=0
count=0

for i in dic:
    output1*=i
    max1=max(max1,dic[i])

if math.log(max1,2)==int(math.log(max1,2)):
    matchwith=max1
    x=math.log(matchwith,2)
else:
    x=math.ceil(math.log(max1,2))
    matchwith=2**x

for i in dic:
    if dic[i]!=matchwith:
        output2+=1
        break
print(output1,end=" ")
print(int(x+output2))

n=int(input())
from  math import sqrt as S
from math import log as log,ceil as upar
d={}
c=0
for i in range(2,int(S(n))+1):
    if n%i==0:
        while n%i==0:
            c+=1
            n=n//i
        d[i]=c
        c=0
if n>1:
    d[n]=1
ans=1
for i in d.keys():
    ans*=i
print(ans,end=' ')

father_pow=0
for i in d.keys():
    u=upar(log(d[i])/log(2))
   # print(u)
    father_pow=max(father_pow,u)
#print(father_pow)
if(all(d[i]==2**father_pow for i in d.keys())):
    print(father_pow)
else:
    print(father_pow+1)

import math
n=input()
if n==1:
	print 1, 0
else:
	flag=1
	k=n
	t=0
	while flag:
		c=int(math.sqrt(k))
		if c*c==k:
			k=c
			t+=1
		else:
			flag=0
	res=[]
	vals=[]
	for j in range(2,k+1):
		c=0
		while k%j==0:
			k=k/j
			c+=1
		if c>0:
			res.append(j)
			vals.append(c)
	ma1=max(vals)
	ma=ma1
	et=0
	f2=1
	if ma and not (ma&(ma-1)):
	#	et=1
		f2=0
	else:
		while ma!=0:
			ma=ma/2
			et+=1

	if f2==0:
		while ma>1:
			ma=ma/2
			et+=1

	#print et
	zz=1
	out=1
	f3=0
	for i in vals:
		if i!=ma1:
			zz=0
	for i in res:
		out*=i
#	if ma1!=1:
	yy=et+t+1
	if f2==1 and ma1==1:
		yy-=1
	if f2==0:
		for j in vals:
			if j!=ma1:
				f3=1
				break
		if f3==0:
			yy-=1
	#else:
	#	yy=et+t
	print out,yy

import math
import collections
n = int(input())
if n==1:
    print(1,end=" ")
    print(0)
else:

    l=collections.defaultdict(lambda :0)
    while n%2==0:
        l[2]+=1

        n//=2
    for i in range(3,int(math.sqrt(n))+1,2):
        while n%i==0:
            l[i]+=1
            n//=i
    if n>2:
        l[n]+=1
    d=max(l.values())
    num=1
    for t in set(l.keys()):
        num*=t
    ans=0
    flag=False
    while d!=1:
        if d%2==0:
            ans+=1
            d//=2
        else:
            d+=1
            flag=True

    if len(set(l.values()))>1 or flag:
        ans+=1
    print(num,end=" ")
    print(ans)

from math import log, ceil

def factor1(n):
    num = 2
    res = set()
    while num ** 2 <= n:
        while n % num == 0:
            res.add(num)
            n = n // num
        num += 1
    if n > 1:
        res.add(n)
    ans = 1
    for x in res:
        ans *= x
    return ans

def factor(n):
    num = 2
    res = dict()
    while num ** 2 <= n:
        while n % num == 0:
            res[num] = res.get(num, 0) + 1
            n = n // num
        num += 1
    if n > 1:
        res[n] = res.get(n, 0) + 1
    return res

n = int(input())
min_ = factor1(n)
kek = sorted(factor(n).values())
if min_ == n:
    print(n, 0)
elif kek[0] == kek[-1] and log(kek[-1], 2) // 1 == log(kek[-1], 2):
    print(min_, int(log(kek[-1], 2)))
else:
    print(min_, ceil(log(kek[-1], 2)) + 1)

n = int(raw_input())
i = 2
tn = n
fj_dict = dict()
if n == 1:
    print 1, 0
else:
    while i * i <= tn:
        while tn % i == 0:
            fj_dict[i] = fj_dict.get(i, 0) + 1
            tn = tn / i
        i += 1
    if tn != 1:
        fj_dict[tn] = 1
    ans = 1
    for i in fj_dict.keys():
        ans *= i
    maxv = max(fj_dict.values())
    minv = min(fj_dict.values())
    i = 1
    cnt = 0
    while i < maxv:
        i *= 2
        cnt += 1
    if i > maxv or maxv != minv:
        cnt += 1

    print ans, cnt

from math import log, ceil
n = int(input())
if n == 1:
    print(1, 0)
    exit()

f = {}
i = 2
while i <= n:
    if n%i == 0:
        f[i] = 0
        while n%i == 0:
            n = n//i
            f[i] += 1
    i += 1
ans = 1
for fi in f:
    ans = ans*fi
pow2 = {1<<i for i in range(1, 21)}

fvalues = set(f.values())

if fvalues == {1}:
    print(ans, 0)
elif len(fvalues) == 1:
    v = fvalues.pop()
    if v in pow2:
        print(ans, ceil(log(v, 2)))
    else:
        print(ans, ceil(log(v, 2))+1)
else:
    v = max(fvalues)
    print(ans, ceil(log(v, 2))+1)

from sys import stdin, stdout
from math import sin, tan, cos, pi, atan2, sqrt, acos, atan, factorial

n = int(stdin.readline())
mp = {}

d = 2
while d * d <= n:
    while n % d == 0:

        if d not in mp:
            mp[d] = 1
        else:
            mp[d] += 1

        n //= d

    d += 1

if n != 1:
    mp[n] = 1

ans = 1
cnt = 1
s = set()

for v in mp:
    ans *= v
    cnt = max(cnt, mp[v])
    s.add(mp[v])

for i in range(20):
    if (1 << i) == cnt and len(s) <= 1:
        stdout.write(str(ans) + ' ' + str(i) + '\n')
        break

    if (1 << i) >= cnt:
        stdout.write(str(ans) + ' ' + str(1 + i) + '\n')
        break

n=input()
c={}
d=2
while d*d<=n:
  while 0==n%d:
    c[d]=c.get(d,0)+1
    n/=d
  d+=1
if n>1:
  c[n]=1
p=max(c.values()+[1])
x,y=1,0
while x<p:
  x*=2
  y+=1
s=0
t=1
for k,v in c.iteritems():
  t*=k
  if v!=x:
    s=1
s+=y
print t,s

import sys
import math

def starting(N):
    a = []
    b = {}
    ans_one = 1
    ans_two = 0
    d = -1

    for i in range(2,N):
        if N%i:
                continue
        c = 0
        while not (N%i):
                c += 1
                N /= i

        if c&-c != c:
            ans_two = 1
        elif d != -1 and c != d:
            ans_two = 1

        if d < c:
            d = c
        ans_one *= i

    if N > 1:
        ans_one *= N
        if d != 1 and d != -1:
            ans_two = 1

    i = 1
    while i < d:
        ans_two += 1
        i *= 2

    print ans_one, ans_two

n=int(input())

if n == 1:
        print 1,0
else:
        starting(n)

import math

n = int(input())
N = n
frq = list()
for i in range(n+1):
    if(i == 1) : frq.append(1)
    frq.append(0)
while(n > 1):
    for i in range(2, n+1):
        if(n % i == 0):
            frq[i] += 1
            n //= i
            break
maxfrq = 0
sqfree = 1
parity = False
for i in range(N+1):
    if(frq[i]>0):
        sqfree *= i
    maxfrq = max(maxfrq, frq[i])
if(int(math.log2(maxfrq)) != math.log2(maxfrq)):
    parity = True
for i in range(2, N+1):
    if(frq[i] > 0 and frq[i] != maxfrq):
        parity = True
        break
nextbit = 1
while(nextbit < maxfrq) : nextbit *= 2
if(parity == False) : nextbit /= 2
print(sqfree, int(math.log2(nextbit)) + 1)

import math
def primfacs(n):
   i = 2
   primfac = []
   while i * i <= n:
       while n % i == 0:
           primfac.append(i)
           n = n / i
       i = i + 1
   if n > 1:
       primfac.append(n)
   return primfac

n = int(input())
l = primfacs(n)

s = 1
smax = 1
t = []
for i in range(1,len(l)):
    if l[i] not in t:
        t.append(l[i])
    if l[i] == l[i-1]:
        s = s + 1
        smax = max(s,smax)
    else:
        s = 1

k = 0
while smax > 1:
    if smax % 2 == 0:
        smax = smax // 2
    else:
        smax = smax + 1

    k = k + 1

s = 1
for i in range(len(t)):
    s = s * t[i]
print(s,k)

n=int(input())
sl_vhoshd={}
temp=1
if n==1:
   print(1,0)
   exit()
def factor(n):
   rasl = []
   d = 2
   while d * d <= n:
       if n % d == 0:
           rasl.append(d)
           n //= d
       else:
           d += 1
   if n > 1:
       rasl.append(n)
   return (rasl)
def sled_st_dv(n):
    temp=0
    while pow(2,temp)<n:
        temp+=1
    return(temp)
def proisv(mas):
    t=1
    for i in mas:
        t*=i
    return (t)
def proverka(sl_vh,n):
    temp = 0
    for i in sl_vh.values():
     while pow(2, temp) < i:
        temp += 1
     if i != pow(2, temp):
        return (0)
    return(-1)
fact=factor(n)
sett=set(fact)
for i in fact:
    if i in sl_vhoshd:
      sl_vhoshd[i]+=1
    else:
      sl_vhoshd[i]=1
#print(sl_vhoshd)
#print(proverka(sl_vhoshd,n))
temp+=sled_st_dv(max(sl_vhoshd.values()))+proverka(sl_vhoshd,n)
#print(len(set(sl_vhoshd.values())))
#if len(set(sl_vhoshd.values()))>1:
print(proisv(sett),temp)

import math
# https://codeforces.com/problemset/problem/1062/B
def B1062(n):
    dictionary = dict()
    value = 1
    while (n % 2 == 0):
        dictionary[2] = 1 + dictionary.get(2, 0)
        n = n/2
        value = 2

    for prime in range(3, int(math.sqrt(n))+1, 2):
        found_prime = False
        while n % prime == 0:
            dictionary[prime] = dictionary.get(prime, 0)  + 1
            n = n/prime
            if not found_prime:
                value *= prime
                found_prime = True

    if (n>2):
        dictionary[n] = dictionary.get(n, 0) + 1
        value *= n

    steps  = 0

    max_power = max(dictionary.values())
    math_log = math.log(max_power, 2)

    if max_power == 1:

        print(n, 0)
        return

    if max_power == 2:
        steps = 2
    elif all(list(map(lambda x: int(math.log(x, 2)) * 2   == x, dictionary.values()))):
        steps = int(math_log)
    else:
        if int(math_log) == math_log: # max power is squared
            # we add one for the "squaredfication"
            steps =  int(math_log)  +1
        else:
            steps = int(math_log) + 1  + 1

    #print(value, steps)
    print(" ".join([str(int(value)), str(steps)]))

B1062(int(input()))

N = int(input())
num = 0
while int(N ** 0.5) ** 2 == N:
    num += 1
    N = int(N ** 0.5)
M = 10 ** 3 + 5
pr = {}
K = N
for i in range(2, M):
    tmp = 0
    while K % i == 0:
        K //= i
        tmp += 1
    if tmp >= 1:
        pr[i] = tmp

while True:
    pr = {}
    K = N
    for i in range(2, M):
        tmp = 0
        while K % i == 0:
            K //= i
            tmp += 1
        if tmp >= 1:
            pr[i] = tmp

    tmp0 = 0
    for k, v in pr.items():
        if v % 2 != 0:
            pr[k] += 1
            tmp0 += 1

    rec = 1
    for k, v in pr.items():
        rec *= k ** (v // 2)

    if N <= rec:
        rec = N
        break
    N = rec
    num += tmp0

print(rec, num + 1)

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,itertools,operator,bisect,fractions,statistics
from collections import deque,defaultdict,OrderedDict,Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout

def main():
    starttime=datetime.datetime.now()
    if(os.path.exists('input.txt')):
        sys.stdin = open("input.txt","r")
        sys.stdout = open("output.txt","w")

    def is_square(x):
        return x**.5 % 1 == 0
    def check(n):
        f=[]
        for j in range(0,1000002):
            i=j*j
            if i>=n and (i-n)%n==0:
                f.append(i)
        return f
    for _ in range(1):
        n=ri()
        op=[]
        f=check(n)
        mi=999999999999999999999999999
        for i in f:
            o=0
            k=i
            while True:
                if is_square(k):
                    k=int(math.sqrt(k))
                    o+=1
                else:
                    break
            op.append([k,o,i])
        ans,operation,p=min(op)
        if p!=n:
            operation+=1
        print(ans,operation)

    #<--Solving Area Ends
    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

if __name__ == '__main__':
    sys.stdin = FastStdin()
    sys.stdout = FastStdout()
    main()

__author__ = 'tanunia'

from sys import stdin
import math

n = int(stdin.readline())
nums = {}

end = int(math.sqrt(n))
total_n = n
for i in range(2, end):
    while total_n % i == 0:
        if i not in nums:
            nums[i] = 0
        nums[i] += 1
        total_n /= i
if total_n > 1:
    nums[total_n] = 1

#print(nums)
max_pow = 0
ans1 = 1
for k in nums.keys():
    ans1 *= k
    if nums[k] > max_pow:
        max_pow = nums[k]

pow2 = 1
cnt = 0
while pow2 < max_pow:
    pow2 *= 2
    cnt += 1

print(str(int(ans1)) + " " + str(cnt + 1))

# print(2**6*3**4)
# print(256**0.5)
from math import log
from math import ceil, floor

def next_power_of_two(maxi):

    if floor(log(maxi,2)) == ceil(log(maxi, 2)) and maxi != 1:
        power = 0
        while maxi > 1:
            maxi //= 2
            power += 1
        return power

    base = 2
    exp = 1
    while base ** exp < maxi:
        # print(base**exp)
        exp += 1
    return exp

from collections import defaultdict
n = int(input())

sieve = [True] * (n+1)
sieve[0] = False
sieve[1] = False
for i in range(2,int(n**0.5+1)):
    if sieve[i]:
        for j in range(i+i,n+1,i):
            sieve[j] = False

number = 1
temp = n
factors = defaultdict()
div = 2
if n == 1:
    print(1,0)
    exit(0)
while temp > 1:
    # print(temp)
    if temp % div != 0:
        div += 1
        continue
    temp //= div
    if div not in factors:
        factors[div] = 1
    else:
        factors[div] += 1
# print(factors)
ops = 0

if len(factors) == 1:
    for k, v in factors.items():
        if k == n:
            print(k,0)
        else:
            power = 2**next_power_of_two(v)
            if v != power:
                ops += 1
            # print(power)
            while power > 1:
                power //= 2
                ops += 1
            print(k, ops)
    exit(0)

maxi = -1
for k,v in factors.items():
    number *= k
    maxi = max(maxi, v)
# print(factors)
# print(maxi)
# for k,v in factors.items():
#     if v != maxi:
#         ops += 1
#         break
# print(ops)
if maxi == 1:
    print(number, 0)
else:
    # print(maxi)
    # print(ops)
    power = 2**next_power_of_two(maxi)
    # print(power)
    if maxi != power:
        ops += 1
    else:
        for k, v in factors.items():
            if v != maxi:
                ops += 1
                break
    while power > 1:
        power //= 2
        ops += 1

print(number, ops)

# 8 4 2 1

#!/usr/bin/env python3
import sys

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

def find_div(n):
    i = 2
    divs = dict()

    while i * i <= n:
        cnt = 0
        while n % i == 0:
            cnt += 1
            n //= i
        if cnt:
            divs[i] = cnt
        i += 1

    if n != 1:
        divs[n] = 1

    return divs

n = int(input())
if n == 1:
    print(1, 0)
    exit()

div_dict = find_div(n)
max_cnt = 0
ans = 1
check_mul = 0
for i in div_dict:
    max_cnt = max(max_cnt, div_dict[i])
    if max_cnt != div_dict[i]:
        check_mul = 1
    ans *= i
if bin(max_cnt).count("1") != 1:
    check_mul = 1

root_cnt = max_cnt.bit_length()
if bin(max_cnt).count("1") == 1:
    root_cnt -= 1

print(ans, root_cnt + check_mul)

n=int(input())
k=n
s=dict()
for p in range(2,int(n**0.5)+1):
    while(n%p==0):
        if p not in s:
            s.update({p:1})
        else:
            s[p]+=1
        n//=p
if n>1:
    s.update({n:1})
sm=1
for j in s:
    sm*=j
m=max(s.values())
p=1
e=0
while(p<m):
    p*=2
    e+=1
if p==m:
    e-=1
print(sm,e+1)

import sys, math, os
input = sys.stdin.readline

n = int(input())

factors = []

while not n % 2:
  n /= 2
  factors.append(2)
for x in range(3, int(n ** 0.5) + 1, 2):
  while not n % x:
    factors.append(x)
    n /= x
if n > 2:
  factors.append(n)

ans = 0
m = (0, 0)
counts = {}
for f in set(factors):
  counts[f] = factors.count(f)
  if counts[f] > m[0]:
    m = (counts[f], f)

try:
  ans += math.ceil(math.log(m[0], 2))
except:
  ans = 0
l = False
for f in set(factors):
  if counts[f] != m[0]:
    ans += 1
    l = True
if not l and len(set(factors)) > 1:
  ans += 1
# print factors
if not factors:
  factors = [0]
print reduce(lambda x, y: x * y, list(set(factors))), int(ans)

from sys import stdin, stdout
from math import sin, tan, cos, pi, atan2, sqrt, acos, atan, factorial

n = int(stdin.readline())
mp = {}

d = 2
while d * d <= n:
    while n % d == 0:

        if d not in mp:
            mp[d] = 1
        else:
            mp[d] += 1

        n //= d

    d += 1

if n != 1:
    mp[n] = 1

ans = 1
cnt = 0
s = set()

for v in mp:
    ans *= v
    cnt = max(cnt, mp[v])
    s.add(mp[v])

if len(s) > 1:
    label = 1
else:
    label = 0

for i in range(20):
    if (1 << i) >= cnt:
        stdout.write(str(ans) + ' ' + str(label + i) + '\n')
        break

# print(2**6*3**4)
# print(256**0.5)

def next_power_of_two(maxi):

    base = 2
    exp = 1
    while base ** exp < maxi:
        exp += 1
    # print(exp)
    return exp+1

from collections import defaultdict
n = int(input())

sieve = [True] * (n+1)
sieve[0] = False
sieve[1] = False
for i in range(2,int(n**0.5+1)):
    if sieve[i]:
        for j in range(i+i,n+1,i):
            sieve[j] = False

number = 1
temp = n
factors = defaultdict()
div = 2
if n == 1:
    print(1,0)
    exit(0)
while temp > 1:
    # print(temp)
    if temp % div != 0:
        div += 1
        continue
    temp //= div
    if div not in factors:
        factors[div] = 1
    else:
        factors[div] += 1
# print(factors)
ops = 0
if len(factors) == 1:
    for k, v in factors.items():
        if k == n:
            print(k,0)
        else:
            temp = v
            while v > 1:
                ops += 1
                v //= 2
            if temp % 2 == 1:
                ops += 1
            print(k,ops)
    exit(0)

maxi = -1
for k,v in factors.items():
    number *= k
    maxi = max(maxi, v)
# print(factors)
if maxi == 1:
    print(number, 0)
else:
    # print(maxi)

    power = 2**next_power_of_two(maxi)

    while power > 1:
        power //= 2
        ops += 1

print(number, ops)

import sys
from math import ceil, sqrt, gcd

input = sys.stdin.readline

n = int(input())
factors = {}

while True:
    found = False
    for i in range(2, ceil(sqrt(n))):
        if n % i == 0:
            if i not in factors.keys():
                factors[i] = 0
            factors[i] += 1
            n /= i
            found = True
            break
    if not found:
        if n not in factors.keys():
            factors[n] = 0
        factors[n] += 1
        break

if n == 1:
    print("1 0")
else:
    ans = 0
    for key in factors.keys():
        ans = max(ans, factors[key])
    n = 1
    for key in factors.keys():
        n *= key
    print(str(int(n)) + " " + str((ans - 1).bit_length() + 1))

from math import sqrt, ceil, log2

def factor(n):
    potentional_p = 3
    itog_list = {}
    if n % 2 == 0:
        itog_list[2] = 0
    while n % 2 == 0:
        n = n // 2
        itog_list[2] += 1
    while n - 1:
        if potentional_p > sqrt(n):
            if n in itog_list:
                itog_list[n] += 1
            else:
                itog_list[n] = 1
            return itog_list
        while n % potentional_p == 0:
            n = n // potentional_p
            if potentional_p in itog_list:
                itog_list[potentional_p] += 1
            else:
                itog_list[potentional_p] = 1
        potentional_p += 2
    return itog_list

n = int(input())
F = factor(n)
ans = 1
ma = 0
mi = 10 ** 9
for i in F:
    ans *= i
    ma = max(ma, F[i])
    mi = min(mi, F[i])
if ma != mi:
    print(ans, 1 + ceil(log2(ma)))
else:
    print(ans, ceil(log2(ma)))

from collections import defaultdict
from math import floor,sqrt
n=int(input())
d=defaultdict(int)
for i in range(2,floor(sqrt(n))+1):
    while n%i==0:
        d[i]+=1
        n//=i
if n>1:
    d[n]+=1
if len(d)==1 and d[n]==1:
    print(n,0)
else:
    m=0
    for i in d:
        if d[i]>m:
            m=d[i]
            v=i
    if m&1:
        d[v]+=1
    m+=1
    sum=0
    pro=1
    for i in d:
        pro*=i
    print(pro,m//2+1)

n = int(input())
p = [0] * 400

k = 0
for i in range(2, 400):
  while n % i == 0:
    n /= i
    p[i] += 1

  k = max(k, p[i])

print(p)
print(k)

if k % 2 != 0:
  k += 1

m = 1
ans = k // 2
for i in range(2, 400):
  if p[i] > 0:
    if p[i] % k != 0:
      ans += 1

    m *= i

print(m, ans)

import math
def primeFactors(n):
    if n%2==0:
        dict1[2]=0
    while n % 2 == 0:
        dict1[2]+=1
        n = n // 2
    for i in range(3,int(math.sqrt(n))+1,2):
        if  n%i==0:
            dict1[i]=0
        while n % i== 0:
            dict1[i]+=1
            n = n //i
    if n > 2:
        dict1[n]=0
        dict1[n]+=1
n=int(input())
if n==1:
    print(1,0)
else:
    dict1={}
    primeFactors(n)
    max1=1
    lst=[]
    for i in dict1:
        lst.append(dict1[i])
    if max(lst)==min(lst) and  max(lst)==1:
        print(n,0)
    elif max(lst)==min(lst):
        prod=1
        for i in  dict1:
            prod*=i
        print(prod,math.ceil(math.log2(max(lst))))
    else:
        prod=1
        for i in dict1:
            prod*=i
        print(prod,math.ceil(math.log2(max(lst)))+1)

#https://codeforces.com/contest/1062/problem/B

from math import sqrt

def resolve(x):
    """Função que efetivamente resolve o problema."""

    fatores = fatoraInt(x)

    contOperacao = 0
    minimo = 1
    cont = 0
    for i in fatores:
        minimo = minimo * i[0]
        if(i[1] == 1):
            cont = cont + 1

    if(cont == len(fatores)):
        return (minimo, contOperacao)
    else:
        flag = 0
        maximo = fatores[0][1]
        for i in fatores[1:]:
            if(i[1] > maximo):
                maximo = i[1]
            else:
                flag = 1

        if(flag == 1 or maximo % 2 != 0):
            contOperacao = 1 + int(maximo/2)
        else:
            contOperacao = int(maximo/2)

    return (minimo, contOperacao)

def fatoraInt(x):
    """Fatora um número inteiro

    A função encontra os números primos que compoem x.
    O resultado é retornado em uma lista. A lista contem
    cada fator e o número de vezes q ele aparece.
    """

    fatores = []
    cont = 0
    aux = x

    while(x % 2 == 0):
        x = x / 2
        cont = cont + 1
    if(cont != 0):
        fatores.append([2, cont])

    cont = 0
    for i in range(3, int(sqrt(aux)) + 2, 2):
        cont = 0
        if(x % i == 0 and isPrimo(i)):
            while(x % i == 0):
                cont = cont + 1
                x = x / i

            fatores.append([i,cont])
    if(int(x) != 1):
            fatores.append([int(x), 1])

    return fatores

def isPrimo(p):
    """Diz se um inteiro p é primo.

        Retorna True caso seja primo e False caso contrario.
    """

    if(p == 2):
        return True;
    elif(p % 2 == 0):
        return False;
    else:
        for i in range(3, int(sqrt(p)) + 2, 2):
            if( p % i == 0 ):
                return false

        return True

n = int(input())
minimo, contOp  = resolve(n)

print(str(minimo) + " " + str(contOp))

from __future__ import division
from collections import deque, defaultdict, Counter
from math import *

def count_prime(n):
    for i in range(2, n):
        if not prim[i]:
            for j in range(i, n, i):
                prim[j] = i

    for i in range(1, n):
        if not prim[i]:
            prim[i] = i

def prime_factor(x):
    fac = []
    while x > 1:
        div = prim[x]
        fac.append(div)
        x //= div
    return fac

n, ans, N = int(input()), [1, 0], 10 ** 6 + 1
prim = [0] * (N)
count_prime(N)
mem = Counter(prime_factor(n))
ma = max(mem.values())

for i, j in mem.items():
    ans[0] *= i
    if j != ma:
        ans[1] = 1

ans[1] += int(ceil((log(ma, 2))))
print(' '.join(map(str, ans)))

from sys import stdin, stdout
from math import sin, tan, cos, pi, atan2, sqrt, acos, atan, factorial

n = int(stdin.readline())
mp = {}

d = 2
while d * d <= n:
    while n % d == 0:

        if d not in mp:
            mp[d] = 1
        else:
            mp[d] += 1

        n //= d

    d += 1

if n != 1:
    mp[n] = 1

ans = 1
cnt = 0
s = set()

for v in mp:
    ans *= v
    cnt = max(cnt, mp[v])
    s.add(mp[v])

for i in range(20):
    if (1 << i) == cnt and len(s) == 1:
        stdout.write(str(ans) + ' ' + str(i) + '\n')
        break

    if (1 << i) >= cnt:
        stdout.write(str(ans) + ' ' + str(1 + i) + '\n')
        break

from __future__ import division, print_function

import os,sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
from itertools import permutations

def ii():  return int(input())
def si():  return input()
def mi():  return map(int,input().split(" "))
def msi(): return map(str,input().split(" "))
def li():  return list(mi())

def dmain():
    sys.setrecursionlimit(1000000)
    threading.stack_size(1024000)
    thread = threading.Thread(target=main)
    thread.start()

import math
def getSum(n):
    sum = 0
    while(n > 0):
        sum += int(n%10)
        n = int(n/10)

    return sum

def isPowerOfTwo (x): return (x and (not(x & (x - 1))) )

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
def egcd(a, b):
    if a == 0 :
        return b, 0, 1
    gcd, x1, y1 = egcd(b%a, a)
    x = y1 - (b//a) * x1
    y = x1

    return gcd, x, y

def checkPrime(n) : # Check Prime Number or not
    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 fib(n):
    if n==0:
        return (0,1)
    p=fib(n>>1)
    c=p[0]*(2*p[1]-p[0])
    d=p[0]*p[0]+p[1]*p[1]
    if (n&1):
        return c+2*d
    else:
        return c+d
def read():
    sys.stdin = open('input.txt', 'r')
def powLog(x,y):
    res=1
    while y>0:
        if y&1:
            res=res*x
        x=x*x
        y>>=1
    return res

def primefactor(n):
    d=dict()
    while n % 2 == 0:
        if 2 in d:
            d[2]+=1
        else:
            d[2]=1
        n = int(n / 2)

    for i in range(3,int(math.sqrt(n))+1,2):
        while n % i== 0:
            if i in d:
                d[i]+=1
            else:
                d[i]=1
            n = int(n / i)

    if n > 2:
        if n in d:
            d[n]+=1
        else:
            d[n]=1
    return d

def main():
    n=ii()
    res=primefactor(n)
    print(math.prod(list(res.keys())))
# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

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):
    """Prints the values to a stream, or to sys.stdout by default."""
    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)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    #read()
    main()
    #dmain()

# Comment Read()

n = int(raw_input())

i = 2
a = []
b = []
while i * i <= n:
	if n % i == 0:
		cnt = 0
		while n % i == 0:
			cnt += 1
			n //= i
		b.append(i)
		a.append(cnt)
	i += 1
if n > 1:
	a.append(1)
	b.append(n)

ret = 1
for x in b:
	ret *= x
q = max(a)

if q == 1:
	print ret, 0
	exit(0)

ans = 1
while (q & (q - 1)) > 0:
	q += 1
while q > 1:
	ans += 1
	q //= 2
print ret, ans

import math
n = int(input())

def PrimeList(limit):
    Plist = []
    for i in range(2,limit+1):
        divcheck = False
        for j in Plist:
            if j*j > i:
                break
            if i%j == 0:
                divcheck = True
                break
        if divcheck == False:
            Plist.append(i)
    return Plist

T = PrimeList(10**3)
D = {}
for i in T:
    while n % i == 0:
        if i in D:
            D[i] += 1
        else:
            D[i] = 1
        n = int(n/i)
if len(D) == 0:
    print(n,0)
else:
    P = 1
    for i in D:
        P *= i
    L = [i for i in D.values()]
    ma = max(L)
    mi = min(L)
    l = int(math.log(ma,2))
    if ma == 2**l:
        if mi == ma:
            print(P,l)
        else:
            print(P,l+1)
    else:
        print(P,l+2)

import math
from collections import defaultdict
import functools

primes = [2]
N = 1001

def generate_primes():
  for i in range(2, N):
    isPrime = True
    sqr = math.ceil(math.sqrt(i))
    for p in primes:
      if i % p == 0:
        isPrime = False
        break
      if p > sqr:
        break
    if isPrime:
      primes.append(i)

def find_factors(n):
  prime_counter = 0
  prime_dict = defaultdict(int)
  while n > 1:
    while n > 1 and n % primes[prime_counter] == 0:
      n = n // primes[prime_counter]
      prime_dict[primes[prime_counter]] += 1
    prime_counter += 1
  return prime_dict

def get_num_steps(arr):
  def find_power(mx):
    two_power = 1
    i = 0
    while two_power < mx:
      two_power *= 2
      i += 1
    return i

  mx = arr[0]
  all_equal = True
  for i in range(1, len(arr)):
    mx = max(mx, arr[i])
    if arr[i] != arr[i-1]:
      all_equal = False
  if all_equal: #all equal
    return find_power(mx)
  return find_power(mx)+1

def solution(n):
  generate_primes()
  prime_dict = find_factors(n)
  max_power = get_num_steps(list(prime_dict.values()))
  return functools.reduce(lambda x, y:x*y, prime_dict.keys(), 1), max_power

n = int(input())
if n == 1:
  print(1, 0)
else:
  print(*solution(n))

n = int(input())
if n == 1:
    print(1)
    exit()
cnts = []
i = 2
result = 1
while i * i <= n:
    if n % i == 0:
        result *= i
        c = 0
        while n % i == 0:
            c += 1
            n //= i
        cnts.append(c)
    i += 1
if n > 1:
    cnts.append(1)
    result *= n
m = 0
if not (cnts.count(cnts[0]) == len(cnts) and cnts[0] & (cnts[0] - 1) == 0):
    m += 1
    d = max(cnts)
    r = 1
    while r < d:
        r <<= 1
        m += 1
else:
    d = max(cnts)
    while d != 1:
        m += 1
        d >>= 1
print(result, m)

from collections import defaultdict
from math import floor,sqrt
n=int(input())
d=defaultdict(int)
for i in range(2,floor(sqrt(n))+1):
    while n%i==0:
        d[i]+=1
        n//=i
if n>1:
    d[n]+=1
m=0
for i in d:
    if d[i]>m:
        m=d[i]
        v=i
if m&1:
    d[v]+=1
m+=1
sum=0
pro=1
for i in d:
    pro*=i
print(pro,m//2+1)

# print(2**6*3**4)
# print(256**0.5)

def next_power_of_two(maxi):

    base = 2
    exp = 1
    while base ** exp < maxi:
        exp += 1
    # print(exp)
    return exp+1

from collections import defaultdict
n = int(input())

sieve = [True] * (n+1)
sieve[0] = False
sieve[1] = False
for i in range(2,int(n**0.5+1)):
    if sieve[i]:
        for j in range(i+i,n+1,i):
            sieve[j] = False

number = 1
temp = n
factors = defaultdict()
div = 2
if n == 1:
    print(1,0)
    exit(0)
while temp > 1:
    # print(temp)
    if temp % div != 0:
        div += 1
        continue
    temp //= div
    if div not in factors:
        factors[div] = 1
    else:
        factors[div] += 1
# print(factors)
ops = 0

if len(factors) == 1:
    for k, v in factors.items():
        if k == n:
            print(k,0)
        else:
            power = 2**next_power_of_two(v)
            while power > 1:
                power //= 2
                ops += 1
            print(k, ops)
    exit(0)

maxi = -1
for k,v in factors.items():
    number *= k
    maxi = max(maxi, v)
# print(factors)
if maxi == 1:
    print(number, 0)
else:
    # print(maxi)

    power = 2**next_power_of_two(maxi)

    while power > 1:
        power //= 2
        ops += 1

print(number, ops)

from collections import defaultdict as dif
dic=dif(lambda:0)
x=int(input())
if x==1:
    print(0,0)
    exit(0)

while x%2==0:
    dic[2]+=1
    x//=2

mx=dic[2]

n=3
while n*n<=x:
    while x%n==0:
        dic[n]+=1
        x//=n
    mx=max(mx,dic[n])
    n+=2
if x>1:
    dic[x]=1
    mx=max(1,mx)
from math import log2,ceil
lg =ceil(log2(mx))
mxt=1<<lg
nm=1
stp=0
for n in dic:
    if dic[n]!=mxt and dic[n]:
        stp=1
        break

for n in dic:
    if dic[n]:
        nm*=n

stp+=lg
print(nm,stp)

import math
from collections import Counter
# A function to print all prime factors of
# a given number n
def primeFactors(n):
    l=[]
    # Print the number of two's that divide n
    while n % 2 == 0:
        #print 2,
        l.append(2)
        n = n / 2

    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3,int(math.sqrt(n))+1,2):

        # while i divides n , print i ad divide n
        while n % i== 0:
            #print i,
            l.append(i)
            n = n / i

    # Condition if n is a prime
    # number greater than 2
    if n > 2:
        l.append(n)
    return l
l1={}
p=1
i=0
while p<20000000:
    l1[p]=i
    i+=1
    p*=2

n=input()
if n==1:
    print 0
    exit()
l=primeFactors(n)
d=Counter(l)
ans1=1
for i in d.keys():
    ans1*=i
mx=max(d.values())
f=0
try:

    if l1[mx]>=0:
        max_pow=mx
        step=l1[mx]

except:
    f=1
    step=len(bin(mx)[2:])
    max_pow=2**step

for i in d.keys():
    #print d[i],max_pow
    if d[i]<max_pow:
        f=1
        break
if f:
    print ans1,step+1
else:
    print ans1,step

n=int(input())
sl_vhoshd={}
temp=1
if n==1:
   print(1,0)
   exit()
def factor(n):
   rasl = []
   d = 2
   while d * d <= n:
       if n % d == 0:
           rasl.append(d)
           n //= d
       else:
           d += 1
   if n > 1:
       rasl.append(n)
   return (rasl)
def sled_st_dv(n):
    temp=0
    while pow(2,temp)<n:
        temp+=1
    return(temp)
def proisv(mas):
    t=1
    for i in mas:
        t*=i
    return (t)
def proverka(sl_vh,n):
    temp = 0
    t1=0
    for i in sl_vh.values():
     while pow(2, temp) < i:
        temp += 1
     if i != pow(2, temp) or t1:
        return (0)
     t1=temp
     temp=0
    return(-1)
def proverka1(sl_vh,n):
    temp = 0
    t1=0
    sett=set(sl_vh.values())
    while pow(2, temp) < n:
        temp += 1
    if n != pow(2, temp) or len(sett)>1:
        return (0)
    return(-1)
fact=factor(n)
sett=set(fact)
for i in fact:
    if i in sl_vhoshd:
      sl_vhoshd[i]+=1
    else:
      sl_vhoshd[i]=1
#print(sl_vhoshd)
#print(proverka1(sl_vhoshd,n))
temp+=sled_st_dv(max(sl_vhoshd.values()))+proverka1(sl_vhoshd,n)
print(len(set(sl_vhoshd.values())))
print(proisv(sett),temp)

n = int(input())
res = 1
t = n
L = []
for i in range(2,t+1):
    if n % i == 0:
        res *= i
        c = 0
        while n % i == 0:
            n //= i
            c += 1
        if c > 0:
            L.append(c)
    if n == 1:
        break
l = len(L)
a = []
ma = 0
for i in range(l):
    c = 0
    k = L[i]
    while k:
        k //= 2
        c += 1
    if L[i] % 2**(c-1) == 0:
        a.append(c-1)
        ma = max(c-1,ma)
    else:
        a.append(c)
        ma = max(c,ma)
if len(set(a)) == 1 and (L[0] % (2**(ma))) == 0:
    print(res,ma)
else:
    print(res,ma+1)

import math
mul2 = [2**x for x in range(2,7)]
n = int(input())
facto = [0]*1000001
ans = 1
cnt = 0
for i in range(2,math.ceil(n/2)+1):
    if n % i == 0:
        while n % i == 0:
            facto[i] += 1
            n //= i
        ans *= i
        cnt += 1
m = max(facto)
if m == 0:
    print(n,0)
elif m == 1:
    print(ans,0)
elif m == 2:
    print(ans,2)
else:
    mi = 64
    lim = 0
    for each in mul2:
        if each-m >= 0 and each-m <= mi:
            mi = abs(m - each)
            lim = each
    times = int(math.log(lim,2)) if (cnt==1 and lim == m) else int(math.log(lim,2))+1
    print(ans,times)

from __future__ import division
from collections import deque, defaultdict, Counter
from math import *

def count_prime(n):
    for i in range(2, n):
        if not prim[i]:
            for j in range(i, n, i):
                prim[j] = i

    for i in range(1, n):
        if not prim[i]:
            prim[i] = i

def prime_factor(x):
    fac = []
    while x > 1:
        div = prim[x]
        fac.append(div)
        x //= div
    return fac

ispow2 = lambda x: x and (not (x & (x - 1)))
n, ans, N = int(input()), [1, 0], 10 ** 6 + 1
if n == 1:
    print('0 0')
    exit()

prim = [0] * (N)
count_prime(N)
mem = Counter(prime_factor(n))
ma = max(mem.values())

for i, j in mem.items():
    ans[0] *= i
    if j != ma:
        ans[1] = 1

if not ispow2(ma):
    ans[1] = 1

ans[1] += int(ceil((log(ma, 2))))
print(' '.join(map(str, ans)))

from math import log2, ceil

n = int(input())
divis = set()
i = 2
actions = 0
set_cnt = set()
n_copy = n
while i * i <= n:
    cnt = 0
    if n_copy % i == 0:
        divis.add(i)
    while n_copy % i == 0:
        n_copy //= i
        cnt += 1
    if cnt != 0:
        num = ceil(log2(cnt))
        set_cnt.add(cnt)
        actions = max(actions, num)
    i += 1
if n_copy > 1:
    divis.add(n_copy)
    actions = max(actions, 0)
    set_cnt.add(1)
ans = 1
for elem in divis:
    ans *= elem
if len(set_cnt) != 1:
    actions += 1
print(ans, actions)

import math
from collections import Counter
# A function to print all prime factors of
# a given number n
def primeFactors(n):
    l=[]
    # Print the number of two's that divide n
    while n % 2 == 0:
        #print 2,
        l.append(2)
        n = n / 2

    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3,int(math.sqrt(n))+1,2):

        # while i divides n , print i ad divide n
        while n % i== 0:
            #print i,
            l.append(i)
            n = n / i

    # Condition if n is a prime
    # number greater than 2
    if n > 2:
        l.append(n)
    return l
l1={}
p=1
i=0
while p<200000000:
    l1[p]=i
    i+=1
    p*=2

n=input()
if n==1:
    print 0
    exit()
l=primeFactors(n)
d=Counter(l)
ans1=1
for i in d.keys():
    ans1*=i
mx=max(d.values())
f=0
try:

    max_pow=mx
    step=l1[mx]

except:
    f=1
    step=len(bin(mx)[2:])
    max_pow=2**step

for i in d.keys():
    #print d[i],max_pow
    if d[i]<max_pow:
        f=1
        break
if f:
    print ans1,step+1
else:
    print ans1,step

import math
# https://codeforces.com/problemset/problem/1062/B
def B1062(n):
    dictionary = dict()
    value = 1
    while (n % 2 == 0):
        dictionary[2] = 1 + dictionary.get(2, 0)
        n = n/2
        value = 2

    for prime in range(3, int(math.sqrt(n))+1, 2):
        found_prime = False
        while n % prime == 0:
            dictionary[prime] = dictionary.get(prime, 0)  + 1
            n = n/prime
            if not found_prime:
                value *= prime
                found_prime = True

    if (n>2):
        dictionary[n] = dictionary.get(n, 0) + 1
        value *= n

    steps  = 0

    max_power = max(dictionary.values())
    math_log = math.log(max_power, 2)

    if max_power == 1:

        print(n, 0)
        return

    #     print(dictionary, math_log)
    if max_power == 2:
        steps = 2
    elif all(list(map(lambda x: int(math.log(x, 2)) * 2   == x, dictionary.values()))):
        steps = int(math_log)
    else:
        steps = int(math_log) + 1 +1

    #print(value, steps)
    print(" ".join([str(int(value)), str(steps)]))

B1062(int(input()))

from collections import defaultdict
import math
def getPrimeFactors(n):
    factors = []
    while n%2==0:
        factors.append(2)
        n = n//2
    k=3
    while k*k <= n:
        if n%k==0:
            n= n//k
            factors.append(k)
        else:
            k+=2
    if n>1:
        factors.append(n)
    return factors
n = int(input())
counts = defaultdict(int)
for a in getPrimeFactors(n):
    counts[a]+=1
k = list(counts.values())[0]
no = 1
notsame = False
for a,cnt in counts.items():
    no *= a
    if k!=cnt:
        notsame = True
    k = max(k,cnt)

moves = math.ceil(math.log2(k))
if moves != k and moves!=0: notsame = True
if notsame:
    moves+=1
print(f"{no} {moves}")

n = int(input())
n1 = n
ans = 1
maxcnt = 0
flag = 0
for i in range(2,n1 + 1):
	if i > n:
		break
	if n % i == 0:
		ans *= i
		cnt = 0
		while n % i == 0:
			n /= i
			cnt += 1
		if cnt != maxcnt and maxcnt > 0:
			flag = 1
		if cnt > maxcnt:
			maxcnt = cnt

myb = [1, 2, 4, 8, 16, 32]

if maxcnt not in myb:
	flag = 1

for i in range(len(myb)):
	if myb[i] >= maxcnt:
		anscnt = i
		break

print(ans, anscnt + flag)

import math
# https://codeforces.com/problemset/problem/1062/B
def B1062(n):
    initial_value = n
    dictionary = dict()
    if n == 1:
        print(n, 0)
        return
    value = 1
    while (n % 2 == 0):
        dictionary[2] = 1 + dictionary.get(2, 0)
        n = n/2
        value = 2

    for prime in range(3, int(math.sqrt(n))+1, 2):
        found_prime = False
        while n % prime == 0:
            dictionary[prime] = dictionary.get(prime, 0)  + 1
            n = n/prime
            if not found_prime:
                value *= prime
                found_prime = True

    if (n>2):
        dictionary[n] = dictionary.get(n, 0) + 1
        value *= n

    steps  = 0
    max_power = max(dictionary.values())
    math_log = math.log(max_power, 2)

    if max_power == 1:

        print(initial_value, 0)
        return

    print(dictionary)
    if max_power == 2:
        steps = 2
    elif all(list(map(lambda x: x != 1 and int(math.log(x, 2))  ==  math.log(x,2), dictionary.values()))):
        steps = int(math_log)
    else:
        if int(math_log) == math_log: # max power is squared
            # we add one for the "squaredfication"
            steps =  int(math_log)  +1
        else:
            steps = int(math_log) + 1  + 1

    #print(value, steps)
    print(" ".join([str(int(value)), str(steps)]))

# B1062(int(input()))

n = int(input())
factors = {}
mindegree = float("inf")
maxdegree = 0
answer = 1

for x in range(2, int(n ** 0.5) + 1):
    if n == 1: break
    multiplicity = 0
    while n % x == 0:
        n = n // x
        multiplicity += 1
    if multiplicity:
        answer *= x
        #factors[x] = multiplicity
        mindegree = min(mindegree, multiplicity)
        maxdegree = max(maxdegree, multiplicity)

if n != 1:
    #factors[n] = 1
    answer *= n
    mindegree = min(mindegree, 1)
    maxdegree = max(maxdegree, 1)

deg = 0
while 2 ** deg < maxdegree:
    deg += 1

result = deg + 1
if 2 ** deg == maxdegree == mindegree:
    result -= 1
print(answer, result)

import math
n = int(input())
out = 0
while n>1:
    rv = n ** 0.5
    rv1 = round(n ** (1/3))
    if math.floor(rv) == math.ceil(rv):
        n = int(rv)
        out += 1
    elif rv1**3 == n:
        n = n//math.floor(rv1)
        out += 2
    elif n%4 == 0:
        n//=2
        out+=2
    elif n%2 == 0:
        v = n//2
        rv = v**0.5
        if math.floor(rv)==math.ceil(rv):
            n = 2*int(rv)
            out+=2
        else:
            break
    else:
        break
print(n,out)

N = int(input())
prime_factors = {}

i = 2
while True:
    if i*i > N:
        if N in prime_factors:
            prime_factors[N] += 1
        else:
            prime_factors[N] = 1
        break

    if N%i == 0:                    # factors are necessarily prime numbers
        if i in prime_factors:
            prime_factors[i] += 1
        else:
            prime_factors[i] = 1

        N //= i
        continue

    i += 1

ans1 = 1
for prime in prime_factors.keys():
    ans1 *= prime

ans2 = 0
while (1 << ans2) < max(prime_factors.values()):
    ans2 += 1
ans2 += 1           # Assuming that flattening is a given.

temp = list(prime_factors.values())
for num in prime_factors.values():
    if temp != num: break
else:
    while temp%2 == 0:
        temp //= 2
    if temp == 1:
        ans2 -= 1

print(ans1, ans2)

# -*- coding: utf-8 -*-
"""
Created on Sat Jun  8 10:08:27 2019

@author: plosi
"""

def issame(arr,m):
    for i in range(len(arr)):
        if arr[i]!=m:
            return False
    return True

def SOE(n):
    p=2
    global ps
    primes=[True for i in range(n+1)]
    primes[0]=False
    primes[1]=False
    while p<=n**(0.5):
        cur=p
        cur=cur+p
        while cur<=n:

            primes[cur]=False
            cur=cur+p
        p=p+1
        while not primes[p]:
            p=p+1
    ps=[i for i in range(len(primes)) if primes[i]]
    global pset
    pset=set(ps)

def fact(n):
    val=ps[0]
    bs=[]
    fs=[]
    ct=0
    if n in pset:
        return (n,0)

    while n>1:
        if n%val==0:
            a=1
            n=int(n/val)
            bs.append(val)
            while n%val==0:
                n=n/val
                a=a+1
            fs.append(a)
        ct=ct+1
        val=ps[ct]
    m=max(fs)
    p=1
    for val in bs:
        p=p*val
    if m%2==0:
        if issame(fs,m):
            ct=int(m/2)
        else:
            ct=1+int(m/2)
    else:
        m=m+1
        ct=1+int(m/2)
    return (p,ct)

def main():
    n=int(input())
    SOE(n)
    p,ct=fact(n)
    print(str(p)+" "+str(ct))
main()

import math
mul2 = [2**x for x in range(1,7)]
n = int(input())
ncopy = n
facto = [0]*1000001
ans = 1
cnt = 0

for i in range(2,math.ceil(n/2)+1):
    if n % i == 0:
        while n % i == 0:
            facto[i] += 1
            n //= i
        ans *= i
        cnt += 1
m = max(facto)
if ncopy ** .5 == ans:
    print(ans,1)
elif m == 0:
    print(n,0)
elif m == 1:
    print(ans,0)
else:
    mi = 64
    lim = 0
    for each in mul2:
        if each-m >= 0 and each-m <= mi:
            mi = abs(m - each)
            lim = each
    times = int(math.log(lim,2)) if (cnt==1 and lim == m) else int(math.log(lim,2))+1
    print(ans,times)

from sys import stdin
n=int(stdin.readline().strip())
if n==1:
    print(1,0)
    exit(0)
v=[[]]
N=10**25+1
for i in range(2,(n+2)//2):
    x=i**0.5
    if x!=int(x):
        v.append([])
        x=i
        while x<=N:
            v[-1].append(x)
            x*=x
ans=0
aux=n**0.5
while aux==int(aux):
    ans+=1
    n=int(aux)
    aux=n**0.5
t=False
for i in v:
    for j in i:
        if j%n==0:
            print(j,n)
            if j!=n:
                ans+=1
            t=True
            break
    if t:
        break
if t:
    aux=j**0.5
    while aux==int(aux):
        ans+=1
        j=int(aux)
        aux=j**0.5
else:
    j=n
print(int(j),ans)

from collections import Counter
import math
n = int(input())
def getFactors(x):
    f = []
    if x == 1:
        return [1]
    j = 2
    while x >= 2:
        if x % j == 0:
            f.append(j)
            x = x // j
        else:
            j += 1
    return f
c = Counter(getFactors(n))
minm = 1
for x in c:
    minm *= x
maxm = max(c.values())
i = 0
f = 1
while maxm > f:
    i += 1
    f *= 2
if maxm == 1 or (len(c) == 1 and i == 0):
    ans = i
else:
    ans = i + 1
print(minm, ans)

import math
# https://codeforces.com/problemset/problem/1062/B
def B1062(n):
    initial_value = n
    dictionary = dict()
    if n == 1:
        print(n, 0)
        return
    value = 1
    while (n % 2 == 0):
        dictionary[2] = 1 + dictionary.get(2, 0)
        n = n/2
        value = 2

    for prime in range(3, int(math.sqrt(n))+1, 2):
        found_prime = False
        while n % prime == 0:
            dictionary[prime] = dictionary.get(prime, 0)  + 1
            n = n/prime
            if not found_prime:
                value *= prime
                found_prime = True

    if (n>2):
        dictionary[n] = dictionary.get(n, 0) + 1
        value *= n

    steps  = 0
    max_power = max(dictionary.values())
    math_log = math.log(max_power, 2)

    if max_power == 1:

        print(initial_value, 0)
        return

    print(dictionary)
    if max_power == 2:
        steps = 2
    elif all(list(map(lambda x: x != 1 and int(math.log(x, 2))  ==  math.log(x,2), dictionary.values()))):
        steps = int(math_log)
    else:
        if int(math_log) == math_log: # max power is squared
            # we add one for the "squaredfication"
            steps =  int(math_log)  +1
        else:
            steps = int(math_log) + 1  + 1

    #print(value, steps)
    print(" ".join([str(int(value)), str(steps)]))

B1062(int(input()))

n = int(input())
i = 2
factors = {1}
while i * i <= n:
    if n % i:
        i += 1
    else:
        n //= i
        factors.add(i)
if n > 1:
    factors.add(n)
result = 1
for x in factors:
    result *= x
print(result)

import collections
import math
import sys
def isPowerOfTwo (x):
    return (x and (not(x & (x - 1))))
def primefactors(n):
	d = collections.defaultdict(int)
	while n%2 == 0:
		d[2]+=1
		n/=2
	for i in range(3, int(n**0.5)+1, 2):
		while n%i==0:
			d[i]+=1
			n/=i
	if n > 2:
		d[n]+=1
	return d
n = int(input())
if n == 1:
	print(1, 0)
	sys.exit()
x = primefactors(n)
y = max(x.values())
z = x.keys()
k = 1
for i in z:
	k*=i
if y == 1 or y == 0:
	print(int(k), 0)
else:
	if y%2 == 0:
		print(int(k), math.ceil(math.log(y, 2)))
	else:
		print(int(k), math.ceil(math.log(y, 2))+1)

import math
def prime(k):
    if k==1:
        return False
    w=int(math.sqrt(k))+1
    for i in range(2,w):
        if k%i==0:
            return False
    return True
def div(n):
    ans=[]
    i=1
    while(i<=math.sqrt(n)):
        if n%i==0:
            if n/i==i:
                if prime(i):
                    ans.append(i)
            else:
                if prime(i):
                    ans.append(i)
                if prime(n//i):
                    ans.append(n//i)
        i+=1
    return ans
t=int(input())
if t==1:
    print(1,0)
else:

    d=dict()
    q=div(t)
    for i in range(len(q)):
        while(t%q[i]==0 and t>1):
            if q[i] in d:
                d[q[i]]+=1
            else:
                d[q[i]]=1
            t=t//q[i]
    val=max(d.values())
    ans=1
    for i in d.keys():
        ans*=i

    if val&(val-1)==0:
        val2=int(math.log(val,2))

    else:
        val2=int(math.log(val,2))+1

    if len(set(d.values()))==1:
        print(ans,val2)
    else:
        print(ans,val2+1)

import math
import copy

memo = {}
def fish(n):
  if n in memo:
    return memo[n]
  if n == 1:
    return 1, 0
  ans = [n, -1]
  for i in range(1, n):
    new_n = n * i
    sq = int(math.sqrt(new_n))
    if sq * sq == new_n:
      ans = fish(sq)
      break
  ans[1] = max(ans[1], 0)
  memo[n] = copy.deepcopy(ans)
  return ans

n = int(input())
ans = fish(n)
print(f'{ans[0]} {ans[1]}')

from math import log2, sqrt

def main():
    n = int(input())
    d = {}
    cur = n
    for i in range(2, int(sqrt(n)) + 2):
        while cur % i == 0:
            t = d.get(i, 0) + 1
            d[i] = t
            cur //= i
    if cur != 1:
        d[cur] = 1
    if d == {} or max(d.values()) == 1:
        return print(n, 0)
    cur = []
    for k in d:
        cur.append(log2(d[k]))
    f = True
    g = True
    ans = -1
    for k in cur:
        if k - int(k) != 0 and f:
            f = False
        elif k == 0 and g:
            g = False
        ans = max(ans, int(k))
    ans_1 = 1
    for k in d:
        ans_1 *= k
    if not f and g:
        return print(ans_1, ans + 2)
    if f and not g:
        return print(ans_1, ans + 1)
    return print(ans_1, ans)

if __name__=="__main__":
    main()

#
import collections, atexit, math, sys, bisect

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass

inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit

N, = getIntList()
#print(N)
re = 1
mc = 1
for i in range(2, 10000):
    if N%i != 0 : continue
    re *= i
    c = 0
    while N%i==0:
        N//=i
        c+=1
    mc = max(mc,c)
if N>0:
    re*=N

t =1
for i in range(100):
    if mc<=t:
        break
    t*=2

if i==0:
    g = 0
else:
    g = i +1

print(re,g)

from sys import stdin
from collections import deque
mod = 10**9 + 7
import sys
sys.setrecursionlimit(10**5)
from queue import PriorityQueue
# def rl():
#     return [int(w) for w in stdin.readline().split()]
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt,factorial,gcd,log2,inf,ceil
# map(int,input().split())
# # l = list(map(int,input().split()))
# from itertools import permutations
import heapq
# input = lambda: sys.stdin.readline().rstrip()
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop

# Python3 program to find prime factorization
# of a number n in O(Log n) time with
# precomputation allowed.
import math as mt

MAXN = 1000001

# stores smallest prime factor for
# every number
spf = [0 for i in range(MAXN)]

# Calculating SPF (Smallest Prime Factor)
# for every number till MAXN.
# Time Complexity : O(nloglogn)
def sieve():
    spf[1] = 1
    for i in range(2, MAXN):

        # marking smallest prime factor
        # for every number to be itself.
        spf[i] = i

        # separately marking spf for
    # every even number as 2
    for i in range(4, MAXN, 2):
        spf[i] = 2

    for i in range(3, mt.ceil(mt.sqrt(MAXN))):

        # checking if i is prime
        if (spf[i] == i):

            # marking SPF for all numbers
            # divisible by i
            for j in range(i * i, MAXN, i):

                # marking spf[j] if it is
                # not previously marked
                if (spf[j] == j):
                    spf[j] = i

                # A O(log n) function returning prime
# factorization by dividing by smallest
# prime factor at every step
def getFactorization(x):
    ret = list()
    while (x != 1):
        ret.append(spf[x])

        x = x // spf[x]

    return ret

n = int(input())

sieve()
z = getFactorization(n)
hash = defaultdict(int)

for i in z:
    hash[i]+=1
ans = 1
maxi = 0
flag = 1
seti =  set()
for i in hash:
    ans*=i
    maxi = max(maxi,ceil(log2(hash[i])))
    seti.add(ceil(log2(hash[i])))

if len(seti) == 1:
    flag = 0

print(ans,maxi+flag)

import math

def myf(n):
	if n==1:
		return [(1,1)]
	a = list()
	for i in range(2,n+1):
		if n%i == 0:
			count = 0
			while n%i == 0:
				n /= i
				count += 1
			a.append((i,count))
	return a

n = int(input())
s = -1
x = myf(n)
h = True

#print(x)

for i in range(1,len(x)):
	if x[i][1] != x[i-1][1]:
		h = False

if h:
	if x[0][1] & (x[0][1]-1) == 0:
		s = math.log2(x[0][1])
	else:
		mym = x[0][1]
		if mym & (mym-1) != 0:
			s = 0
		while mym != 0:
			mym = mym >> 1
			s +=1
		s +=1
else:
	s = 0
	mym = x[0][1]
	for each in x:
		if each[1]>mym:
			mym = x[i][1]

	while mym != 0:
		mym = mym >> 1
		s +=1
	s += 1

v = 1
for each in x:
	v *= each[0]
print(v,int(s),sep=" ")

import sys
from math import sqrt, gcd, ceil, log
from bisect import bisect
from collections import defaultdict
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

# sys.setrecursionlimit(10**6)

def solve():
	n = int(inp()); t = n

	arr = []; sett = set(); m_c = 1;

	for i in range(2, int(sqrt(n)+1)):
		c = 0
		if n%i == 0:
			arr.append(i)
			while n%i == 0:
				c += 1
				n //= i
			sett.add(c)
		m_c = max(m_c, c)
	if n > 1:
		arr.append(n)
		sett.add(1)

	if m_c == 1:print(t, 0);exit()

	m_c = ceil(log(m_c, 2))
	print(m_c, sett, arr)
	if not(len(sett) == 1 and 2**m_c in sett):
		m_c += 1

	ans = 1
	for i in arr: ans *= i
	print(ans, m_c)

if __name__ == "__main__":
	solve()

from math import sqrt
def primeFactorize(n):
	dic = {}
	i = 2
	while(n>1):
		while(n%i==0):
			try:
				dic[i]+=1
			except:
				dic[i] = 1
			n = n//i
		i += 1
	return dic

def noofoperation(num):
	if num==1:
		return 0
	elif num&1==0:
		return 1 + noofoperation(num//2)
	else:
		return 2 + noofoperation((num+1)//2)

if __name__=="__main__":
	n = int(input())
	count = 0
	dic = primeFactorize(n)
	for i in dic.values():
		count = max(count,noofoperation(i))
	pro = 1
	for i in dic:
		pro *= i
	print(pro,count)

from math import sqrt,log,ceil
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)))

def get_primes(end):
    out = list()
    sieve = [True] * (end + 1)
    for p in range(2,end + 1):
        if (sieve[p]):
            out.append(p)
            for i in range(p, end + 1, p):
                sieve[i] = False
    return out

def factors(n):
	primes=get_primes(int(sqrt(n)+1))
	ans={}
	for num in primes:
		if num!=1:
			while n%num==0:
				n/=num
				ans[num] = ans.get(num, 0) + 1
		else:
			break
	maxi=0
	for key in ans.keys():
		if ans[key]>maxi:
			maxi=ans[key]
	lol=1
	for key in ans.keys():
		lol*=int(key)
	temp=int(ceil(log(maxi,2)))
	flag=0
	for key in ans.keys():
		if ans[key]!=2**temp:
			flag=1
			break

	return lol,temp+flag

n=int(raw_input())
if n==1:
	print 1,0
	exit()
if isPrime(n):
	print n,0
	exit()
maxi,temp=factors(n)
print maxi,temp

#int(input())
#map(int,input().split())
#[list(map(int,input().split())) for i in range(q)]
#print("YES" * ans + "NO" * (1-ans))
n = int(input())
n2 = n
flag = 0
i = 0
ans = 1
flag2= 0
ans2 = 0
for i in range(2,int(n**0.5)+1):
    if n % i == 0:
        ans *= i
    num = 0
    while n % i == 0:
        n //= i
        num += 1
    num2 = 0
    num3 = bin(num)[3:]
    flag = 0
    for j in num3:
        if j == "1":
            flag = 1
            break
    if flag == 1 or num == 1:
        num2 = len(num3) + 1
        flag2 = 1
    else:
        num2 = len(num3)
    ans2 = max(ans2,num2)
    if n < i:
        break
num3 = ans * n
if num3 == n2:
    print(num3,0)
else:
    if n!=1:
        num2 = 2
        flag2 = 1
    else:
        num2 = 1
    print(num3,max(ans2+flag2,num2))

import math
n=int(input())
def srt(n):
    x=int(math.sqrt(n))
    return x

def div(n):
    xs=int(math.sqrt(n))
    ls=[]
    for i in range(1,xs+1):
        if n%i==0:
            ls.append(i)
            if i*i!=n:
                ls.append(n//i)

    ls.sort()
    return ls[:len(ls)-1]

xs=1
count=0
while xs:
    ax=srt(n)
    if ax*ax==n:
        n=ax
        count+=1
    else:
        l=div(n)
        y=len(l)
        for j in range(y):
            bx=l[j]*n
            cs=int(math.sqrt(bx))
            if cs*cs!=bx:
                xs=0
            else:
                n=bx
                xs=1
                count+=1
                break

print(n,end=' ')
print(count)

import math
# https://codeforces.com/problemset/problem/1062/B
def B1062(n):
    initial_value = n
    dictionary = dict()
    if n == 1:
        print(n, 0)
        return
    value = 1
    while (n % 2 == 0):
        dictionary[2] = 1 + dictionary.get(2, 0)
        n = n/2
        value = 2

    for prime in range(3, int(math.sqrt(n))+1, 2):
        found_prime = False
        while n % prime == 0:
            dictionary[prime] = dictionary.get(prime, 0)  + 1
            n = n/prime
            if not found_prime:
                value *= prime
                found_prime = True

    if (n>2):
        dictionary[n] = dictionary.get(n, 0) + 1
        value *= n

    steps  = 0
    max_power = max(dictionary.values())
    math_log = math.log(max_power, 2)

    if max_power == 1:

        print(initial_value, 0)
        return

#     print(dictionary)
    if max_power == 2:
        steps = 2
    elif all(list(map(lambda x: int(math.log(x, 2))  ==  math.log(x,2), dictionary.values()))):
        steps = int(math_log)
    else:
        if int(math_log) == math_log: # max power is squared
            # we add one for the "squaredfication"
            steps =  int(math_log)  +1
        else:
            steps = int(math_log) + 1  + 1

    #print(value, steps)
    print(" ".join([str(int(value)), str(steps)]))

B1062(int(input()))

import math
n=int(input())
if n==1:
    print(1,0)
else:
    factors=[]
    for i in range(1,round(n**0.5)+2):
        if n%i==0:
            factors+=[i,n//i]
    def isprime(n):
        if n==1:
            return False
        if n<4:
            return(True)
        for i in range(2,round(n**0.5)+2):
            if n%i==0:
                return False
        return True
    primes=[]
    for factor in factors:
        if isprime(factor):
            primes.append(factor)
    exps=[]
    for prime in primes:
        x=prime
        expo=0
        while n%x==0:
            x*=prime
            expo+=1
        exps.append(expo)
    b=max(exps)
    decs=math.ceil(math.log2(b))
    cheat=True
    exp=2**decs
    for guy in exps:
        if guy!=exp:
            cheat=False
            break
    prod=1
    for guy in primes:
        prod*=guy
    if cheat:
        print(prod,decs)
    else:
        print(prod,decs+1)

import math
from collections import Counter

lis = []
nearest_pow_2 = []

def convert(n):
    start = 1
    while start < n:
        start *= 2
    return start

def primeFactors(n):
    while n % 2 == 0:
        lis.append(2)
        n = n / 2
    for i in range(3, int(math.sqrt(n)) + 1, 2):
        while n % i == 0:
            lis.append(i)
            n = n / i
    if n > 2:
        lis.append(n)

primeFactors(int(input()))
cur_lis = Counter(lis)
key = list(cur_lis.keys())
for i in key:
    nearest_pow_2.append(convert(cur_lis[i]))
m = 0
flag = 0
for i in range(len(key)):
    if nearest_pow_2[i] > cur_lis[i]:
        flag = 1
    m = max(m, math.log(nearest_pow_2[i], 2))
x = list(set(lis))
ans = 1
for i in x:
    ans *= i
m = int(m)
if flag == 1:
    m += 1
ans = int(ans)
print(ans, m)

import sys
import math

def starting(N):
    a = []
    b = {}
    ans_one = 1
    ans_two = 0
    d = -1

    for i in range(2,N):
        if N%i:
                continue
        c = 0
        while not (N%i):
                c += 1
                N /= i

        if d != -1 and c&-c != c:
            ans_two = 1
        elif d != -1 and c != d:
            ans_two = 1

        if d < c:
            d = c
        ans_one *= i

    if N > 1:
        ans_one *= N
        if d != 1 and d != -1:
            ans_two = 1

    i = 1
    while i < d:
        ans_two += 1
        i *= 2

    print ans_one, ans_two

n=int(input())

if n == 1:
        print 1,0
else:
        starting(n)

import math
from collections import Counter
# A function to print all prime factors of
# a given number n
def primeFactors(n):
    l=[]
    # Print the number of two's that divide n
    while n % 2 == 0:
        #print 2,
        l.append(2)
        n = n / 2

    # n must be odd at this point
    # so a skip of 2 ( i = i + 2) can be used
    for i in range(3,int(math.sqrt(n))+1,2):

        # while i divides n , print i ad divide n
        while n % i== 0:
            #print i,
            l.append(i)
            n = n / i

    # Condition if n is a prime
    # number greater than 2
    if n > 2:
        l.append(n)
    return l
l1={}
p=1
i=0
while p<20000000:
    l1[p]=i
    i+=1
    p*=2

n=input()
if n==1:
    print 0
    exit()
l=primeFactors(n)
d=Counter(l)
ans1=1
for i in d.keys():
    ans1*=i
mx=max(d.values())
try:

    if l1[mx]>=0:
        max_pow=mx
        step=l1[mx]

except:
    step=len(bin(mx)[2:])
    max_pow=2**step
f=0
for i in d.keys():
    #print d[i],max_pow
    if d[i]<max_pow:
        f=1
        break
if f:
    print ans1,step+1
else:
    print ans1,step

n = int(input())
x = n
p = [0] * 400

k = 0
for i in range(2, 400):
  while n % i == 0:
    n //= i
    p[i] += 1

  k = max(k, p[i])

if k % 2 != 0:
  k += 1

m = 1
ans = k // 2 + 1
for i in range(2, 400):
  if p[i] > 0:
    m *= i

if m == x:
  print(m, 0)
else:
  print(m, ans)

import collections
import math
import sys
def isPowerOfTwo (x):
    return (x and (not(x & (x - 1))))
def primefactors(n):
	d = collections.defaultdict(int)
	while n%2 == 0:
		d[2]+=1
		n/=2
	for i in range(3, int(n**0.5)+1, 2):
		while n%i==0:
			d[i]+=1
			n/=i
	if n > 2:
		d[n]+=1
	return d
n = int(input())
if n == 1:
	print(1, 0)
	sys.exit()
x = primefactors(n)
y = max(x.values())
z = x.keys()
k = 1
for i in z:
	k*=i
if y == 1 or y == 0:
	print(int(k), 0)
else:
	if y%2 == 0:
		print(int(k), math.ceil(math.log(y, 2)))
	else:
		print(int(k), math.ceil(math.log(y, 2))+1)

import math

n = int(input())
N = n
frq = list()
for i in range(n+1):
    frq.append(0)
while(n > 1):
    for i in range(2, n+1):
        if(n % i == 0):
            frq[i] += 1
            n //= i
            break
maxfrq = 0
sqfree = 1
for i in range(N+1):
    if(frq[i]>0):
        sqfree *= i
    maxfrq = max(maxfrq, frq[i])
nextbit = 1
while(nextbit < maxfrq) : nextbit *= 2
if(sqfree == N) : nextbit /= 2
print(sqfree, int(math.log2(nextbit)) + 1)

import math
mul2 = [2**x for x in range(2,7)]
n = int(input())
facto = [0]*1001
ans = 1
for i in range(2,math.ceil(n**.5)+1):
    if n % i == 0:
        while n % i == 0:
            facto[i] += 1
            n //= i
        ans *= i
m = max(facto)
if m == 0:
    print(n,0)
elif m == 1:
    print(ans,0)
elif m == 2:
    print(ans,2)
else:
    mi = 64
    lim = 0
    for each in mul2:
        if abs(m-each) <= mi:
            mi = abs(m - each)
            lim = each
    times = int(math.log(lim,2)+1) if (lim != m) else int(math.log(lim,2))
    print(ans,times)

import math

n = int(input())
ans, anssq = 1, 0
maxsq = 1
tempn = n
for i in range(2, n + 1):
    tempsq = 0
    while tempn % i == 0:
        tempn = tempn // i
        tempsq += 1
    if tempsq > 0:
        ans = ans * i
    if tempsq > maxsq:
        maxsq = tempsq
print(ans, math.ceil(math.log2(maxsq) + 1))

from collections import defaultdict
from math import log, ceil
k = int(input())
n = k//2
primefac = defaultdict(int)
mark = [True]*(n+1)
for i in range(2, n+1):
	if mark[i]:
		while k != 1:
			if k%i == 0:
				k//=i
				primefac[i] += 1
			else: break
		if k == 1: break
		for j in range(i, n+1, i): mark[j] = False
if k != 1:
	print(k, 0)
else:
	ans1 = 1
	ans2 = 0
	t = 0
	z = False
	y = False
	for key, value in primefac.items():
		te = log(value, 2)
		if te == 0: y = True
		elif int(te) != te: t+=1
		else: z = True
		ans1 *= key
		ans2 = max(ans2, ceil(te))
	t = (1 if t > 0 or (y and z) else 0)
	print(ans1, ans2+t)

N = int(input())
num = 0
while int(N ** 0.5) ** 2 == N:
    num += 1
    N = int(N ** 0.5)
M = 10 ** 3 + 5

while True:
    pr = {}
    K = N
    for i in range(2, M):
        tmp = 0
        while K % i == 0:
            K //= i
            tmp += 1
        if tmp >= 1:
            pr[i] = tmp

    tmp0 = 0
    for k, v in pr.items():
        if v % 2 != 0:
            pr[k] += 1
            tmp0 += 1

    rec = 1
    for k, v in pr.items():
        rec *= k ** (v // 2)

    if N <= rec:
        rec = N
        break
    N = rec
    num += tmp0

print(rec, num + 1)

import math
def check(n,i):
    k = 0
    while n%i == 0:
        k += 1
        n = n/i
    return [n,k]
n = int(raw_input())
num = []
l = set()
maxpow = 1
ran = int(n)
for i in range(2,ran):
    n,temp = check(n,i)
    if temp > 0:
        maxpow = max(maxpow, temp)
        num.append(i)
        l.add(temp)
if maxpow == 1:
    print n, 0
else:
    ans = 1
    for j in num:
        ans = ans*j
    if len(l) > 1 or math.ceil(math.log(maxpow)/math.log(2)) > math.log(maxpow)/math.log(2):
        print ans, int(math.ceil(math.log(maxpow)/math.log(2)))+1
    else:
        print ans, int(math.ceil(math.log(maxpow)/math.log(2)))

import math

n = int(input())
ans, anssq = 1, 0
maxsq = 1
tempn = n
for i in range(2, n + 1):
    tempsq = 0
    while tempn % i == 0:
        tempn = tempn // i
        tempsq += 1
    if tempsq > 0:
        ans = ans * i
    if tempsq > maxsq:
        maxsq = tempsq
if math.log2(maxsq) == 0.0:
    print(ans, 0)
else:
    print(ans, math.ceil(math.log2(maxsq) + 1))

from collections import defaultdict
from math import log, ceil
k = int(input())
n = k//2
primefac = defaultdict(int)
mark = [True]*(n+1)
for i in range(2, n+1):
	if mark[i]:
		while k != 1:
			if k%i == 0:
				k//=i
				primefac[i] += 1
			else: break
		if k == 1: break
		for j in range(i, n+1, i): mark[j] = False
if k != 1:
	print(k, 0)
else:
	ans1 = 1
	ans2 = 0
	t = 0
	for key, value in primefac.items():
		te = log(value, 2)
		if int(te) != te or te == 0: t=1
		ans1 *= key
		ans2 = max(ans2, ceil(te))
	print(ans1, ans2+t)

from math import *
a=int(input())
p=[]
b=a
prime=1
for i in range(a+5):
    p.append(0)
while a>1:
    q=0
    for z in range(2,floor(sqrt(a))+1):
        if(a%z==0):
            p[z]+=1
            a/=z
            prime=0
            q=1
            break
    if(q==0):
        p[int(a)]+=1
        break
q=1
r=1
t=0
while(q<max(p)):
    q*=2
    t+=1
for i in range(b+5):
    if(p[i]!=0):
        r*=i
if(t==0):
    t=-1
print(r,t+1)

import math

def sieve(n):
    mark = [0]*(n+1)
    prime = []
    for i in range(3, n+1, 2):
        if not mark[i]:
            for j in range(3*i, n+1, i+i):
                mark[j] = 1
    prime.append(2)
    for i in range(3, n+1, 2):
        if not mark[i]:
            prime.append(i)

    return prime

def ispowerof2(x):
    if x and not (x & (x-1)):
        return 0
    else:
        return 1

n = int(input())
prime = sieve(n)
l = []

countp = 0

ans = 1
for i in prime:
    countp = 0
    if n % i == 0:
        ans *= i
        while n % i == 0:
            n //= i
            countp += 1
        l.append(countp)

    if n == 1:
        break
if n > 1:
    maxp = max(l)
else:
    maxp = 0
flag = 0
for i in l:
    if i != maxp:
        flag = 1

temp = 0

if flag:
    temp = 1
else:
    temp = ispowerof2(maxp)

if maxp == 1:
    maxp -= 1
elif maxp != 0:
    maxp = math.ceil(math.log2(maxp)) + temp

print(ans, maxp)

from math import log, ceil

def factor1(n):
    num = 2
    res = set()
    while num ** 2 <= n:
        while n % num == 0:
            res.add(num)
            n = n // num
        num += 1
    if n > 1:
        res.add(n)
    ans = 1
    for x in res:
        ans *= x
    return ans

def factor(n):
    num = 2
    res = dict()
    while num ** 2 <= n:
        while n % num == 0:
            res[num] = res.get(num, 0) + 1
            n = n // num
        num += 1
    if n > 1:
        res[n] = res.get(n, 0) + 1
    return res

n = int(input())
print(factor1(n), ceil(log(max(factor(n).values()), 2)) + 1)

from math import log, ceil

def factor1(n):
    num = 2
    res = set()
    while num ** 2 <= n:
        while n % num == 0:
            res.add(num)
            n = n // num
        num += 1
    if n > 1:
        res.add(n)
    ans = 1
    for x in res:
        ans *= x
    return ans

def factor(n):
    num = 2
    res = dict()
    while num ** 2 <= n:
        while n % num == 0:
            res[num] = res.get(num, 0) + 1
            n = n // num
        num += 1
    if n > 1:
        res[n] = res.get(n, 0) + 1
    return res

n = int(input())
min_ = factor1(n)
kek = sorted(factor(n).values())
if min_ == n:
    print(n, 0)
elif kek[0] == kek[-1] and log(kek[-1], 2) // 1 == log(kek[-1], 2):
    print(min_, int(log(n, min_)) - 1)
else:
    print(min_, ceil(log(kek[-1], 2)) + 1)

import math
# https://codeforces.com/problemset/problem/1062/B
def B1062(n):
    dictionary = dict()
    value = 1
    while (n % 2 == 0):
        dictionary[2] = 1 + dictionary.get(2, 0)
        n = n/2
        value = 2

    for prime in range(3, int(math.sqrt(n))+1, 2):
        found_prime = False
        while n % prime == 0:
            dictionary[prime] = dictionary.get(prime, 0)  + 1
            n = n/prime
            if not found_prime:
                value *= prime
                found_prime = True

    if (n>2):
        dictionary[n] = dictionary.get(n, 0) + 1
        value *= n

    steps  = 0

    max_power = max(dictionary.values())
    math_log = math.log(max_power, 2)

    if max_power == 1:

        print(n, 0)
        return
    if int(math_log) *  2 != max_power :
        steps += int(math_log) + 1
    else:
        if all(list(map(lambda x: int(math.log(x, 2)) * 2   == x, dictionary.values()))):
            steps = int(math_log)
        else:
            steps = int(math_log) + 1

    print(value, steps)

#!/usr/bin/env python
"""
This file is part of https://github.com/Cheran-Senthil/PyRival.
Copyright 2019 Cheran Senthilkumar <hello@cheran.io>

"""
from __future__ import division, print_function

import cmath
import itertools
import math
import operator as op
import random
import sys
from atexit import register
from bisect import bisect_left, bisect_right
from collections import Counter
# from copy import deepcopy
# from decimal import Decimal
# from difflib import SequenceMatcher
from functools import reduce
# from heapq import heappop, heappush
from io import BytesIO, FileIO, StringIO

if sys.version_info[0] < 3:
    class dict(dict):
        """dict() -> new empty dictionary"""
        def items(self):
            """D.items() -> a set-like object providing a view on D's items"""
            return dict.iteritems(self)

        def keys(self):
            """D.keys() -> a set-like object providing a view on D's keys"""
            return dict.iterkeys(self)

        def values(self):
            """D.values() -> an object providing a view on D's values"""
            return dict.itervalues(self)

    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

def gcd(x, y):
    """greatest common divisor of x and y"""
    while y:
        x, y = y, x % y
    return x

INP_FILE = 0
OUT_FILE = 1

if sys.version_info[0] < 3:
    sys.stdin = BytesIO(FileIO(INP_FILE).read())
    sys.stdout = BytesIO()
    register(lambda: FileIO(OUT_FILE, 'w').write(sys.stdout.getvalue()))
else:
    sys.stdin = StringIO(FileIO(INP_FILE).read().decode())
    sys.stdout = StringIO()
    register(lambda: FileIO(OUT_FILE, 'w').write(sys.stdout.getvalue().encode()))

input = lambda: sys.stdin.readline().rstrip('\r\n')

def memodict(f):
    """ Memoization decorator for a function taking a single argument. """
    class memodict(dict):
        def __missing__(self, key):
            ret = self[key] = f(key)
            return ret
    return memodict().__getitem__

def is_prime(n):
    """
    Deterministic variant of the Miller-Rabin primality test to determine
    whether a given number (upto 2**64) is prime.

    Parameters
    ----------
    n : int
        n >= 0, an integer to be tested for primality.

    Returns
    -------
    bool
        False if n is composite, otherwise True.
    """
    if n in [2, 3, 5, 13, 19, 73, 193, 407521, 299210837]:
        return True

    if (n in [0, 1]) or (any((n % p) == 0 for p in [2, 3, 5, 13, 19, 73, 193, 407521, 299210837])):
        return False

    d, s = n - 1, 0
    while not d % 2:
        d, s = d >> 1, s + 1

    def try_composite(a):
        if pow(a, d, n) == 1:
            return False
        for i in range(s):
            if pow(a, 2**i * d, n) == n - 1:
                return False
        return True

    return not any(try_composite(w) for w in [2, 325, 9375, 28178, 450775, 9780504, 1795265022])

@memodict
def pollard_rho(n):
    if n == 1:
        return Counter()

    if is_prime(n):
        return Counter({n: 1})

    y, c, m = random.randint(1, n - 1), random.randint(1, n - 1), random.randint(1, n - 1)
    g, r, q = 1, 1, 1

    while g == 1:
        x, k = y, 0

        for _ in range(r):
            y = (y*y + c) % n

        while (k < r) and (g == 1):
            ys = y

            for _ in range(min(m, r - k)):
                y = (y*y + c) % n
                q = (q * abs(x - y)) % n

            g = gcd(q, n)
            k += m

        r *= 2

    if g == n:
        while True:
            ys = (ys*ys + c) % n
            g = gcd(abs(x - ys), n)
            if g > 1:
                break

    return pollard_rho(g) + pollard_rho(n // g)

def factors(n):
    """
    Prime factorization using Pollard's rho algorithm.

    Parameters
    ----------
    n : int
        n > 0, an integer to be factorized.

    Returns
    -------
    prime_factors : Counter
        Counter of the prime factors of n.
    """
    prime_factors = Counter()

    def ilog(n, p):
        cnt = 0
        while n % p == 0:
            n, cnt = n // p, cnt + 1
        return n, cnt

    if n % 2 == 0:
        n, prime_factors[2] = ilog(n, 2)
    if n % 3 == 0:
        n, prime_factors[3] = ilog(n, 3)

    i = 5
    while i * i <= min(n, 4294967295):
        if n % i == 0:
            n, prime_factors[i] = ilog(n, i)
        i += 2 if i % 3 == 2 else 4

    if n == 1:
        return prime_factors

    if n <= 4294967295:
        prime_factors[n] = 1
        return prime_factors

    return prime_factors + pollard_rho(n)

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

    f = factors(n)
    p = list(f.values())

    a2 = (max(p) - 1).bit_length()
    print(reduce(op.mul, f.keys()), (len(set(p)) != {1 << a2}) + a2)

if __name__ == '__main__':
    main()

def prime_factors(a):
	if a==1:
		return(1,0)
	factors={}
	i=2
	orig=a
	while i <= (int(orig**0.5)+1):
		while a%i==0:
			a=a//i
			if i in factors:
				factors[i]+=1
			else:
				factors[i]=1
		i+=1
	if a>1:
		factors[a]=1
	#print(factors)
	if sorted(factors)[-1]==orig:
		return(N,0)
	multiple=1
	for i in factors:
		multiple*=i
	if orig==multiple**2:
		return(int(orig**0.5),1)
	elif orig==multiple:
		return (orig,0)
	something=sorted([factors[i] for i in factors])
	counter=0
	#print(something[-1])
	while 2**counter<something[-1]:
		counter+=1
	if all([x==something[0] for x in something]):
		return multiple,counter
	return multiple,counter+1

N=int(input())
print(*prime_factors(N))

def prime_factors(a):
	if a==1:
		return(1,0)
	factors={}
	i=2
	orig=a
	while i <= (int(orig**0.5)+1):
		while a%i==0:
			a=a//i
			if i in factors:
				factors[i]+=1
			else:
				factors[i]=1
		i+=1
	if a>1:
		factors[a]=1
	if sorted(factors)[-1]==orig:
		return(N,0)
	multiple=1
	for i in factors:
		multiple*=i
	if orig==multiple**2:
		return(int(orig**0.5),1)
	elif orig==multiple:
		return (orig,0)
	something=sorted([factors[i] for i in factors])
	counter=0
	while counter*2<something[-1]:
		counter+=1
	return multiple,counter+1

N=int(input())
print(*prime_factors(N))

from collections import Counter
import math
n = int(input())
def getFactors(x):
    f = []
    if x == 1:
        return [1]
    j = 2
    while x >= 2:
        if x % j == 0:
            f.append(j)
            x = x // j
        else:
            j += 1
    return f
c = Counter(getFactors(n))
minm = 1
for x in c:
    minm *= x
maxm = max(c.values())
i = 0
f = 1
while maxm > f:
    i += 1
    f *= 2
if maxm == 1 or (len(c) == 1 and int(math.pow(2, i)) == maxm):
    ans = i
else:
    ans = i + 1
print(minm, ans)

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File              : bb.py
# Author            : recurze
# Date              : 21:32 14.11.2018
# Last Modified Date: 21:46 14.11.2018

from collections import defaultdict
def factors(n):
    d = defaultdict(int)
    if n < 2:
        return d
    while not n&1:
        n>>=1
        d[2]+=1
    while not n%3:
        n/=3
        d[3]+=1
    x = 5
    while x*x<=n:
        while not n%x:
            n/=x
            d[x]+=1
        x += 2
        while not n%x:
            n/=x
            d[x]+=1
        x += 4
    if n > 1:
        d[n]+=1
    return d

d = factors(int(raw_input()))
l = d.values()
m = max(l)

def num(d):
    ret = 1
    for i in d:
        ret*=i
    return ret

print num(d), ([m]*len(l) != l) + len(bin(m)[2:]) - (not m&(m-1))

n = int(input())
n1 = n
ans = 1
maxcnt = 0
flag = 0
for i in range(2,n1 + 1):
	if i > n:
		break
	if n % i == 0:
		ans *= i
		cnt = 0
		while n % i == 0:
			n /= i
			cnt += 1
		if cnt != maxcnt and maxcnt > 0:
			flag = 1
		if cnt > maxcnt:
			maxcnt = cnt

myb = [1, 2, 4, 8, 16, 32]

if maxcnt not in myb:
	flag = 1

for i in range(len(myb)):
	if myb[i] >= maxcnt:
		anscnt = i
		break

print(ans, anscnt + flag)

import math

def B1062(n):

    dictionary = dict()
    if n == 1:
        print(n, 0)
        return
    value = 1
    while (n % 2 == 0):
        dictionary[2] = 1 + dictionary.get(2, 0)
        n = n/2
        value = 2

    for prime in range(3, int(math.sqrt(n))+1, 2):
        found_prime = False
        while n % prime == 0:
            dictionary[prime] = dictionary.get(prime, 0)  + 1
            n = n/prime
            if not found_prime:
                value *= prime
                found_prime = True

    if (n>2):
        dictionary[n] = dictionary.get(n, 0) + 1
        value *= n

    steps  = 0

    max_power = max(dictionary.values())
    math_log = math.log(max_power, 2)

    if max_power == 1 :

        print(n, 0)
        return

    if max_power == 2:
        steps = 2
    elif all(list(map(lambda x: int(math.log(x, 2))  ==  math.log(x,2), dictionary.values()))):
        steps = int(math_log)
    else:
        if int(math_log) == math_log: # max power is squared
            # we add one for the "squaredfication"
            steps =  int(math_log)  +1
        else:
            steps = int(math_log) + 1  + 1

    #print(value, steps)
    print(" ".join([str(int(value)), str(steps)]))

B1062(int(input()))

from sys import stdin
from collections import deque
mod = 10**9 + 7
import sys
sys.setrecursionlimit(10**5)
from queue import PriorityQueue
# def rl():
#     return [int(w) for w in stdin.readline().split()]
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt,factorial,gcd,log2,inf,ceil
# map(int,input().split())
# # l = list(map(int,input().split()))
# from itertools import permutations
import heapq
# input = lambda: sys.stdin.readline().rstrip()
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop

n = int(input())

l = []

for i in range(1,10**6 + 1):
    l.append(i**2)
fin = 0
prev = -1
while True:
    flag = 0
    bo = []

    for i in l:

        if i%n == 0:

            bo.append(i)
    mini = inf
    yo = 0
    lo = 0
    if bo == []:
        break

    for i in bo:
        cnt = 0
        j = i

        while int(sqrt(i)) == sqrt(i):

            i = int(sqrt(i))
            cnt+=1

            if mini>i:

                yo = cnt
                lo = j
                mini = i

            if i == 1:
                break

    if prev == mini:
        break

    if lo != n:
        fin+=1

    n = mini
    prev = n
    fin+=yo

print(n,fin)

import math
n=int(input())
arr=[]
for i in range(2,n+1):
	if n%i==0:
		cnt=0
		while n%i==0:
			cnt+=1
			n=n//i
		arr.append([i,cnt])
# print(arr)
mul=0
mn=1
st=0
for i in range(len(arr)):
	mn=mn*arr[i][0]
	xx=int(math.log(arr[i][1]))
	# print(xx,(1<<xx))
	if arr[i][1]>(1<<xx):
		xx+=1
	st=max(st,xx)
for i in range(len(arr)):
	if arr[i][1]<(1<<st):
		mul=1
print(mn,st+mul)

import math
def primeFactors(n):
    if n%2==0:
        dict1[2]=0
    while n % 2 == 0:
        dict1[2]+=1
        n = n // 2
    for i in range(3,int(math.sqrt(n))+1,2):
        if  n%i==0:
            dict1[i]=0
        while n % i== 0:
            dict1[i]+=1
            n = n //i
    if n > 2:
        dict1[n]=0
        dict1[n]+=1
n=int(input())
if n==1:
    print(1,0)
else:
    dict1={}
    primeFactors(n)
    max1=1
    lst=[]
    for i in dict1:
        lst.append(dict1[i])
    if max(lst)==min(lst) and  max(lst)==1:
        print(n,0)
    elif max(lst)==min(lst):
        prod=1
        for i in  dict1:
            prod*=i
        print(prod,math.ceil(math.log2(max(lst))))
    else:
        prod=1
        for i in dict1:
            prod*=i
        print(prod,math.ceil(math.log2(max(lst)))+1)