A big company decided to launch a new series of rectangular displays, and decided that the display must have exactly n pixels. Your task is to determine the size of the rectangular display — the number of lines (rows) of pixels a and the number of columns of pixels b, so that:  there are exactly n pixels on the display;  the number of rows does not exceed the number of columns, it means a ≤ b;  the difference b - a is as small as possible.

The first line contains the positive integer n (1 ≤ n ≤ 106) — the number of pixels display should have.

Print two integers — the number of rows and columns on the display.

NoteIn the first example the minimum possible difference equals 2, so on the display should be 2 rows of 4 pixels.In the second example the minimum possible difference equals 0, so on the display should be 8 rows of 8 pixels.In the third example the minimum possible difference equals 4, so on the display should be 1 row of 5 pixels.

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <ctime>
#include <cstdlib>
#include <queue>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef short int int16;
typedef long double ldouble;

typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

template<typename X> inline X abs(const X& a) { return a < 0? -a: a; }
template<typename X> inline X sqr(const X& a) { return a * a; }

const int INF = 1e9+1;
const LL INF1 = 1e18 + 1;
const int size = 1e5 + 2;
const double eps = 0.0001;
const ldouble PI = 3.1415926535897932384626433832795;

const int MOD = 1000000007;
const int INF2 = 0x3f3f3f3f;
const LL INFF = 1LL << 60;

#define MEMS(a,b) memset((a),(b),sizeof(a))
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
void solution();
void include_file();
LL bin_search(LL left, LL right);

int main(){
ios_base::sync_with_stdio(false);
//srand(time(0));
//include_file();
solution();
return 0;
}
void include_file(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}

vector <vector<int> > g;
int was[100];
void dfs(int v)
{
	if (was[v]) return;
	was[v]=1;
	for (int i=0;i<g[v].size();++i)
	{
		dfs(g[v][i]);
	}
}
int bfs(int s,int toto)
{
queue<int> q;
vector<bool> used (1001);
vector<int> d (1001), p (1001);

q.push (s);
used[s] = true;
p[s] = 1;
d[s]=0;
while (!q.empty()) {
	int v = q.front();
	q.pop();
	for (size_t i=0; i<g[v].size(); ++i) {
		int to = g[v][i];
		if (!used[to]) {
			used[to] = true;
			q.push (to);
			d[to] = d[v] + 1;
			p[to] = v;
		}
	}
}

return d[toto];
}
void yes()
{
	cout<<"YES";
}
void no()
{
	cout<<"NO";
}
///////////////////SOLUTION

void solution()
{
	int n;
	cin>>n;
	int k=INF;
	for(int i=1;i*i<=n;++i)
	{
		if(n%i==0)k=i;
	}
	cout<<k<<" "<<n/k;
}
///////////////////SOLUTION
namespace BO{

inline bool _1(int x, int i){return bool(x&1<<i);}
inline bool _1(LL x, int i){return bool(x&1LL<<i);}
inline LL _1(int i){return 1LL<<i;}
inline LL _U(int i){return _1(i) - 1;};

inline int reverse_bits(int x){
    x = ((x >> 1) & 0x55555555) | ((x << 1) & 0xaaaaaaaa);
    x = ((x >> 2) & 0x33333333) | ((x << 2) & 0xcccccccc);
    x = ((x >> 4) & 0x0f0f0f0f) | ((x << 4) & 0xf0f0f0f0);
    x = ((x >> 8) & 0x00ff00ff) | ((x << 8) & 0xff00ff00);
    x = ((x >>16) & 0x0000ffff) | ((x <<16) & 0xffff0000);
    return x;
}

inline LL reverse_bits(LL x){
    x = ((x >> 1) & 0x5555555555555555LL) | ((x << 1) & 0xaaaaaaaaaaaaaaaaLL);
    x = ((x >> 2) & 0x3333333333333333LL) | ((x << 2) & 0xccccccccccccccccLL);
    x = ((x >> 4) & 0x0f0f0f0f0f0f0f0fLL) | ((x << 4) & 0xf0f0f0f0f0f0f0f0LL);
    x = ((x >> 8) & 0x00ff00ff00ff00ffLL) | ((x << 8) & 0xff00ff00ff00ff00LL);
    x = ((x >>16) & 0x0000ffff0000ffffLL) | ((x <<16) & 0xffff0000ffff0000LL);
    x = ((x >>32) & 0x00000000ffffffffLL) | ((x <<32) & 0xffffffff00000000LL);
    return x;
}

template<class T> inline bool odd(T x){return x&1;}
template<class T> inline bool even(T x){return !odd(x);}
template<class T> inline T low_bit(T x) {return x & -x;}
template<class T> inline T high_bit(T x) {T p = low_bit(x);while (p != x) x -= p, p = low_bit(x);return p;}
template<class T> inline T cover_bit(T x){T p = 1; while (p < x) p <<= 1;return p;}

inline int low_idx(int x){return __builtin_ffs(x);}
inline int low_idx(LL x){return __builtin_ffsll(x);}
inline int high_idx(int x){return low_idx(reverse_bits(x));}
inline int high_idx(LL x){return low_idx(reverse_bits(x));}
inline int clz(int x){return __builtin_clz(x);}
inline int clz(LL x){return __builtin_clzll(x);}
inline int ctz(int x){return __builtin_ctz(x);}
inline int ctz(LL x){return __builtin_ctzll(x);}
inline int parity(int x){return __builtin_parity(x);}
inline int parity(LL x){return __builtin_parityll(x);}
inline int lg2(int a){return 31 - clz(a);}
inline int lg2(LL a){return 63 - clz(a);}
inline int count_bits(int x){return __builtin_popcount(x);}
inline int count_bits(LL x){return __builtin_popcountll(x);}

} using namespace BO;//}
// <<= '2. Number Theory .,//{
namespace NT{
inline LL __lcm(LL a, LL b){return a*b/__gcd(a,b);}
inline void INC(int &a, int b){a += b; if (a >= MOD) a -= MOD;}
inline int sum(int a, int b){a += b; if (a >= MOD) a -= MOD; return a;}
inline void DEC(int &a, int b){a -= b; if (a < 0) a += MOD;}
inline int dff(int a, int b){a -= b; if (a < 0) a  += MOD; return a;}
inline void MUL(int &a, int b){a = (LL)a * b % MOD;}
inline int pdt(int a, int b){return (LL)a * b % MOD;}

inline int sum(int a, int b, int c){return sum(sum(a, b), c);}
inline int sum(int a, int b, int c, int d){return sum(sum(a, b), sum(c, d));}
inline int pdt(int a, int b, int c){return pdt(pdt(a, b), c);}
inline int pdt(int a, int b, int c, int d){return pdt(pdt(pdt(a, b), c), d);}

inline int pow(int a, int b){
    int c(1); while (b){
        if (b&1) MUL(c, a);
        MUL(a, a), b >>= 1;
    }
    return c;
}

inline int pow(int a, LL b){
    int c(1); while (b){
        if (b&1) MUL(c, a);
        MUL(a, a), b >>= 1;
    }
    return c;
}

template<class T> inline T pow(T a, LL b){
    T c(1); while (b){
        if (b&1) c *= a;
        a *= a, b >>= 1;
    }
    return c;
}

inline int _I(int b){
    int a = MOD, x1 = 0, x2 = 1, q;
    while (true){
        q = a / b, a %= b;
        if (!a) return (x2 + MOD) % MOD;
        DEC(x1, pdt(q, x2));

        q = b / a, b %= a;
        if (!b) return (x1 + MOD) % MOD;
        DEC(x2, pdt(q, x1));
    }
}

inline void DIV(int &a, int b){MUL(a, _I(b));}
inline int qtt(int a, int b){return pdt(a, _I(b));}

inline int phi(int n){
    int res = n; for (int i=2;sqr(i)<=n;++i) if (!(n%i)){
        DEC(res, qtt(res, i));
        do{n /= i;} while(!(n%i));
    }
    if (n != 1)
        DEC(res, qtt(res, n));
    return res;
}

} using namespace NT;//}
//}

/** Miscellaneous .. **/ //{
// <<= 'Random Event .. . //{
namespace RNG{
//srand((unsigned)time(NULL));
inline unsigned int rand16(){return ((rand()) << 15) ^ rand();}
inline unsigned int rand32(){return (rand16() << 16) | rand16();}
inline ULL rand64(){return ((LL)rand32() << 32) | rand32();}
inline ULL random(LL l, LL r){return l == r ? l : rand64() % (r - l) + l;}
int dice(){return rand() % 6;}
bool coin(){return bool(rand() % 2);}
} using namespace RNG;
namespace Math{
	typedef long long typec;
	///Lib functions
	typec GCD(typec a, typec b)
	{
		return b ? GCD(b, a % b) : a;
	}
	typec extendGCD(typec a, typec b, typec& x, typec& y)
	{
		if(!b) return x = 1, y = 0, a;
		typec res = extendGCD(b, a % b, x, y), tmp = x;
		x = y, y = tmp - (a / b) * y;
		return res;
	}
	///for x^k
	typec power(typec x, typec k)
	{
		typec res = 1;
		while(k)
		{
			if(k&1) res *= x;
			x *= x, k >>= 1;
		}
		return res;
	}
	///for x^k mod m
	typec powerMod(typec x, typec k, typec m)
	{
		typec res = 1;
		while(x %= m, k)
		{
			if(k&1) res *= x, res %= m;
			x *= x, k >>=1;
		}
		return res;
	}
	/***************************************
	Inverse in mod p^t system
	***************************************/
	typec inverse(typec a, typec p, typec t = 1)
	{
		typec pt = power(p, t);
		typec x, y;
	    y = extendGCD(a, pt, x, y);
		return x < 0 ? x += pt : x;
	}
	/***************************************
	Linear congruence theorem
	x = a (mod p)
	x = b (mod q)
	for gcd(p, q) = 1, 0 <= x < pq
	***************************************/
	typec linearCongruence(typec a, typec b, typec p, typec q)
	{
		typec x, y;
		y = extendGCD(p, q, x, y);
		while(b < a) b += q / y;
		x *= b - a, x = p * x + a, x %= p * q;
		if(x < 0) x += p * q;
		return x;
	}
	/***************************************
	prime table
	O(n)
	***************************************/
	const int PRIMERANGE = 1000000;
	int prime[PRIMERANGE + 1];
	int getPrime()
	{
		memset (prime, 0, sizeof (int) * (PRIMERANGE + 1));
		for (int i = 2; i <= PRIMERANGE; i++)
		{
			if (!prime[i]) prime[++prime[0]] = i;
			for (int j = 1; j <= prime[0] && prime[j] <= PRIMERANGE / i; j++)
			{
				prime[prime[j]*i] = 1;
				if (i % prime[j] == 0) break;
			}
		}
		return prime[0];
	}
	/***************************************
	get factor of n
	O(sqrt(n))
	factor[][0] is prime factor
	factor[][1] is factor generated by this prime
	factor[][2] is factor counter

	need: Prime Table
	***************************************/
	///you should init the prime table before
	int factor[100][3], facCnt;
	int getFactors(int x)
	{
		facCnt = 0;
		int tmp = x;
		for(int i = 1; prime[i] <= tmp / prime[i]; i++)
		{
			factor[facCnt][1] = 1, factor[facCnt][2] = 0;
			if(tmp % prime[i] == 0)
				factor[facCnt][0] = prime[i];
			while(tmp % prime[i] == 0)
				factor[facCnt][2]++, factor[facCnt][1] *= prime[i], tmp /= prime[i];
			if(factor[facCnt][1] > 1) facCnt++;
		}
		if(tmp != 1)
			factor[facCnt][0] = tmp, factor[facCnt][1] = tmp, factor[facCnt++][2] = 1;
		return facCnt;
	}
	typec combinationModP(typec n, typec k, typec p)
	{
		if(k > n) return 0;
		if(n - k < k) k = n - k;
		typec a = 1, b = 1, x, y;
		int pcnt = 0;
		for(int i = 1; i <= k; i++)
		{
			x = n - i + 1, y = i;
			while(x % p == 0) x /= p, pcnt++;
			while(y % p == 0) y /= p, pcnt--;
			x %= p, y %= p, a *= x, b *= y;
			b %= p, a %= p;
		}
		if(pcnt) return 0;
		extendGCD(b, p, x, y);
		if(x < 0) x += p;
		a *= x, a %= p;
		return a;
	}
};using namespace Math;

#include<iostream>
using namespace std;

int main(){
    int n;
    cin>>n;
    int a,b;
    for(int i=1;i*i<=n;i++){
        if(n%i==0){
            a=i;b=n/i;
        }
    }
    cout<<a<<" "<<b<<endl;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pf push_front
#define ppb pop_back
#define mp make_pair
#define ll long long
#define ld long double
#define al 0x3F3F3F3F
#define ull unsigned long long
#define PI pair < int, int >
#define sz(x) x.size()
#define all(x) x.begin(), x.end()
#define in(a) insert(a)
#define ppf pop_front
#define int ll

const int mod = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 123;
const int N = 1e6 + 123;
const int INF = al;
const ll INFL = 3e18 + 1;
const double pi = acos(-1.0);
const double eps = 1e-9;

int n, a, b = 1;

inline void boost() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
}

inline void solve() {
    boost();
    cin >> n;
    for (int i = 1; i <= n; i++)
    	if (n % i == 0 && a < b) a = i, b = n / i;
    cout << b << " " << a;

}

main () {
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);

	solve();
}

#include <iostream>
#include <set>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <vector>
#define ull unsigned long long
#define loop(x,n) for(int x = 0; x < n; x++)

ull c2(ull n) {
	return (n*(n - 1)) / 2;
}

using namespace std;

int main() {
	//while (true) {
		int n;
		cin >> n;
		if ((int)sqrt(n) == sqrt(n)) {
			cout << sqrt(n) << ' ' << sqrt(n) << endl;

		}
		else {
			int s = sqrt(n);

			for (int i = s; i <= n; i++) {
				//cout << i << ' ';
				if (n % i == 0) {
					cout << min(i,n/i) << ' ' << max(i, n / i) << endl;
					break;
				}
			}
		}
	//}
}

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int x;cin>>x;
	for(int i=sqrt(x);i>=1;i--)
		for(int j=sqrt(x);j<=x;j++)
			if(i*j==x) {cout<<i<<" "<<j;return 0;}
}

#include<bits/stdc++.h>
using namespace std;
int a;
int main(){
    cin>>a;
    for(int i=int(sqrt(a));i>=1;i--){
        if (i*(a/i)==a){
            cout<<i<<" "<<a/i<<endl;
            return 0;
        }
    }
}

#include<bits/stdc++.h>
using namespace std;
pair<int,int>pr;
int main()
{
	int a,b,n;
	cin>>n;
	if(n==1)
	cout<<"1 1"<<endl;
	else
	{

	a=1;b=n;
	for(int i=2;a<=b;i++)
	{ pr.first=a;pr.second=b;
		if(n%i==0)
		{
			a=i;b=n/i;
		}

	}
	cout<<pr.first<<" "<<pr.second<<endl;
}
}

#include <bits/stdc++.h>
using namespace std;
int main() {
    long long int i,j,n,t;
    cin>>n;
    for(i=1;i*i<=n;i++)
    if(n%i==0)j=i;
    cout<<j<<" "<<n/j;
    return 0;}

#include<bits/stdc++.h>
using namespace std;
long long n,x=1,y,x2,y2;
int main()
{
    cin>>n;
    y=n;
    for (int i=2; i<=round(sqrt(n)); ++i){
        for (int j=2; j<=n/2; ++j){
            if (i*j==n&&i<=j) {
                if (j-i<y-x) x=i,y=j;
            }
        }
    }
    cout<<x<<" "<<y;
}

#include <fstream>
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <cmath>
#include <ctime>
#include <algorithm>

using namespace std;
const int INF = int(2e9);

int main()
{
#ifdef MY_DEBUG
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif

  int n;
  cin >> n;
  int t = sqrt((float)n);
  for(int i = t; i > 0; i--)
  {
    int j = n/i;
    if(j*i==n)
    {
      cout << min(j,i) <<" " << max(j, i);
      return 0;
    }

  }

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,k;
	scanf("%d",&n);
	k=sqrt(n);
	for(int i=k;i>=1;i--)
	{
		for(int j=k;j<=n;j++)
		{
			if(i*j==n){cout<<i<<' '<<j;return 0;}
			if(i*j>n)break;
		}
	}
}

#include<bits/stdc++.h>
#define clr(a) memset(a,0,sizeof(a))
#define ll long long
#define INF INT_MAX
#define endl '\n'
#define loop1(i,n) for(int i=0;i<n;i++)
#define loop2(i,n) for(int i=1;i<=n;i++)
#define mp make_pair
//#pragma  warning(disable: 4996)
using namespace std;
const int N = 2e6+ 7;
typedef  pair<int, int>pii;
int Dx[] = { 1,0,-1,0,1,1,-1,-1 };
int Dy[] = { 0,1,0,-1,1,-1,1,-1 };
ll gcd(ll a, ll b) {
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
ll powm(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b % 2)res *= a;
        a *= a;
        b /= 2;

    }
    return res;
}

int main()
{
    // freopen("chief.in", "r", stdin);
     // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(0), cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    int mn = INF;
    int a, b;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            if (mn > abs(n - i / i)) {
               // cout << i << " " << n  / i;
              //  break;
                a = i;
                b = n / i;
            }
        }
    }
    cout << a << " " << b;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,c;
    cin>>n; c=sqrt(n);
    for(int i=c; i>=1; i--)
    {
        for(int k=c; k<=n; k++)
        {
            if(i*k==n)
            {
                cout<<i<<" "<<k;
                return 0;
            }
        }
    }
    return 0;
}

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
using namespace std;

int main(){
int n;
cin>>n;
if(n==2){
    cout<<1<<" "<<2<<endl;
    return 0;
}
for(int i=sqrt(n)+1;i>=1;i--)
if(n%i==0){
        if(i<=n/i)
    cout<<i<<" "<<n/i<<endl;

    else cout<<n/i<<" "<<i<<endl;
break;
}
}

#include <stdio.h>
#include <math.h>
int main()
{
    long n;
    while(scanf("%ld",&n)!=EOF)
    {
        long row,colomn;
        row=(long)sqrt(n)+1;
        while(row--)
        {
            if(n%row==0)
            {
                colomn = n/row;
                break;
            }
        }
    printf("%ld %ld\n",row,colomn);
    }
}

#include<iostream>
#include<math.h>
using namespace std;
int main(){
	long long n,x=1,b,i=1;
	float s;
	cin >> n;
	x = sqrt(n);
	s = sqrt(n);
		if (x == s){ cout << x << " " << x << endl; return 0; }
		if (1){
			b = n;
			i = b;
			while (true){
				if (b*i == n){ cout << b << " " << i << endl; break; }
				i++;
				if (b*i > n){ b--; i = b; }
			}
		}

	return 0;
}

#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n,i,j;
cin>>n;
for(i=sqrt(n);i>=1;i--)
for(j=sqrt(n);j<=n;j++)
if(i*j==n) {cout<<i<<" "<<j<<endl; return 0;}
}

#include<bits/stdc++.h>

#define inf 0x3f3f3f3f
#define INF 0x3f3f3f3f3f3f3f3fLL
#define mod 1000000007
#define pb emplace_back
#define sq(x) ((x)*(x))
#define sz(a) ((int)a.size())
#define eps 1e-8
#define x first
#define y second
#define bpt(x) (__builtin_popcount(x))
#define bptl(x) (__builtin_popcountll(x))
#define bit(x, y) (((x)>>(y))&1)
#define bclz(x) (__builtin_clz(x))
#define bclzl(x) ((x) ? (__builtin_clzll(x)) : 0)
#define bctz(x) (__builtin_ctz(x))
#define bctzl(x) (__builtin_ctzll(x))
#define shit(a) (1 << (a))
#define rev(a) (power(a, mod-2, mod))
#define PQ priority_queue<pii, vector<pii>, greater<pii> >

using namespace std;

typedef double DO;
typedef long long INT;
typedef pair<int, int> pii;
typedef pair<pii, int> ppi;
typedef vector<int> VI;

template<typename T, typename U> inline void smin(T &a, U b) {if(a>b) a=b;}
template<typename T, typename U> inline void smax(T &a, U b) {if(a<b) a=b;}

template<class T>inline void gn(T &x) {char c, sg=0; while (c=getchar(), (c>'9' || c<'0') && c!='-');for((c=='-'?sg=1, c=getchar():0), x=0; c>='0' && c<='9'; c=getchar()) x=(x<<1)+(x<<3)+c-'0';if (sg) x=-x;}
template<class T>inline void print(T x) {if (x<0) {putchar('-');return print(-x);}if (x<10) {putchar('0'+x);return;} print(x/10);putchar(x%10+'0');}
template<class T, class T1>inline void gn(T &x, T1 &y) {gn(x); gn(y);}
template<class T, class T1, class T2>inline void gn(T &x, T1 &y, T2 &z) {gn(x); gn(y); gn(z);}
template <class T> inline void println(T x) {print(x); putchar('\n');}
template <class T> inline void printsp(T x) {print(x); putchar(' ');}
template <class T1, class T2> inline void print(T1 x1, T2 x2) {printsp(x1), println(x2);}
template <class T1, class T2, class T3> inline void print(T1 x1, T2 x2, T3 x3) {printsp(x1), printsp(x2), println(x3);}
template <class T1, class T2, class T3, class T4> inline void print(T1 x1, T2 x2, T3 x3, T4 x4) {printsp(x1), printsp(x2), printsp(x3), println(x4);}
template <class T> inline void eprint(T x) {cerr << "--------> " <<x << endl;}
template <class T1, class T2> inline void eprint(T1 x, T2 y) { cerr << "--------> " << x << ' ' << y << endl; }
template <class T1, class T2, class T3> inline void eprint(T1 x, T2 y, T3 z) { cerr << " -------> " << x << ' ' << y << ' ' << z << endl;}
template <class T1, class T2, class T3, class T4> inline void eprint(T1 x, T2 y, T3 z, T4 w) { cerr << " -------> " << x << ' ' << y << ' ' << z << ' ' << w << endl;}
int power(int a, int b, int m, int ans=1) {
	for(; b; b>>=1, a=1LL*a*a%m) if(b&1) ans=1LL*ans*a%m;
	return ans;
}

int main() {
#ifndef	ONLINE_JUDGE
	freopen("in.in", "r", stdin);
//	freopen("out.out", "w", stdout);
#endif

	int n,a,b;
	cin>>n;

	for(int i=1;i<=sqrt(n);i++){
		if(n%i==0)a=i;
	}
	cout<<a<<' '<<n/a<<endl;
	return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <queue>
#include <stack>
#include <string>
#include <map>

#include <vector>

using namespace std;

#define INF 100000000
#define EPS 000000.1

#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define ABS(a) (((a) > 0) ? (a) : (-(a)))
#define LOOP(i, n) for(int i = 0; i < (n); i++)

typedef long long int lint;

int main()
{
	int n;
	int a, b;

	cin >> n;

	int s = sqrt(double(n));

	for (int i = 1; i <= s; i++)
	{
		if (n % i == 0)
			a = i;
	}

	cout << a << '\n' << n / a;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    for(int i=sqrt(n);i>=1;i--)
    {
        if(n%i==0)
        {
            cout<<i<<" "<<n/i;
            return 0;
        }
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x;
    cin>>x;
    int a;
    a=sqrt(x);
    int i=a;
    while(i!=0)
    {
        for(int j=a;j<=x;j++)
        {
            if(x==i*j)
            {
                cout<<i<<" "<<j;
                return 0;
            }
        }
        i--;
    }
}

#include <bits/stdc++.h>
using namespace std;
int main ()
{
  int n , a , b , max1 = 1e9;
  cin >> n;
  vector <pair <int , int> > v;
  for (int i = 1 ; i <= n ; i++)
    if (n%i == 0 && i <= n/i) v.push_back(make_pair(i,n/i));
    else if (i > n/i) break;
  for (auto i : v)
    if (abs(i.first-i.second) < max1)
      a = i.first , b = i.second , max1 = abs(i.first-i.second);
  cout << a << ' ' << b << '\n';
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int nax = 1e9 + 7;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    int min = nax;
    pair<int, int> p;
    p.first = 1;
    p.second = n;
    for(int i = 1; i <= n / 2; i++) {
        if(n % i == 0) {
            int a = n / i;
            if(abs(a - i) < min) {
                p.first = i;
                p.second = n / i;
                min = (n / i) - i;
            }
            //cout << i << " " << n / i << " : " << min << "\n";
        }
    }
    cout << p.first << " " << p.second << '\n';

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(false);
	int x,cnt=0;
	cin>>x;
	for(int i=sqrt(x); i>=1; i--)
		if(x%i==0) {
			cout<<i<<" "<<x/i<<endl;
			return 0;
		}
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n,a,b,c,d;
    long long i,m=INT_MAX;
    cin>>n;
    for(i=1;i<=n;i++){
        if(n%i==0){
            a=i;b=n/i;
            //if(i==1)    m=fabs(b-a);
            if(fabs(b-a)<=m)
            {
                c=a;d=b;m=d-c;
                }
        }
       // cout<<std::min(c,d)<<" "<<max(c,d)<<endl;

    }
    cout<<std::min(c,d)<<" "<<max(c,d);
    return 0;
}

#include <iostream>
#include <cmath>
using namespace std;
int c;
int main(){
    cin >> c;
    for(int i = sqrt(c); i >= 1; i --){
        if(c % i == 0){
            cout << min(i, c / i) << " " << max(i, c / i);
            break;
        }
    }
    return 0;
}

#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=sqrt(n);i>=1;i--)
	{
		if(n%i==0)
		{
			printf("%d %d",i,n/i);
			return 0;
		}
	}
	return 0;
}

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>

#define ll long long int
#define pll pair<long long, long long>
#define pii pair<int, int>
#define pb push_back
#define mp make_pair
#define getchar_unlocked getchar
#define F first
#define S second
#define MOD 1000000007

using namespace std;

int main() {
    int t;
    //cin >> t;
    t = 1;
    while(t--) {
        int n;
        cin >> n;
        int num;
        for(int i=1; i*i <= n; i++) {
            if(n%i == 0) num = i;
        }
        cout << num << " " << n/num << "\n";
    }
	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n,a,b;
	vector <int> divs;

	scanf("%d",&n);

	int i=1;

	while (i <= sqrt(n))
	{
		if (n % i == 0)
		{
			divs.push_back(i);

			if (i != (n/i))
			{
				divs.push_back(i);
			}
		}

		i++;
	}

	sort(divs.begin(),divs.end());

	int maxdiv=divs[divs.size()-1];

	a=min(n/maxdiv,maxdiv);
	b=max(n/maxdiv,maxdiv);

	printf("%d %d\n",a,b);

	return 0;
}

#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <queue>
#include <set>

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define INT_MAX 2147483647

using namespace std;

int n;

int main(){

    cin >> n;
    int a = 1, b = n, mi = b-1;

    FOR(i, 1, n){
        if(n % i == 0 ) {
            if (abs(i - (n / i)) < mi) {
            a = min(i, n / i);
            b = max(i, n / i);
                mi = abs(i - (n / i));

        }
        }

    }

    cout << a <<" " << b << endl;

    return 0;
}

#include <bits/stdc++.h>
#include<bitset>
using namespace std;
#define bye return 0
#define oo 0x3f3f3f3f
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define F  first
#define S  second
#define EPS 1e-15
#define khod push_back
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<int, int> mpii;
typedef map<ll, ll> mpll;
int dx[] = { 0, 1, -1, 0 };
int dy[] = { 1, 0, 0, -1 };
ld PI = 3.14159265358979323846264338327950;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.in", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	int n  ;
	cin>>n;
	int res = 0 ;
	int mn = 1e9 , f = 0 , s = 0 ;
	if(n==1)cout<<1<<" "<<1;
	else{
	for(int i = n-1 ; i >=1 ; i--){
		if(n%i==0){
			res = n/i;
			int x = abs(res-i);
			if(x<mn){
				mn= x ;
				f = res ;
				s = i;
			}
		}
	}
	cout<<min(f,s)<<" "<<max(f,s);
	}
	bye;
}

#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;

int main(){
    int n;
    cin>>n;
    bool k=false;
    int a,b;
    for(a=sqrt(n);a>0;a--){
        for(b=sqrt(n);b<=n;b++)
            if(a*b==n){
                k=true;
                break;
            }
        if(k==true){
            cout<<a<<" "<<b<<endl;
            break;
        }
    }
    return 0;
}

#include<iostream>
#include<math.h>

using namespace std;

int main(){

    int n,l,f,small=0,big=0;

    cin >> n;

    l = sqrt(n);

    //cout << l <<endl;

    for(int i=l ;i<=n ; i++){
        for(int j= l ; j>=1 ; j--){
            f=i*j;
            //cout << f <<endl;

            if(f==n){
                small = j;
                big = i;
                break;
            }
        }
        if(small>0) break;
    }

    cout << small  << " " << big <<endl ;
    return 0;
}

//
//  main.cpp
//  A. Display Size
//
//  Created by Esteban Arocha Ortuño on 9/19/17.
//  Copyright © 2017 EstebanAO. All rights reserved.
//

#include <iostream>
#include <math.h>
using namespace std;

int main() {
    int iNumber;
    int iRoot;
    cin>> iNumber;
    iRoot = sqrt(iNumber);

    for (int iC = iRoot; iC <= iNumber; iC++)
    {
        if (iNumber%iC == 0)
        {
            if (iC < iNumber/iC)
            {
                cout <<iC<< " "<<iNumber/iC;
                return 0;
            }
            else
            {
                cout<<iNumber/iC <<" "<<iC;
                return 0;
            }
        }
    }

    return 0;
}

#include <iostream>
#include <cmath>
//
using namespace std;

int main(){
	int n, a;
	cin >> n;
	a = ceil(sqrt(n));
	while(n % a != 0){
		a++;
	}
	cout << n / a << ' ' << a << endl;
}

#include<bits/stdc++.h>

using namespace std;

int main() {
  int n;
  cin >> n;
  int a = 1, b = n;
  for(int i=1; i*i<=n; i++) if(n % i == 0) {
    a = i, b = n / i;
  }
  cout << a << ' ' << b << endl;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,i,j,ans,ans1,small;
    while(cin>>n)
    {

        {
            small=1000000;
            for(i=n; i>=1; i--)
            {
                if(n%i==0)
                {
                    j=n/i;
                    if(i==j)
                    {
                        ans=j;
                        ans1=i;
                        break;
                    }
                    else if(i-j < small && j<=i)
                    {
                        ans=j;
                        ans1=i;
                        small=i-j;
                    }
                }

            }
            cout<<ans<<" "<<ans1<<endl;
        }
    }
}

#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	int a,b;
	cin>>n;
	int a1,b1;
	int dif=999999;
	for(int i=1;i*i<=n;i++)
	{
		if(n%i==0)
		{
			if(i>=(n/i))
			{
				a=n/i;
				b=i;
			}
			else
			{
				a=i;
				b=n/i;
			}
			if(dif>=(b-a))
			{
				dif=b-a;
				a1=a;
				b1=b;
			}
		}
	}
	cout<<a1<<" "<<b1<<endl;
}

#include <bits/stdc++.h>

using namespace std ;

#define sz(v) (int)v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )
#define PI acos( -1.0 )
//#define c_b fflush(stdin);

/*
int dx[ ] = { 0 , 0 , -1 , 1 , 1 , -1 , 1 , 1 } ;
int dy[ ] = { -1 , 1 , 0 , 0 , 1 , -1 ,-1 ,-1 } ;
*/

void File_input( string pathIn ){
    freopen( pathIn.c_str() , "r", stdin ) ;
}

void File_output( string pathOut ){
    freopen( pathOut.c_str() , "w", stdout ) ;
}

int msg(){
    srand( time( 0 ) ) ;
    vector < string > st = {
            "Wish everyone high ratings!",
            "Good luck!",
            "Have fun!",
            "Please, read all the problems!",
            "Go Go fight!" } ;
    cerr << st[ rand() % sz( st ) ] ;
    return 0 ;
}

void FastInputOutput() {
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

int n , x , y ;

int main(){

   fast

   cin >> n ;

   for( int i = 1 ; i * i <= n ; i++ ){
      if( n % i == 0 ){
           x = i ;
           y = n / i ;
      }
   }

   cout << x << " " << y ;

   return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <fstream>
#include <string>;
using namespace std;
int main()
{
	int n;
	cin >> n;
	int diff = n;
	int a = 1, b = n;
	for (int i = 1; i <= n / 2; i++)
	{
		if (n % i == 0)
		{
			int num1 = i;
			int num2 = n / i;
			//cout << "\t" << num1 << " " << num2 << endl;
			if (diff > max(num1, num2) - min(num1, num2))
			{
				a = min(num1, num2);
				b = max(num1, num2);
				diff = b - a;
				//cout << "\t" << diff << endl;
			}
		}
	}
	cout << a << " " << b << endl;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    int i,x,n,y;
    int min=1000000;
    double m;

    scanf("%d",&n);
   m=sqrt(n);

    for(i=1;i<=(int)m;i++)
    {
        if(n%i==0)
        {
            y=n/i-i;
            if(min>y)
            {
                min=y;
                x=i;
            }
        }
    }
    printf("%d %d",x,n/x);
    return 0;
}

#include<iostream>
#include<cmath>
#include <bits/stdc++.h>
#include<climits>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    long long int n;
    cin>>n;

    long long int diff=LLONG_MAX;
    int flag=0;
    long long int r,c;
    for(long long int i=1;i<=sqrt(n);i++)
    {
        if(n%i==0)
        {
            flag=1;
            long long int temp=n/i;
            long long int tempDiff=abs(temp-i);
            if(tempDiff<diff)
            {
                diff=tempDiff;
                if(temp<i)
                {
                    r=temp;
                    c=i;
                }
                else
                {
                    r=i;
                    c=temp;
                }
            }
        }
    }
    if(flag==0)
        cout<<"===\n";
    else
        cout<<r<<" "<<c<<"\n";
    return 0;
}

// in the name of god
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
//#include <unistd.h>
using namespace std ;
using namespace __gnu_pbds;
void operator+=(vector<int>&in1,const vector<int>&in2){for(int i=0;i<in2.size();i++)in1.push_back(in2[i]);}
#define y2 sdfklgjsdkfd
#define y1 sdfklgjsdkafd
#define L first
#define R second
#define X first
#define Y second
#define int long long
typedef long long ll ;
typedef long double ld ;
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ALL(x) (x).begin(),(x).end()
typedef pair < int , int > pii ;
typedef pair < int , pii > pi_ii ;
typedef pair < pii , int > pii_i ;
typedef pair < pii , pii > pii_ii ;
#define ordered_set(TYPE) tree<TYPE, null_type, less<TYPE>, rb_tree_tag, tree_order_statistics_node_update>
//#define "%I64d" "%I64d
const int mod = 1e9 + 7 ;
const int maxL = 22 ;
const ll inf = 1e16 ;
const int baze = 547 ;
const int maxn = 1e6 +10 ;
int n , x , ans ;

main ( )
{
  x = 1e9;
  ans = 1 ;
  cin >> n ;
  for ( int i = 1 ; i < n ; i ++ )
    if ( n % i == 0 )
      {
	if ( abs ( i - n / i ) <= x )
	  x = abs ( i - n / i ) , ans = i ;
      }

  cout << min ( n / ans , ans ) << ' ' << max ( ans , n / ans ) ;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){

	int n;
	cin >> n;
	if(n == 1)
	{
		cout << 1 << " " << 1 <<endl;
		return 0;
	}

	vector<pair<int,int>> differences;
	for(int i = n - 1; i > 0; i--)
	{
		if( n % i == 0){
			differences.push_back({abs(n/i - i), i});
		}
	}

	sort(differences.begin(), differences.end());

	int w = differences[0].second;

	cout << min(w, n/w) << " " << max(w, n/w) << endl;

	return 0;
}

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int main(){
	int n,a,b;
	cin>>n;
	for(int i=1;i<=int(sqrt(n));i++){
		if(n%i==0){
			a=i;
			b=n/i;
		}
	}
	cout<<a<<" "<<b;

	return 0;
}

#include <bits/stdc++.h>

#define sc(a) scanf("%d", &a)
#define sc2(a, b) scanf("%d%d", &a, &b)
#define fr(a, b, c) for(int (a) = (b); (a) < (c); ++(a))
#define rp(a, b) fr(a, 0, b)
#define cl(a,b) memset((a), (b), sizeof(a))
#define scs(a) scanf("%s", a)
#define MAXL 100000000000000000
#define MAX 1000000000
#define MOD 1000000007

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<ii> vii;

const int inf = 0x3f3f3f3f;
const ll linf = 0x3f3f3f3f3f3f3f3fLL;

int main() {
	int n;
	sc(n);
	int a, b, mini = MAX;
	int cmp = max(1, n/2);
	for(int i = 1; i <= cmp; i++) {
		if(n%i == 0 && abs((n/i) - i) < mini) {
			a = i; b = n/i;
			mini = b - a;
		}
	}
	printf("%d %d\n", a, b);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
/*if((n%2!=0&&n%3!=0)||n==1||n==2||n==3){
    cout<<1<<" "<<n;
    return 0;
*/
int m=sqrt(n);
for(int i=1;i<=n;i++){
    if(m*i==n){
        cout<<m<<" "<<i;
        return 0;
    }
}
for(int i=1;;i++){
    if(n%i==0){
        for(int j=i;j>0;j--){
            if(i*j==n){
               cout<<min(j,i)<<" "<<max(j,i);
               return 0;
            }
        }
    }
}
return 0;
}

#include <iostream>
#include <cmath>
using namespace std;

int a, b, i, n;
long double k;
int main()
{
    cin >> n;
    k = n;
    for (i = sqrt(k); i >= 1; i--)
    {
        if (n % i == 0) break;
    }
    if (i <= n / i) cout << i << " " << n / i;
    else cout << n / i << " " << i;
}

#include<bits/stdc++.h>
using namespace std;
long long n;
int main(){
	cin>>n;
	for(int i=sqrt(n);i>=1;i--)
		if(n%i==0){
			cout<<i<<" "<<n/i<<endl;
			return 0;
		}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL); cout.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;

template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
	cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
	cin >> p.first;
	return cin >> p.second;
}

mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// mt19937 rng(61378913);
/* usage - just do rng() */

void usaco(string filename) {
  // #pragma message("be careful, freopen may be wrong")
	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}

const lld pi = 3.14159265358979323846;
const ll mod = 1000000007;
// const ll mod = 998244353;
// ll mod;

ll n, m, k, q, l, r, x, y, z;
const ll template_array_size = 1e6 + 1178;
ll a[template_array_size];
ll b[template_array_size];
ll c[template_array_size];
string s, t;
ll ans = 0;

void solve(int tc = 0) {
	pair<ll, ll> ans = make_pair(1e6, 1e6);

	cin >> n;
	for (ll i = 1; i <= n; i++) {
		if (n % i == 0) {
			ans = min(ans, make_pair(abs(n / i - i), min(n / i, i)));
		}
	}

	cout << ans.s << " " << ans.f + ans.s << '\n';
}

int main() {
	#ifdef galen_colin_local
		auto begin = std::chrono::high_resolution_clock::now();
	#endif

	send help

	#ifndef galen_colin_local
		// usaco("cowland");
	#endif

	// usaco("cowland");

	// freopen("tc.cpp", "r", stdin);

	int tc = 1;
	// cin >> tc;
	for (int t = 0; t < tc; t++) solve(t);

	#ifdef galen_colin_local
		auto end = std::chrono::high_resolution_clock::now();
		cout << setprecision(4) << fixed;
		// cout << "Execution time: " << std::chrono::duration_cast<std::chrono::duration<double>>(end - begin).count() << " seconds" << endl;
	#endif
}

#include<bits/stdc++.h>
using namespace std;

int main(){
        long n;
        cin>>n;
        long a,b,f=1;
        for(int i=2;i<=sqrt(n);++i){
                  if(n%i==0){
                      f=i;
                  }
        }
        cout<<f<<" "<<n/f;
          return 0;
}

#include <iostream>
#include<cmath>
using namespace std;

//typedef long long LL;
//typedef unsigned long long ULL;

int main()
{

  long long  int n, a, b,i,j,p,k;
  i=0;k=1;
  cin>>n;
  p=n;
  while(n!=0)
  {
    i++;
    n=n/10;
  }
  //cout<<i;
  if(p==2)
  {
      cout<<1<<' '<<2;
      return 0;
  }
  if(i<=2)
  {
      for(j=1;j<=p;j++)
      {
          a=k;
          if(p%j==0)
          {
              k=abs(p/j-j);
               if(k==a||k==0)
              {cout<<p/j<< ' '  << j;return 0;}
          }
      }
  }
  if(i<=7)
  {
      for(j=1;j<=p;j++)
      {
          a=k;
          if(p%j==0)
          {
              k=abs(p/j-j);
               if(k==a||k==0)
              {cout<<p/j<< ' '  << j;return 0;}
          }
      }
  }

}

#include <iostream>
#include <cmath>
using namespace std;
int c;
int main(){
    cin >> c;
    for(int i = sqrt(c); i >= 1; i --){
        if(c % i == 0){
            cout << min(i, c / i) << " " << max(i, c / i);
            break;
        }
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
template<typename T>inline void read(T &x){
	register short f=1;x=0;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c))x=(x<<3)+(x<<1)+(c^48),c=getchar();
	x*=f;
}
template<typename T>inline void write(T x){
	if(x<0)putchar('-'),x=-x;
	if(x>9)write(x/10);
	putchar(x%10+'0');
}
template<typename T>inline void writeln(T x){
	write(x),putchar('\n');
}
int main(){
	int n;read(n);
	int i=int(sqrt(double(n)));
	while(1){
		if(n%i==0)break;
		i--;
	}
	write(i),putchar(' '),writeln(n/i);
	return 0;
}

#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a;
    b=sqrt(a);
    while(a%b!=0){
        b--;
    }
    c=a/b;
    cout<<b<<' '<<c;
}

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;

    int a = 0, b = 0;
    for (int i = 1; i * i <= n; ++i) {
        if (n % i == 0) {
            a = i;
            b = n / i;
        }
    }

    cout << a << " " << b << "\n";
    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;

int main(void)
{
	int n, a, b;
	cin >> n;
	a = sqrt((double)n);
	if (a*a == n)
	{
		cout << a << " " << a << endl;
	}
	else
	{
		for (int i = a; i > 0; i--)
		{
			if (n%i == 0)
			{
				a = i;
				b = n / i;
				break;
			}
		}
		if (a > b)
			swap(a, b);
		cout << a << " " << b << endl;
	}
}

#include <iostream>

using namespace std;

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n = 0;
	cin >> n;
	int a = n, b = 1;
	for (int i = 1; i * i<=  n; i ++){
		if (n % i ==0){
			if (n / i - i < a - b){
				a = n / i;
				b = i;
			}
		}
	}
	cout << b << " " << a;

	return 0;
}

#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<unordered_set>
#include<unordered_map>

#define ll long long
#define l long
#define pl pair<l,l>
#define pll pair<ll,ll>
#define mp make_pair
#define pb push_back
#define F first
#define S second

using namespace std;

ll MOD = 1000000007;

vector <int> kmp(string text, string pattern) {
    vector <int> table(text.length() + 1,0);
    int i = 0, j = -1;
    table[0] = -1;
    while (i < pattern.length()) {
        while (j >= 0 && pattern[i] != pattern[j]) {
            j = table[j];
        }
        i++;
        j++;
        table[i] = j;
    }
    vector <int> found;
    i = 0;
    j = 0;
    while (i < text.length()) {
        while (j >= 0 && text[i] != pattern[j])
            j = table[j];
        i++;
        j++;
        if (j == pattern.length()) {
            found.pb(i - j);
            j = table[j];
        }
    }
    return found;
}

ll modPow(ll b){
    ll a = 2;
    ll x=1,y=a;
    while(b > 0){
        if(b%2 == 1){
            x=(x*y)%MOD;
        }
        y = (y*y)%MOD;
        b /= 2;
    }
    return x%MOD;
}

vector <ll> sieve(ll n) {
    vector <ll> v;
    vector <bool> prime(n+1, true);
    for (ll p=2; p*p<=n; p++) {
        if (prime[p]) {
            for (ll i=p*2; i<=n; i+=p)
                prime[i] = false;
        }
    }
    for (int p=2; p<=n; p++) {
        if (prime[p]) {
            v.pb(p);
        }
    }
}

int main() {
    ll n;
    cin>>n;
    ll temp=sqrt(n);
    if(n%temp==0) {
        cout<<temp<<" "<<n/temp<<endl;
    }
    else {
        while(n%temp!=0) {
            temp--;
        }
        cout<<temp<<" "<<n/temp<<endl;
    }
    return 0;
}

#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int a,b,c,d;
main(){
	cin>>a;
	b=sqrt(a);
	if(b*b==a){
		cout<<b<<" "<<b;
	}

        else{
		for(c=b; c>=1; c--){
		if(a%c==0){
			cout<<c<<" "<<a/c;return 0;
			}
		}
	}
}

#include<bits/stdc++.h>
using namespace std;
int main(){

	int n,a,b;
	cin>>n;
	a=sqrt(n);
	while(n%a!=0)a++;
	if(a>n/a)a=n/a;
	cout<<a<<" "<<n/a;

return 0;}

#include <bits/stdc++.h>

using namespace std;

main () {
	int n,df;
	cin>>n;
	int ret;
	df=n;
	for(int i=1; i<=n/2+1; i++)  if(n%i==0) {
		if (abs((n/i)-i)<df) df=abs((n/i)-i), ret=i;
	}
	cout<<ret<<" "<<n/ret<<endl;
}

#include<bits/stdc++.h>

using namespace std;

int main()

{

	int n,i;

	scanf("%d",&n);

	for(i=sqrt(n);;i--)

		if(n%i==0)

		{

			printf("%d %d\n",i,n/i);

			return 0;

		}

}

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <iterator>
#include <sstream>
#include <iomanip>
using namespace std;

#define sf scanf
#define pf printf

int arr[1000000];

int main ()
{
    int n,i,c,k;

    while (cin >> n)
    {
        c = 0, k = 0;

        for (i=1; i<=n; i++)
        {
            if (n % i == 0)
            {
                arr[k] = i;
                k = k + 1;;
                c = c + 1;
            }
        }

        c = c - 1;

        if (c & 1)
            pf ("%d %d\n",arr[c/2],arr[c/2+1]);
        else
            pf ("%d %d\n",arr[c/2],arr[c/2]);
    }

    return 0;
}

#include <stdio.h>
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
	long long n,a,b,dem=0,tam=0;
	long long *u=new long long[1000001];
	//freopen("list.txt","r",stdin);
	cin>>n;

	while (tam<=n)
	{
		tam++;
		if (n%tam==0)
		{
			dem++;
			u[dem-1]=tam;
		}
	}

	a=1;
	b=dem;
	while (a+1<=b-1)
	{
		a++;
		b--;
	}
	cout<<u[a-1]<<" "<<u[b-1]<<"\n";

}

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int x;cin>>x;
    for(int i=sqrt(x);i>=1;i--)
        for(int j=sqrt(x);j<=x;j++)
            if(i*j==x) {cout<<i<<" "<<j;return 0;}
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,temp=0;
    cin>>n;
    temp=sqrt(n);
    for(int x=temp;x>=1;x--)
    {
        for(int y=temp;y<=n;y++)
        {
            if(x*y==n)
            {
                cout<<x<<' '<<y;
                return 0;
            }
        }
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){

     int n;
     cin>>n;
     int a=1,b=n;
     int l=2,m=n;
      while(l<=n/2){

         if(n%l==0){
            m=n/l;
             if(abs(m-l)<abs(b-a)){
                a=l;
                b=m;
                }
              }
         l++;
        }

       cout<<min(a,b)<<" "<<max(a,b);
      }

//
//  main.cpp
//  wicho
//
//  Created by Jorge Mendez on 9/12/17.
//  Copyright © 2017 Jorge Mendez. All rights reserved.
//

#include <iostream>
#include <math.h>
#include <list>

using namespace std;

int main(int argc, const char * argv[]) {

    int intNumber;
    cin >> intNumber;

    bool boolStop = false;

    for (int intDif = 0; intDif < intNumber && !boolStop; intDif++) {
            bool boolStop2 = false;
        for (int intPos = 0; intPos < intNumber - intDif && !boolStop2; intPos++) {

            int result = (intPos + 1) * (intPos + intDif + 1);

            if (result == intNumber){
                boolStop = true;
                cout << (intPos + 1) << " " << (intPos + intDif + 1) << endl;
            }

            if (result > intNumber){
                boolStop2 = true;
            }

        }
    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
pair<int,int>pr;
int main()
{
	int a,b,n;
	cin>>n;
	if(n==1)
	cout<<"1 1"<<endl;
	else
	{

	a=1;b=n;
	for(int i=2;a<=b;i++)
	{ pr.first=a;pr.second=b;
		if(n%i==0)
		{
			a=i;b=n/i;
		}

	}
	cout<<pr.first<<" "<<pr.second<<endl;
}
}

#include <iostream>
#include <cmath>
using namespace std;
int main(){
	int i,j,k,n;
	cin>>n;
	double x=sqrt(n);
	k=x;
	while(1){
		if(n%k==0){
			cout<<k<<" "<<n/k<<endl;
			return 0;
		}
		k--;
	}
}

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;

int main(void){
int a[100000];
int s;
	int n;
	int m;
	int x, y;
	int p, q;
	int v;
	m = 1;
	scanf("%d",&n);
	for (int i = 1; i <= n; i++){
		if (n%i == 0){
			if ((n/i) >= i){
				m = i;
			}
		}
	}
	printf("%d %d\n", m, n / m);

	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <deque>
#include <fstream>
#include <queue>
#include <stack>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#define scanf scanf_s
#define printf printf_s

using namespace std;

const int INF = 1000 * 1000 * 1000;

int main(){
	int n;
	cin >> n;
	for (int i = int(sqrt(double(n))); i > 0; i--){
		if (n % i == 0){
			cout << i << ' ' << n / i;
			return 0;
		}
	}
}

#include <iostream>
#include <cmath>
using namespace std;
int c;
int main(){
    cin >> c;
    for(int i = sqrt(c); i <= c; i ++){
        if(c % i == 0){
            cout << min(i, c / i) << " " << max(i, c / i);
            break;
        }
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>

using namespace std;

int main()
{
	int n; cin >> n;
	int min = n - 1;
	int a = 1, b = n;

	for (int i = 2; i <= n/2; i++)
	{
		if (n % i == 0 && abs(n/i - i) < min)
		{
			min = n/i - i;
			a = i;
			b = n/i;
		}
	}

	cout << a << " " << b << endl;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define pi acos(-1)
#define MIN(a,b) (a < b ? a : b)
#define MAX(a,b) (a > b ? a : b)
int main()
{
	int n,i,f,a,b,d,m,x,y;
	while(scanf("%d",&n)!=EOF){
		f=0;
		for(i=1;i*i<=n;i++){
			if(n%i==0){
				a=i;
				b=n/i;
				if(f==0){
					d=b-a;
					x=a;
					y=b;
					f=1;
				}
				if(f==1){
					m=b-a;
					if(m<d){
						d=m;
						x=a;
						y=b;
					}
				}
			}

		}
		printf("%d %d\n",x,y);
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	int i;
	cin>>n;
	for(i=(sqrt(n));i>=1;i--)
	{
		if(n%i==0)
		{
			cout<<i<<" "<<(n/i)<<endl;
			return 0;
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int n,s;
int main(){
	cin>>n;
	for(int i=1;i*i<=n;i++){
		if(n%i==0) s=i;
	}
	cout<<s<<" "<<n/s;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i = (int)sqrt(n); i > 0; i--)
    if(n % i == 0) {
        cout<<min(i,n/i)<<' '<<max(i,n/i)<<endl;
        break;
    }
    return 0;
}

#include <iostream>
#include <cmath>

using namespace std;

int main() {
  int n;
  cin >> n;
  int a, b;
  a = floor(sqrt(n));
  b = n/a;
  while(b*a != n) {
    a--;
    b = n/a;
  }
  cout << a << " " << b << "\n";
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int i;
	int n;
	cin>>n;
	int ans=1;

	for(i=2;i<=sqrt(n);i++)
	{
		if(n%i==0)
			ans=i;
	}
	cout<<ans <<" "<<n/ans;
}

#include <iostream>
#include <cmath>

using namespace std;

int main()
{
	int n;
	cin >> n;
	for (int i = sqrt(n); i > 0; i--)
	{
		for (int j = sqrt(n); j <= n; j++)
		{
			if (i * j == n)
			{
				cout << i << ' ' << j;
				return 0;
			}
		}
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int n,ans,i,x;
    cin>>n;
    x=sqrt(n);
    bool d=1;
    for(i=x;i>=1;i--){
        if(n%i==0){
            break;
        }
    }
    cout<<i<<" "<<(n/i)<<endl;
    return 0;
}

#include<iostream>
#include<Math.h>
using namespace std;
double a, ok;
int main ()
{
	cin >> a;
	for (int i = 1 ; i <= sqrt(a); ++i)
	{
		if ((int) a % i == 0) ok = i;
	}
	cout << ok << " " <<  a/ok;
	return 0;
}

#include<cstdio>
int main(){
	int n,s1,s2;
	scanf("%d",&n);
	for(int i=1;;i++){
		if(i>n/i) break;
		if(!(n%i)) s1=i,s2=n/i;
	}
	printf("%d %d",s1,s2);
	return 0;
}

#include <iostream>
#include<string>
#include<sstream>
using namespace std;
int main()
{
	int n, min1,min2, y, z;
	cin >> n;
	min1 = n - 1;
	for (int i = 1; i <= n; i++)
	{
		int x = n / i;
		if ( x*i == n)
		{
			min2= abs(x - i);
			if (min2 <= min1) {
				min1 = min2;
				y = x;
				z = i;
			}
		}
	}
	cout << y << " " << z << endl;
	//system("pause");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int n,m,i,j;
int main(){
    cin>>n;
    m=sqrt(n);
    for(i=m;i>=1;i--)
        for(j=m;j<=n;j++)
            if(i*j==n){
                cout<<i<<" "<<j;
                return 0;
            }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,i,j,ans,ans1,small;
    while(cin>>n)
    {

        {
            small=1000000;
            for(i=n; i>=1; i--)
            {
                if(n%i==0)
                {
                    j=n/i;
                    if(i==j)
                    {
                        ans=j;
                        ans1=i;
                        break;
                    }
                    else if(i-j < small && j<=i)
                    {
                        ans=j;
                        ans1=i;
                        small=i-j;
                    }
                }

            }
            cout<<ans<<" "<<ans1<<endl;
        }
    }
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>

using namespace std;

void main(){

	int x, num1, num2;
	cin >> x;

	if (x == 1) cout << 1 << " " << 1;
	else {
		for (int i = 1; i < x; i++)
		{
			if (x % i == 0 && i <= x / 2){
				num1 = i;
				num2 = x / i;
			}
			if (i > x / i) break;
		}

		cout << min(num1, num2) << " ";
		cout << max(num1, num2);
	}

}

#include <iostream>
#include <bits/stdc++.h>
#include <cstdlib>
// Input macros
#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%lld",&n)
#define sf(n)                       scanf("%lf",&n)
#define ss(n)                       scanf("%s",n)
// Useful constants
#define INF                         (int)1e9
#define EPS                         1e-9
// Useful hardware instructions
#define bitcount                    __builtin_popcount
#define gcd                         __gcd
// Useful container manipulation / traversal macros
#define REP(i,a,b)               for(int i=a;i<=b;i++)
#define miN(a,b)                  ( abs(a)<= abs(b) ? abs(a) : abs(b))
#define maX(a,b)                  ( abs(a)>= abs(b) ? abs(a) : abs(b))
using namespace std;
typedef long long ll;

int main(){
    int n, diff, ans;
    vector<int> factors;
    cin >> n;
    if( n == 1){
        cout << "1 1";
        return 0;
    }
    REP(i, 1, n/2)
    {
        if((n%i))
            continue;
        else{
            factors.push_back(n/i);
        }
    }
    vector<int>::iterator it = factors.begin();
    diff = abs ((n/(*it))-(*it));
    ans = *it;
        for(++it; it < factors.end(); it++){
            if(diff > abs ((n/(* (it)))-(*(it))))
               {
                   ans = *(it);
                   diff = abs ((n/(* (it)))-(*(it)));
               }
        }
    cout << miN(ans,n/ans) << " " << maX(ans,n/ans);

    return 0;

}

#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <ctime>
#define y1 ktl
#define MOD 1000000007
using namespace std;
long long a[500500] , c , i , was[1000002], w[1000002] , l , r , ok , n , b[500500] , j , c44  , c4 , k , x , h , y , m , step[1001] , v ,d[10000001] ;
string s , ss , sss ;
int main (){
    cin >> n;
    for(i = sqrt(n); i >= 1;i--)
        if(n % i == 0)
            cout << i << " " << n/i,exit(0);
    cout << 1 << " " << n;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin>>n;
    if(n%2==0){
        if(n==2)
            cout<<"1 2";
       else{
        int t,low,high,flag=0;
        t=sqrt(n);
        if(t%2!=0)
            t++;
        for(low=t;low<=n/2;low--){
            for(high=t;high<=n/2;high++){
                if(low*high==n){
                    cout<<low<<" "<<high;
                    flag=1;
                    break;
                }
            }
            if(flag==1)
                break;
        }
        }
    }
    else{
        int low=1,high=1,flag=0,t;
        t=sqrt(n);
        if(t%2==0)
            t++;
        for(low=t;low>=1;low-=2){
            for(high=t;high<=n;high+=2){
                if(low*high==n){
                    cout<<low<<" "<<high;
                    flag=1;
                    break;
                }
            }
            if(flag==1)break;
        }
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n,a,b,c,d;
    long long i,m=INT_MAX;
    cin>>n;
    for(i=1;i<=n;i++){
        if(n%i==0){
            a=i;b=n/i;
            //if(i==1)    m=fabs(b-a);
            if(fabs(b-a)<=m)
            {
                c=a;d=b;m=d-c;
                }
        }
       // cout<<std::min(c,d)<<" "<<max(c,d)<<endl;

    }
    cout<<std::min(c,d)<<" "<<max(c,d);
    return 0;
}

#include <iostream>
#include <cmath>

using namespace std;

int main() {
  int n;
  cin >> n;
  int a, b;
  a = floor(sqrt(n));
  b = n/a;
  while(b*a != n) {
    a--;
    b = n/a;
  }
  cout << a << " " << b << endl;
  return 0;
}

#include <iostream>
using namespace std;

int main()
{
    int i = 0, j = 0, n = 0, b = 0, a = 0;
    cin >> n;
    for(i = 1; i <= n / 2 + 1; i++)
    {
        if(n % i == 0)
        {
            if((n / i - i) < 0)
            {
                break;
            }
            a = i;
            b = n / i;

        }
    }

    if(b <= a)
    {
        i = a;
        a = b;
        b = i;
    }
    cout << a << " " << b;

return 0;
}

#include <iostream>
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <vector>
#include <queue>
#include <math.h>
#include <cctype>

using namespace std;

typedef long long ll;

bool isprime(ll n) { // O( sqrt(n)
	if (n == 2) return true;
	if (n < 2 || n % 2 == 0) return false;
	for (ll i = 3; i*i <= n; i += 2)
	{
		if (n%i == 0)
			return false;
	}
	return true;
}

int main() {

	int n;
	cin >> n;

	int best = n + 1;

	int b_i = 0, b_j = 0;

	if (isprime(n))
	{
		cout << "1" << " " << n; return 0;
	}

	for (int i = 1; i <= (n/2)+1;i++)
			if ( n%i == 0 && abs(max(n/i , i ) - min(n/i , i)) < best)
			{
				best = abs(max(n / i, i) - min(n / i, i));
				b_i = min(n/i , i);
				b_j = max(n/i , i );

			}

	cout << b_i << " " << b_j;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long n,a=0,b=0;
    cin>>n;
    for(int i=1;i<=sqrt(n);i++)
    {
        if(n%i==0)
        {
            a=i;
            b=n/i;
        }
    }
    cout<<a<<" "<<b<<endl;
    return 0;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cmath>

using namespace std;
int main()
{
    long long n;
    scanf("%lld",&n);
    long long x=sqrt(n);
    for(long long int i=0; i<1000010; i++)
    {
        if(n%(x-i)==0)
        {
            printf("%lld %lld\n",x-i,n/(x-i));
            return 0;
        }
    }
    return 0;
}

#include <cstdio>
#include <math.h>

int check(int num){
	if(num%(int)sqrt(num)==0){
		for(int i=sqrt(num);i<num;i++){
			for(int j=sqrt(num);j<num;j++){
				if(i*j==num){
					printf("%d %d",i,j);
					return 0;
				}
			}
		}
	}
	else{
		for(int i=1;i<=num;i++){
			for(int j=1;j<=num;j++){
				if(i*j==num) {
					printf("%d %d",i,j);
					return 0;
				}
			}
		}
	}

	return 0;
}
int main(){
	int num;
	scanf("%d",&num);
	check(num);
}

#include <bits/stdc++.h>

using namespace std;
int main() {
    int n;
    scanf("%d",&n);
    int a, b, ms = 10000000, ca, cb;
    for (int a = 1;a <= n/2;a++) if (n%a == 0) {
        b = n/a;
        if (ms > abs(a-b)) {
            ca = a;
            cb = b;
            ms = abs(b-a);
        }
        else break;

    }
    if (n = 1) cout << "1 1";
    else cout << ca << " " << cb;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n;
    int s=0;
    cin>>n;
    for(long long i=sqrt(n);i>=1;i--)
    {
        if(n%i==0) {
            cout<<i<<" "<<n/i;
            s=1;
        }
        break;
    }
    if(s==0)cout<<"1"<<" "<<n;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n,i;
	cin>>n;
	int e,a,b;
	e=sqrt(n);
	for(i=e+1;i<=n;i++)
	{
		if(n%i==0)
		{
			a=i;
			break;
			}
		}
   b=n/a;
   cout<<b<<"\n"<<a;
	return 0;
}

#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
	int n,x=1,b,i=1;
	float s;
	cin >> n;
	x = sqrt(n);
	s = sqrt(n);
		if (x == s){ cout << x << " " << x << endl; return 0; }
		if (n % 2 == 0){
			b = sqrt(n);
			i = b;
			while (true){
				if (b*i == n){ cout << b << " " << i << endl; break; }
				i++;
			}
		}
		if (n % 2 != 0)
		{

			if (n % 3 == 0){
				b = sqrt(n);
				i = b;
				while (true){
					if (b*i == n){ cout << b << " " << i << endl; break; }
					i++;
				}
			}
			else cout << 1 << " " << n << endl;
		}

	return 0;
}

#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include<unordered_map>
#include <set>
#include <functional>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define loop(i, len) for (long long i = 0; i < len; ++i)
#define LOCAL 0

bool myfunc(char ch1, char ch2) {
    return ch1<ch2;
}

ll A[100000],B[1000000];

int main() {
    FASTIO

    ll min=10000000;
     ll n,ans1=0,ans2=0;
        cin>>n;
     loop(i,(n/2)+1)
     {
         if(i==0)i=1;
         if(n%i!=0)continue;
         if(fabs(n/i-i)<=min)
         {
          min=fabs(n/i-i);
            ans1=n/i,ans2=i;
         }

        }

        cout<<ans1<<" "<<ans2;

}

//g++  7.4.0

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    int n,v,x=1000000,y=0,z=0,a=0,b=0,c=0;
    cin>>n;
   for(int i=1;i<=n/2;i++)
   {
       if(n%i==0)
       {
           y=n/i;
           if(y-i<x &&  y-i>=0)
           {
             z=i;
             x=y-i;
               a=y;

           }
       }
   }
    cout<<z<<" "<<a;

}

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <fstream>
#include <string>;
using namespace std;
int main()
{
	int n;
	cin >> n;
	int diff = n;
	int a = 1, b = n;
	for (int i = 1; i < n / 2; i++)
	{
		if (n % i == 0)
		{
			int num1 = i;
			int num2 = n / i;
			//cout << "\t" << num1 << " " << num2 << endl;
			if (diff > max(num1, num2) - min(num1, num2))
			{
				a = min(num1, num2);
				b = max(num1, num2);
				diff = b - a;
				//cout << "\t" << diff << endl;
			}
		}
	}
	cout << a << " " << b << endl;
}

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <cassert>
using namespace std;
using namespace __gnu_pbds;
typedef tree<long long int, null_type, less_equal<long long int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; //less_equal
#define ll long long int
#define ull unsigned long long int
#define mod (ll)1e9+7
#define pb push_back
#define mp make_pair
#define pp pair<int, int>
#define ppl pair<ll, ll>
#define loop(i,s,n) for(int i=s ; i<n ; i++)
#define loopl(i,s,n) for(ll i=s ; i<n ; i++)
#define loopr(i,e,s) for(int i=e; i>=s ; i--)
#define speedUp ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
void doit()
{
    // ab_gupta
    int n; cin>>n;
    int a=1,b=1,d=INT_MAX;
    for(int i=1;i<n/2;i++)
        if(n%i==0)
            if(abs(i-n/i) < d)
            {
                a=i;b=n/i;
                d=abs(a-b);
            }
    cout<<min(a,b)<<" "<<max(a,b);
}
int main()
{
    speedUp;
    doit();
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{ long long int n,i,sum,res,minn,maxx,we;
  cin>>n;
  sum=sqrt(n);
   res=n/sum;
   minn=min(sum,res);
   maxx=max(sum,res);
   if(sum*sum==n)
   cout<<minn<<" "<<maxx;
  else
  {
      for(i=10;i>=1;i--)
      {we=n/i; if(we*i==n) {cout<<min(we,i)<<" "<<max(we,i);
       break;}
      }
  }}

#include<bits/stdc++.h>
#include<stdio.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                  long long
#define scl(n)              scanf("%lld",&n)
#define scll(n, m)          scanf("%lld%lld",&n, &m)
#define scc(c)	            scanf("%c",&c)
#define fr(i,n)             for (ll i=0;i<n;i++)
#define fr1(i,n)            for(ll i=1;i<=n;i++)
#define pfl(x)              printf("%lld\n",x)
#define pb                  push_back
#define debug               cout<<"I am here"<<endl;
#define pno                 cout<<"NO"<<endl
#define pys                 cout<<"YES"<<endl
#define tcas(i,t)           for(ll i=1;i<=t;i++)
#define all(x) 	            (x).begin(), (x).end()
#define allrev(x)           (x).rbegin(),(x).rend()
#define pr                  pair<ll, ll>
#define ff                  first
#define ss                  second
#define pn                  printf("\n")

#define l(s)                s.size()
#define asort(a)            sort(a,a+n)
#define dsort(a)            sort(a,a+n,greater<int>())
#define uniquee(x)          x.erase(unique(x.begin(), x.end()),x.end())
#define el                  cout<<endl
#define md                  1000000007
#define inf                 1e18
#define ps                  cout<<" ";
#define Pai                 acos(-1.0)
#define mem(a,i)            memset(a, i, sizeof(a))
#define pcas(i)             cout<<"Case "<<i<<": "<<endl;
#define seg_tree(n) 	    ll left=n*2,right=l+1,mid=(l+r)/2
#define fast 	ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

#define N 200005

int main()
{
    ll t;
    //cin>>t;
    t=1;
    tcas(cs, t)
    {
        ll m,n,b,c,d,i,j,k,x,y,z,l,r, p, q;
        string s,s1, s2, s3, s4;

        ll cnt=0,cn=0,ans=0,sum=0 , mn=inf;
        scl(n);

        fr1(i , 2005)
        {
            fr1(j , 2005)
            {
                if(i*j==n )
                {
                    if(mn>  abs(i-j) )
                    {
                        mn=abs(i-j);
                        x=i , y=j;
                    }
                }
            }
        }

        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;

int main(void){
int a[100000];
int s;
	int n;
	int m;
	int x, y;
	int p, q;
	int v;
	m = 1;
	scanf("%d",&n);
	for (int i = 1; i < n; i++){
		if (n%i == 0){
			if (n >= i*i)m = i;
		}
	}
	printf("%d %d\n", m, n / m);
	return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <stdbool.h>

int main(){

	int n;

	scanf("%d", &n);

	int a = 0;
	int b = 0;

	for(int i = 1; i < n; i++){

		if(n%i == 0){

			if(i * i <= n){

				a = i;
				b = n / i;

			}
			else{

				break;

			}

		}

	}

	printf("%d %d", a, b);

	return 0;

}

#include <bits/stdc++.h>
using namespace std;

signed main()
{
int n;
cin>>n;
int mn=1e18,a1,a2;
for(int i=n;i>1;i--)
{
    if(n%i==0)
    {
        if(abs(i)-abs(n/i)<mn)
        {
            mn=abs(abs(i)-abs(n/i));
            a1=i;
            a2=n/i;
        }
    }
}

if(mn==1e18)
{
    cout<<"1 "<<n<<endl;
}
else
cout<<min(a1,a2)<<" "<<max(a1,a2)<<endl;

return 0;
}

#include <bits/stdc++.h>
#define boost ios_base::sync_with_stdio(0); cin.tie(); cout.tie()
#define all(x) x.begin(), x.end()
#define endl '\n'
#define len(a) a.length()
#define int long long

#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

using namespace std;

const long long inf = 1e18;
const double eps = 1e-6;
const long long mod = 1e9 + 7;

int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

bool on_board (int x, int y, int n, int m)
{
    return x >= 0 && y >= 0 && x < n && y < m;
}

int binpow (int a, int n)
{
    if (n == 1)
        return a;
    if (n == 0)
        return 1;
    if (n % 2 == 0)
    {
        int y = binpow(a, n / 2);
        return (y * y) % mod;
    }
    else
        return (binpow(a, n - 1) * a) % mod;
}

int string_to_int (string s)
{
    reverse(all(s));
    int pw = 1;
    int ans = 0;
    for (int i = 0; i < len(s); i++)
    {
        ans += (s[i] - '0') * pw;
        pw *= 10;
    }
    return ans;
}

int div_up (int x, int y) { if (x == 0) return 0; return (x - 1) / y + 1; }

int32_t main()
{
    boost;
    int n; cin >> n;
    for (int delta = 0; delta <= sqrt(n); delta++)
    {
        int a = sqrt(n) + delta;
        int b = div_up(n, a) - delta;
        if (a * b == n)
        {
            cout << min(a, b) << " " << max(a, b);
            return 0;
        }
    }
    cout << "1 " << n;
    return 0;
}
/*

*/

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n;
    cin>>n;
    if(n%(int)floor(sqrt(n)))
        cout<<1<<" "<<n;
    else
        cout<<floor(sqrt(n))<<" "<<n/floor(sqrt(n));
    return 0;
}

#include <cmath>
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
using namespace std;
typedef long long int lli;
long long int c[10000000],a[10000000],v[100000],i,n,j,k,an;
#define FOR(j,k,n) for ( j = k; j < (int)(n); j++)
#define MAXN 100000000000000000
int main()
{
    cin>>n;
    FOR(i, sqrt(n), n+1)
    if (n%i==0) {
        break;
    }
    cout<<n/i<<" "<<i;
    return 0;
}

#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#define Inf 0x3f3f3f3f
using namespace std;
int main(){
    int n;
    while(~scanf("%d",&n)){
        int mini=Inf;
        int temp=0,step=0;
        for(int i=1;i<10000;i++){
            for(int j=1;j<10000;j++){
                if((i*j==n)&&mini>abs(i-j)){
                    mini=abs(i-j);
                    temp=i;step=j;
                }
            }
        }
        cout<<temp<<" "<<step<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n,i;
	cin>>n;
	int e,a,b;
	e=sqrt(n);
	if(e*e==n)
	{
		cout<<e<<" "<<e;
		}
		else
		{
	for(i=e;i<=n;i++)
	{
		if(n%i==0)
		{
			a=i;
			break;
			}
		}
   b=n/a;
   cout<<b<<" "<<a;
   }
	return 0;
}

#include<bits/stdc++.h>
#include<stdio.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                  long long
#define scl(n)              scanf("%lld",&n)
#define scll(n, m)          scanf("%lld%lld",&n, &m)
#define scc(c)	            scanf("%c",&c)
#define fr(i,n)             for (ll i=0;i<n;i++)
#define fr1(i,n)            for(ll i=1;i<=n;i++)
#define pfl(x)              printf("%lld\n",x)
#define pb                  push_back
#define debug               cout<<"I am here"<<endl;
#define pno                 cout<<"NO"<<endl
#define pys                 cout<<"YES"<<endl
#define tcas(i,t)           for(ll i=1;i<=t;i++)
#define all(x) 	            (x).begin(), (x).end()
#define allrev(x)           (x).rbegin(),(x).rend()
#define pr                  pair<ll, ll>
#define ff                  first
#define ss                  second
#define pn                  printf("\n")

#define l(s)                s.size()
#define asort(a)            sort(a,a+n)
#define dsort(a)            sort(a,a+n,greater<int>())
#define uniquee(x)          x.erase(unique(x.begin(), x.end()),x.end())
#define el                  cout<<endl
#define md                  1000000007
#define inf                 1e18
#define ps                  cout<<" ";
#define Pai                 acos(-1.0)
#define mem(a,i)            memset(a, i, sizeof(a))
#define pcas(i)             cout<<"Case "<<i<<": "<<endl;
#define seg_tree(n) 	    ll left=n*2,right=l+1,mid=(l+r)/2
#define fast 	ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

#define N 200005
vector<ll>v;

ll find_all_divisor(ll n){  fr1(i,sqrt(n)){     ll x;  if(n % i == 0)  { x = n / i; v.pb(i);  if(i != x) v.pb(x);}}}
int main()
{
    ll t;
    //cin>>t;
    t=1;
    tcas(cs, t)
    {
        ll m,n,b,c,d,i,j,k,x,y,z,l,r, p, q;
        string s,s1, s2, s3, s4;

        ll cnt=0,cn=0,ans=0,sum=0 , mn=inf;
        scl(n);
        find_all_divisor(n);

        sort(all(v));

        m=v.size()/2;
        if(m%2)x=v[ m ]  , y=v[m];
        else x=v[ m-1 ]  , y=v[m];

        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define li int64_t
void Oli(){
int a;
cin>>a;
vector<int> b;
double f=sqrt(a);
if (sqrt(a)*sqrt(a)==a){
        cout<<sqrt(a)<<" "<<sqrt(a);
        }
        else {
                cout<<endl;
    for(int i=1;i<=a/2;i++){
        if(a%i==0) {b.push_back(i);}
    }
    b.push_back(a);
    if (b.size()==1){ cout<<1<<" "<<a;}
    else {
        cout<<b[b.size()/2-1]<<" "<<b[b.size()/2];}

}
}
int main(){
cout.precision(100);
li times=1;
//cin>>times;
while(times--)Oli();}

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <stdbool.h>

int main(){

	int n;

	scanf("%d", &n);

	int a = 0;
	int b = 0;

	for(int i = 1; i <= n; i++){

		if(n%i == 0){

			if(i * i <= n){

				a = i;
				b = n / i;

			}
			else{

				break;

			}

		}

	}

	printf("%d %d", a, b);

	return 0;

}

#include<iostream>
#include<math.h>
using namespace std;
int main(){
    int x,y,z=0,n,i,j,p,q;
    cin>>n;
    x=pow(n,0.5);
    //cout<<x<<endl;
    for(i=0;i<x && z==0;i++){
        for(j=0;x+j<=n && z==0;j++){
            if((x-i)*(x+j)==n){
                z=1;
                p=x-i;q=x+j;
            }
        }
    }
    cout<<p<<" "<<q<<endl;
}

#include <cstdio>
#include <cmath>
int main(){
    int a,b = 0,c,d;
    scanf("%d",&a);
    c = 1; d = a;
    if(a%2){
        for(int i = 1; i <= sqrt(a); i++){
            if(a%i == 0){
                b = a / i;
                if(i <= b){
                    c = i; d = b;
                }
            }
        }
    }
    else{
        for(int i = 2; i <= sqrt(a); i+=2){
            if(a%i == 0){
                b = a / i;
                if(i <= b){
                    c = i; d = b;
                }
            }
        }
    }
    printf("%d %d", c , d);
    return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;

int main()
{
      int n;
      cin>>n;
      int a=0;
      int b=0;
      int dif=0;
      int min=1000000;
      if(n==1)
      {
            cout<<0<<" "<<0;
      }
      else
      {
      for(int i=1; i<=n/2; i++)
      {
           int x=0;

           if(n%i==0)
           {
                 x=n/i;
                 dif=abs(x-i);
           }
           if(dif<min)
           {
               min=dif;
               a=i;
               b=x;
           }
      }
      cout<<a<<" "<<b;
}}

#include<iostream>
#include<string.h>
using namespace std;
int n,d,p;
int main()
{
cin>>n;
for(d=1;d*d<=n;d++)
    if(d*d==n)
{
    cout<<d<<' '<<d;
    return 0;
}
else
    if(d*d>n)
{
    p=d;
    break;
}
if(p==0)
    p=d+1;
for(d=p-1;d>=1;d--)
    if(n/d==p)
{
    cout<<d<<' '<<p;
    return 0;
}
cout<<1<<' '<<n;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a;
	cin>> a;
	for( int i=a-1;i>0;i-- ){
		if(a%i == 0){
			cout<< a/i << " " << i <<endl;
			return 0;}
}}

#include <iostream>
#include<math.h>
using namespace std;

int main()
{
   long n;
   cin>>n;
   long sum=0;
   long minp=10000;
long k1=0,j1=0;;;;;
   double z=sqrt(n);
if( z-floor(z)==0)
    cout<<z<<" " <<z;
else
    for( long i=1;i<=n;i++)
if( n%i==0){
    long z=n/i;
    if( i<=z){
        sum=z-i;
        if(sum<=minp)
        {
            minp=sum;
            j1=i;
            k1=z;
        }
    }
}
if( j1>0 && k1>0){
cout<<j1<<" "<<k1;}
    return 0;
}

#include <iostream>
#include <string>
#include <cmath>
#include <math.h>

using namespace std;

int main()
{
     int n;
     cin>>n;
    int i=1;
    while((i*i)<n)
     i++;
    while(n%i!=0)
     i--;
    cout<<i<<' '<<n/i;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i = (a); i < (b); i++)
typedef pair<int,int> ii;

int main() {

	int n;
	cin >> n;
	int best = 100000;
	int x = 0;
	int y = 0;
	rep(i,1,n) {
		if(n % i == 0) {
			int f = n/i;
			if(abs(i-f) < best) {
				best = abs(i-f);
				x = i;
				y = f;
			}
		}
	}
	cout << min(x,y) << " " << min(x,y) << endl;
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pf push_front
#define ppb pop_back
#define mp make_pair
#define ll long long
#define ld long double
#define al 0x3F3F3F3F
#define ull unsigned long long
#define PI pair < int, int >
#define sz(x) x.size()
#define all(x) x.begin(), x.end()
#define in(a) insert(a)
#define ppf pop_front
#define int ll

const int mod = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 123;
const int N = 1e6 + 123;
const int INF = al;
const ll INFL = 3e18 + 1;
const double pi = acos(-1.0);
const double eps = 1e-9;

int n, a = 0, b = INF;

inline void boost() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
}

inline void solve() {
    boost();
    cin >> n;
    for (int i = 1; i <= 10000; i++)
    	for (int j = i; j <= 10000; j++)
    		if (i * j == n && b - a > j - i) a = i, b = j;
    cout << a << " " << b;

}

main () {
//	freopen(".in", "r", stdin);
//	freopen(".out", "w", stdout);

	solve();
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>

using namespace std;

void main(){

	int x, num1, num2;
	cin >> x;

	for (int i = 1; i < x; i++)
	{
		if (x % i == 0 && i <= x / 2){
			num1 = i;
			num2 = x / i;
		}
		if (i > x / i) break;
	}

	cout << min(num1, num2) << " ";
	cout << max(num1, num2);

}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int a,b,c;
    double d;
    cin>>a;
    d=sqrt(a);
    d=ceil(d);
    //cout<<d<<endl;
    if (a==d*d){
      cout<<d<<"  "<<d;
        return 0;
    }
    else {
        b=d+1;
        c=d;
        for(b;b<=a;b++){
             //   cout<<b<<endl;
            c=d;
           // cout<<c<<endl;
                for (int i=c;i>0;i--){
        if (a==b*i){
            cout<<i<<"  "<<b;
            return 0;
        }

        }}}
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
    //?//
 int main()
 {
    int n;
    cin >> n;
    int aa = sqrt(n);
    if (aa * aa == n)cout << aa << " " << aa;
    else{
    	for ( int i = aa; i <= 10e6; ++i ){
    		if (i * aa == n){
    			cout << aa << " " << i;
    			return 0;
			}
		}
	}
	cout << "1" << " " << n;
 }

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <stdbool.h>

int main(){

	int n;

	scanf("%d", &n);

	int a = 0;
	int b = 0;

	for(int i = 1; i < n; i++){

		if(n%i == 0){

			if(i * i <= n){

				a = i;
				b = n / i;

			}
			else{

				break;

			}

		}

	}

	printf("%d %d", a, b);

	return 0;

}

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
using namespace std;

int main(){
int n;
cin>>n;
if(n==2){
    cout<<1<<" "<<2<<endl;
    return 0;
}
for(int i=sqrt(n)+1;i>=1;i--)
if(n%i==0){
    cout<<i<<" "<<n/i<<endl;
break;
}
}

#include <cstdio>
#include <cmath>
int main(){
    int a,b = 0,c = 0,d = 0;
    scanf("%d",&a);
    if(a%2){
        for(int i = 1; i <= sqrt(a); i+=2){
            if(a%i == 0){
                b = a / i;
                if(i <= b){
                    c = i; d = b;
                }
                else break;
            }
        }
    }
    else{
        for(int i = 2; i <= sqrt(a); i+=2){
            if(a%i == 0){
                b = a / i;
                if(i <= b){
                    c = i; d = b;
                }
                else break;
            }
        }
    }
    printf("%d %d", c , d);
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main()
{
	int n, i, a, b, k, sqrt;
	scanf("%d", &n);
	for (k = 0; k <= (n + 1); k++)
	{
		if ((k * k) <= n)
		{
			sqrt = k;
		}
		else
		{
			break;
		}
	}
	for (i = 1; i <= n; i++)
	{
		if (i <= k && n % i == 0)
		{
			a = i;
		}
	}
	b = n / a;
	printf("%d %d\n", a, b);
	return 0;
}

#include<bits/stdc++.h>
#include<iomanip>
#include<vector>
#define                           ll                          long long
#define                           int                         ll
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int p[50005];

using namespace std;

main()
{
    fast
    int n,p,q,a,i,j,k,c,x;
    cin>>n;
    k=1000000;

    for(i=n;i>=1;i--)
    {
       for(j=1;j<=n/2;j++)
       {
          x=i*j;
          if(x==n)
          {
             c=fabs(i-j);
             if(c<k)
             {
                k=c;
                p=i;
                q=j;
             }
          }
          else
          {
             if(x>n)
               break;
          }
       }
    }
     cout<<min(p,q)<<" "<<max(p,q)<<endl;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ull;
int main()
{int n; cin>>n;
 int p=sqrt(n);
 if (p*p==n) {cout<<p<<" "<<p; return 0;}
 for (int i=1;i<n;i++)
 {if (n%(p+i)==0) {cout<<p+i<<" "<<n/(p+i);  return 0;}
  if (n%(p-i)==0) {cout<<p-i<<" "<<n/(p-i); return 0;}}}

#include<bits/stdc++.h>
using namespace std;
typedef long long INT;
main(){
#ifndef ONLINE_JUDGE
	freopen("c.txt","r",stdin);
#endif
	int n,m,t;
	while(cin>>n){
		m=1e18;
		for(int i=1;i<=n/2;i++){
			if(n%i==0){
				if(abs(n/i-i)<m){
					t=i;
					m=abs(n/i-i);
				}
			}
		}
		cout<<t<<" "<<n/t<<endl;
	}
}

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int ans,i,a,b,j=1,fa,fb;
    scanf("%d",&i);
    ans=i;
    for(j=1; j<i; j++)
    {

        if(i%j==0)
        {
            a=j;
            b=i/j;
            if(abs(a-b)<ans)
            {
                ans=abs(a-b);
                //printf("%d.%d %d\n",ans,a,b);
                fa=a;
                fb=b;
            }

        }

    }
    printf("%d %d\n",fa,fb);

}

#include <bits/stdc++.h>

using namespace std;

int main()
{

    int n ;
    cin >> n;
    vector<int> vec ;
    map<int , int> smalized ;
//    int counter = 2 ;
//
//    while(n > 1){
//
//        if(!(n % counter)){
//            smalized[counter]++ ;
//            n /= counter ;
//            vec.push_back(counter) ;
//        }
//        else
//        counter++ ;
//    }
//    for(int i = 0 ; i < vec.size() ; i++){
//
//        cout << vec[i] << " " ;
//
//    }

    int a , b ;
    for(int i = 2 ;i * i <= n ; i++){
        if( !(i & 1) )
            {
                a = i ;
                b = n / i ;
            }

    }
    cout << a << " " << b ;

//    for(auto it = smalized.cbegin(); it != smalized.cend(); ++it)
//{
//    cout << it->first << " " << it->second << "\n";
//}

    return 0;
}

#include <iostream>
#include <math.h>

using namespace std;

int main()
{
	int n;
	cin >> n;
	for (int r = sqrt(n) - 1; r > 0; r++)
	{
		int temp = n / r;
		if (n - (temp * r) == 0)
		{
			cout << r <<" "<< temp;
			break;
		}
	}
	//system("pause");
}

/*
________     ______    _________   .           .   .______
|           |      |       |       |           |   |      |
|           |      |       |       |           |   |      |
|______     |______|       |       |______     |   |______|
|      |    |      |       |       |      |    |   |
|      |    |      |       |       |      |    |   |
|______|    |      |       |       |______|    |   |

              _____________
|         /          |                /\
|        /           |               /  \
|       /            |              /    \
|______/             |             /      \
|      \             |            /        \
|       \            |           /          \
|        \           |          /            \
|         \          |         /              \
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <map>
#include <set>
#include <string>
#include <fstream>
#include <stack>
#include <deque>
#include <queue>
using namespace std;

#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back

typedef long long ll;

const ll LINF=(ll) 1e18;
const int INF=(int) 1e9+7;
const int N=(int) 1e5+1;

bool u[N+5];
int minn=999999999;
int main(){
	_
	int n,a=0,b=0;
	cin>>n;
	for(int i=1; i<=8000; ++i)
		for(int j=1; j<=i; ++j){
			if(i*j==n&&minn>abs(i-j)){
				minn=abs(i-j);
				a=i;
				b=j;
			}
		}
	cout<<b<<" "<<a;
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <deque>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int a = 1;
    for(int i = 1; i*i <=n; i++){
            cout << i*i <<" " << i<< endl;
        if(n%i == 0){
            a = i;

        }
    }

    cout <<a << " " << n/a << endl;
    return 0;
}

//noob
#include<bits/stdc++.h>
using namespace std;
#define fori(x) for(int i=0;i<x;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long int
#define ld long double
#define ull unsigned long long int
#define pi acos(-1)
#define test() int T,t=1;cin>>T;
#define all(x) (x).begin(),(x).end()
#define sz(x) (int(x.size()))
typedef vector<int> vi;
typedef pair<int,int> PI;
const int N = (int)1e6 + 7;

int cheak(int n){
	int ans1=0;
	for(int i=1;i*i<=n;i++){
		if(n%i==0){
			if(i>ans1) ans1=i;
		}
	}
	return ans1;
}
void solve(){
	int n,ans1,ans2;cin>>n;
	if(sqrt(n)*sqrt(n)==n) ans1=ans2=sqrt(n);
        else if(n==5) ans1=1,ans2=5;
	else{
		int c=cheak(n);
		if(c==1) ans1=1,ans2=n;
		else ans1=c,ans2=n/c;
	}
	cout<<ans1<<" "<<ans2<<endl;
}
int main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	//freopen("input.txt","r",stdin);

solve();
	return 0;
}

#include <iostream>
#include<vector>
//typedef long long l;
/*
#define il(i,a,b) for(i=a;i<b;i++)
#define dl(i,a,b) for(i=a;i>b;i--)
*/
using namespace std;

int main()
{
     long long b,n,p,dif,mini,minj;
     long long mind=n;
     cin>>n;
     vector <long long> a;
     vector <long long> :: iterator j;
     vector <long long> :: iterator i;
     for(p=1;p<n+1;p++)
     {
         if(n%p==0)
            a.push_back(p);
     }
     for(j=a.begin();j!=a.end();j++)
     {
         for(i=a.begin();i!=a.end();i++)
         {
             if((*i)*(*j)==n)
             {dif=(*j>*i)?(*j-*i):(*i-*j);
             if(dif<mind)
                {
                    mind=dif;
                    mini=*i;
                    minj=*j;
                }
            }
         }
     }

    /*bruteforce
    il(i,0,n+1)
    {
        il(j,0,n+1)
        {
            if(i*j==n)
            {
                dif=(j>i)?j-i:i-j;
                if(dif<min)
                {
                    min=dif;
                    mini=i;
                    minj=j;
                }
            }
        }
    }*/
    cout<<mini<<" "<<minj;
    return 0;
}

#include <iostream>
#include <stdlib.h>

using namespace std;

int main()
{
    int n;

    cin>>n;
    int iContL=0;
    int iContR=0;
    int iArrL[n];
    int iArrR[n];
    int iCasMax=0;
    int iAcumL=0;
    int iAcumR=0;

    for(int i=0;i<n;i++){
        cin>>iArrL[i]>>iArrR[i];
        if(iArrL[i]>iArrR[i])
            iContL++;
        if(iArrR[i]>iArrL[i])
            iContR++;
        iAcumL+=iArrL[i];
        iAcumR+=iArrR[i];
    }

    int iAuxAcumL=iAcumL;
    int iAuxAcumR=iAcumR;

    if(iContL==0 || iContR==0)
        cout<<"0";

    else{
        for(int i=0;i<n;i++){
            if(abs((iAcumL - iArrL[i] + iArrR[i]) - (iAcumR - iArrR[i] + iArrL[i]))>abs(iAuxAcumL-iAuxAcumR)){
                iCasMax=i;
                iAuxAcumL=iAcumL-iArrL[i]+iArrR[i];
                iAuxAcumR=iAcumR-iArrR[i]+iArrL[i];
            }
        }
        cout<<iCasMax+1;
    }

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k=0;
    cin>>n>>k;
    k=sqrt(n);
    if(n%k!=0) k--;
    else
    if(n%k==0)
    cout<<k<<" "<<n/k;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int main(){
    int a;
    scanf("%d",&a);
    int b,c;
    int base=(int)(ceil(sqrt(a*1.0)));
    for (int i=1;i<=base;i++){
        if(a%i==0){
            b=i;
            c=a/i;
        }
    }
    printf("%d %d",b,c);
    return 0;
}

#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
	//freopen("input.txt", "r", stdin);
	ll n;
	while(cin >> n){
		ll a, b, x, y, diff=n;
		for(ll i=1; i<=n/2; i++){
			if(n % i == 0){
				//cout << n/i << " x " << i << " = " << n << endl;
				if(n/i <= i)
					a = n/i, b = i;
				else
					a = i, b = n/i;

				if(abs(a-b) < diff)
					diff = abs(a-b), x = a, y = b;
			}
		}
		cout << x << " " << y << endl;
	}

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
int _I(){int x; scanf("%d",&x); return x;}
int prime[2000001]={0};
void sv(){
    int i,j;
    for(i=4; i<=2000000; i+=2) prime[i]=1;
    for(i=3; i<=2000000; i+=2){
        if(!prime[i]){
            for(j=i*3; j<=2000000; j+=i+i) prime[j]=1;
        }
    }
    prime[0]=prime[1]=1;
}
int main()
{
    sv();
    int n=_I();
    if(n==1) printf("1 1\n");
    if(!prime[n]) printf("%d %d\n",1,n);
    else{
        int i;
        int a,b,p,q;
        int mn=9999999;
        for(i=1; i<=n/2; i++){
            if(n%i==0){
                a=i;
                b=n/i;
                if(abs(a-b)<=mn){
                    mn=abs(a-b);
                    p=a;
                    q=b;
                }
            }
        }
        printf("%d %d\n",p,q);
    }
    return 0;
}

#include <iostream>
using namespace std;

int main() {
	long long  n,k,largest;
	cin >> n;
	largest = n-1;

	for(int k=1;k<=n;k++){
		if(n%k==0 && n/k >=k && n/k - k < largest&& n/k-k>=0) {largest = k ;}
	}

	cout << largest<< " "<< n/largest ;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;
int main()
{
	int n,a=0,b=0,mn;
	cin>>n;
	mn=n;
	for(int i=n/2;i>0;i--)
	{
		if(i*int(n/i)==n and mn>abs((n/i)-i))
		{
			a=i;
			b=n/i;
			mn=abs((n/i)-i);
		}
	}
	cout<<a<<" "<<b;
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
#define cle(a,val) memset(a,(val),sizeof(a))
#define SI(N) scanf("%d",&(N))
#define SII(N,M) scanf("%d %d",&(N),&(M))
#define SIII(N,M,K) scanf("%d %d %d",&(N),&(M),&(K))
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define red(i,a,b) for(int i=(a);i>=(b);i--)
const ll LINF = 0x3f3f3f3f3f3f3f3f;
#define PU(x) cout<<#x<<endl;
#define PI(A) cout<<(A)<<endl;
#define DG(x) cout<<#x<<"="<<(x)<<endl;
#define DGG(x,y) cout<<#x<<"="<<(x)<<" "<<#y<<"="<<(y)<<endl;
#define DGGG(x,y,z) cout<<#x<<"="<<(x)<<" "<<#y<<"="<<(y)<<" "<<#z<<"="<<(z)<<endl;
#define PIar(a,n) rep(i,0,n-1)cout<<a[i]<<" ";PU()
#define PIarr(a,n,m) rep(aa,0,n-1){rep(bb,0,m-1)cout<<a[aa][bb]<<" ";PU()}
typedef pair<int, int> pii;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
const double EPS = 1e-9 ;
/*  ////////////////////////   C o d i n g  S p a c e   ////////////////////////  */
const int maxn = (int)1e3 + 9 ;
ll n;
void Solve() {
    while(cin>>n) {
        int t=sqrt(n);
        printf("%d %d\n",t,n/t );
    }
}
int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in", "r", stdin),freopen("1.out", "w", stdout);
#endif
//iostream::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    // int T;cin>>T;while(T--)
    Solve();
    return 0;
}

#include<bits/stdc++.h>
#include<stdio.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                  long long
#define scl(n)              scanf("%lld",&n)
#define scll(n, m)          scanf("%lld%lld",&n, &m)
#define scc(c)	            scanf("%c",&c)
#define fr(i,n)             for (ll i=0;i<n;i++)
#define fr1(i,n)            for(ll i=1;i<=n;i++)
#define pfl(x)              printf("%lld\n",x)
#define pb                  push_back
#define debug               cout<<"I am here"<<endl;
#define pno                 cout<<"NO"<<endl
#define pys                 cout<<"YES"<<endl
#define tcas(i,t)           for(ll i=1;i<=t;i++)
#define all(x) 	            (x).begin(), (x).end()
#define allrev(x)           (x).rbegin(),(x).rend()
#define pr                  pair<ll, ll>
#define ff                  first
#define ss                  second
#define pn                  printf("\n")

#define l(s)                s.size()
#define asort(a)            sort(a,a+n)
#define dsort(a)            sort(a,a+n,greater<int>())
#define uniquee(x)          x.erase(unique(x.begin(), x.end()),x.end())
#define el                  cout<<endl
#define md                  1000000007
#define inf                 1e18
#define ps                  cout<<" ";
#define Pai                 acos(-1.0)
#define mem(a,i)            memset(a, i, sizeof(a))
#define pcas(i)             cout<<"Case "<<i<<": "<<endl;
#define seg_tree(n) 	    ll left=n*2,right=l+1,mid=(l+r)/2
#define fast 	ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

#define N 200005

int main()
{
    ll t;
    //cin>>t;
    t=1;
    tcas(cs, t)
    {
        ll m,n,b,c,d,i,j,k,x,y,z,l,r, p, q;
        string s,s1, s2, s3, s4;

        ll cnt=0,cn=0,ans=0,sum=0 , mn=inf;
        scl(n);

        fr1(i , 1000001)
        {
            fr1(j , 100)
            {
                if(i*j==n )
                {
                    if(mn>  abs(i-j) )
                    {
                        mn=abs(i-j);
                        x=i , y=j;
                    }
                }
            }
        }

        if(x>y)swap(x, y);
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

#include<iostream>
#include<math.h>
using namespace std;
int is_prime(int num)
{
     if (num <= 1) return 0;
     if (num % 2 == 0 && num > 2) return 0;
     for(int i = 3; i < num / 2; i+= 2)
     {
         if (num % i == 0)
             return 0;
     }
     return 1;
}
int main()
{
    int n;
    cin >> n;
    int i;
    int m=100000;
   if(!is_prime(n))
    for(i=1;i<=sqrt(n);i++)
    {   //if(i<(n/i))
        m=min((n/i),m);
       // cout << m << " ";
    }
    else
    {
    cout << 1 << " " << n << endl;
        return 0;
    }
    cout << n/m  << " "<< m << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	for (int i = sqrt(n); i >= 1; i--)
		if (n%i == 0) {
			cout << n/i << ' ' << i << '\n';
		}
	return 0;
}

#include <bits/stdc++.h>
#define DEBUG cout << "AQUI!" << endl;

using namespace std;

int main(){

int display;
int a=0,b=0;
int i,j;
bool ativador=false;
cin >> display;
int novo=display;

	if(display>10)
	{    for(int i=2;i<display;i++)
		{
			if(display%i==0)
			{
				novo=display/i;
				if(novo<100000)break;
			}
		}
	}

	for(i=0;i<j;i++)
	{
		for(j=0;j<=novo;j++)
		{

			if(i*j==display){
						if(a==0 && b==0){
							a=i;
							b=j;
						}
						if(j-i < b-a && j>=i){
							a=i;
							b=j;
						}
			break;
			}
		}
	}
	cout << a << " " << b;

	return 0;

}

#include <bits/stdc++.h>

using namespace std;
string k;

int main()
{

    int n;
    scanf("%d" , &n);

    long long int kor=sqrt(n);
    long long int p(0);

//cout<<kor;

    for (int i=kor;i>0;i--){
        for (int j=i;j<n;j++){
            if (i*j==n){
                printf("%d%d" , i , " " , j);
                return 0;
            }
        }
    }
    printf("1 %d" , n);

    return 0;

}

#include<bits/stdc++.h>
using namespace std;
typedef long long int lng;

int main()
{
     lng n,i,sq;
     sq = sqrt(n)+1;
     cin>>n;
    for(i=sq;i>0;i--)
        {
            if(n%i==0)
            {
                cout<<i<<' '<<n/i<<endl;
                break;
            }
        }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    string s;
    cin>>n;
    for(int i=sqrt(n);i>1;i--)
    {
        if(n%i==0)
        {
            cout<<i<<" "<<n/i;
            break;
        }
    }
    return 0;
}

#include<bits/stdc++.h>
#define loop(i,n) for(ll i=0;i<n;i++)
#define LOOP(i,n) for(ll i=n-1;i>=0;i--)
#define cloop(i,k,n) for(ll i=k;i<=n;i++)
#define CLOOP(i,k,n) for(ll i=n;i>=k;i--)
#define float double
#define debug(x) cout<<(#x)<<" is "<<(x)<<endl
typedef long long ll;
using namespace std;
main()
{
    ll a,x,y;cin>>a;
    CLOOP(i,1,pow(a,0.5)){cloop(j,i,pow(a,0.5)*10){if(i*j==a){cout<<i<<" "<<j<<endl;return(0);}}}
    cout<<1<<" "<<a;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <deque>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int a = 1;
    for(int i = 1; i*i <=n; i++){
            cout << i*i <<" " << i<< endl;
        if(n%i == 0){
            a = i;

        }
    }

    cout <<a << " " << n/a << endl;
    return 0;
}

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int n,a;
    cin>>n;
    a=sqrt(n);
    if(n%a!=0)
    {
        a--;
    }
    cout<<a<<" "<<n/a<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	scanf("%d",&n);
	for(int i=ceil(sqrt(n));i>=0;i--){
		if(n%i==0){
			printf("%d %d",i,n/i);
			return 0;
		}
	}
}

#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int a,b,c;
    double d;
    cin>>a;
    d=sqrt(a);
    d=ceil(d);
    //cout<<d<<endl;
    if (a==d*d){
      cout<<d<<"  "<<d;
        return 0;
    }
    else {
        b=d+1;
        c=d;
        for(b;b<=a;b++){
             //   cout<<b<<endl;
            c=d;
           // cout<<c<<endl;
                for (int i=c;i>0;i--){
        if (a==b*i){
            cout<<i<<"  "<<b;
            return 0;
        }

        }}}
    return 0;
}

#include <cstdio>
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    int n=0,a=0,b=0,min=1000000;
    cin>>n;

    for(int i=1;i<sqrt(n);i++){

        if((n%i==0)&&((n/i)-i<min)){
            a=i;
            b=n/i;
            min=b-a;

        }
    }
    cout<<a<<" "<<b;
    return 0;
}

#include<iostream>
#include<cmath>
using namespace std;
int prime(int n)
{
    for(int i=3;i<n/2;i+=2)
    {
        if(n%i==0)
            return 0;
    }
    return 1;
}
int main()
{
    unsigned int n;
    cin>>n;
    if(n==999999){
        cout<<"999"<<" "<<"1001";
    return 0;}
    if(n%2==0)
    {
        int counter=0;
        while(true)
        {
            n/=2;
            counter++;
            if(n==1) break;
        }
        //cout<<counter<<endl;
        if(counter%2==0)
        {
             cout<<pow(2,counter/2)<<" "<<pow(2,counter/2)<<endl;
        }
        else
        {
            cout<<pow(2,counter/2)<<" "<<pow(2,counter/2+1)<<endl;
        }
    }
    else if(prime(n)==1)
    {
        cout<<"1"<<" "<<n<<endl;
    }
    else
    {
        int temp=n,j=0,a[100000];
        unsigned int mult1=1,mult2=1;
        for(int i=3;i<n/2;i+=2)
        {
            //out<<i<<endl;
            while(true)
            {
                if(temp%i!=0) break;
                temp/=i;
                a[j]=i;
                cout<<i<<endl;
                j++;
            }
            if(temp==1) break;
        }
        //cout<<"hello";
        if((j-1)%2==0)
            {
                //cout<<j<<endl;
               for(int i=0;i<j/2+1;i++)
                mult1=mult1*a[i];
                for(int i=j/2+1;i<j;i++)
                    mult2=mult2*a[i];
                    cout<<mult2<<" "<<mult1;
            }
             else
            {
               for(int i=0;i<j/2;i++)
                mult1*=a[i];
                for(int i=j/2;i<j;i++)
                    mult2*=a[i];
                    cout<<mult1<<" "<<mult2;
            }

        }
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    int n;
    cin >> n;
    int a = 1, b = n;
    for (int i = 1; i <= n / 2; i++) {
        if (n % i == 0) {
            a = i;
            b = n / i;
        }
    }
    cout << a << " " << b << "\n";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int n,i;
	cin>>n;
	int e,a,b;
	e=sqrt(n);
	for(i=e+1;i<=n;i++)
	{
		if(n%i==0)
		{
			a=i;
			break;
			}
		}
   b=n/a;
   cout<<b<<"\n"<<a;
	return 0;
}

#include<bits/stdc++.h>

using namespace std;

#define PF           printf
#define SF(n)        scanf("%d", &n)
#define SFF(a,b)     scanf("%d %d", &a, &b)
#define SFFF(a,b,c)  scanf("%d %d %d", &a, &b, &c)
#define INF_I        2147483647    //max limit
#define INF          1999999999
#define PB           push_back
#define MEM(n, val)  memset((n), val, sizeof(n))
#define F            first
#define S            second
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define ROF(i, a, b) for(int i = a; i >= b; i--)
#define ALL(c)       c.begin(), c.end()
#define BOOST        std::ios_base::sync_with_stdio(false);
#define INP          freopen("in.txt", "r", stdin);
#define OUT          freopen("out.txt", "w", stdout);
#define MP           make_pair
#define INIT_RAND    srand(time(NULL))
#define MOD          1000000007
#define A_SZ         1000000
template <class T>
inline std::string to_string (const T& t)
{
    std::stringstream ss;
    ss << t;
    return ss.str();
}

typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef priority_queue<int> P_Q;
typedef stringstream SS;

#define   sz 100005
int n;
int row,col;
int main()  {
    BOOST;
    cin>>n;

    int sqt=sqrt(n);

    if(n%2==1) {
        for(int i=1; i<=sqt; i+=2) {
            if(n%i==0 && i<=(n/i)){
                row=i;
                col=n/i;
            }
        }
        cout<<row<<" "<<col<<endl;
    }
    else{
            row=1;
            col=n;
          for(int i=2; i<=sqt; i+=2) {
            if(n%i==0 && i<=(n/i)){
                row=i;
                col=n/i;
            }
        }
        cout<<row<<" "<<col<<endl;
    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n,a,b,c,d;
    long long i,m;
    cin>>n;
    for(i=1;i<=n/2;i++){
        if(n%i==0){
            a=i;b=n/i;
            if(i==1)    m=fabs(b-a);
            if(fabs(b-a)<=m)
            {
                c=a;
                d=b;
                m=d-c;
                }
        }
        //cout<<c<<" "<<d<<endl;

    }
    cout<<std::min(c,d)<<" "<<max(c,d);
    return 0;
}

#include <bits/stdc++.h>
#define DEBUG cout << "AQUI!" << endl;
using namespace std;

int main(){
	int n;
		cin >> n;
		int a=0,b=n;
			for(int i=1;i<n;i++)
			{
				if(n%i==0){
					if(abs(i-n/i) < abs(b-a)){
						a = min(i,n/i);
						b = max(i,n/i);
					}
				}
			}
			cout << a << " " << b << endl;
}

// Example program
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int main()
{
  long long  n;
    cin>>n;
    long long m=n;
    long long s=n;
    if (n==0) {cout<<0<<" "<<0;return 0;}
    long long sum=sqrt(s);
    long long sum1=m/sum;
    for (int i=2; i <=sqrt(n); ++i) {
        if (n%i == 0){
            cout <<sum<<" "<<sum1<< endl;
            return 0;
        }
    }
    cout<<1<<" "<<m<<endl;
}

#include <bits/stdc++.h>

using namespace std;
using lli = long long int;

int main()
{
    lli n{}, halph{}, x{}, y{}, z{}, t{}, min_{LLONG_MAX};
    cin >> n;
    halph = n / 2;
    for(lli i{1}; i <= halph; ++ i){
        if(n % i == 0){
            t = n / i;
            z = abs(i - t);
            if(i > t){
                break;
            }else if(min_ >= z){
                x = i;
                y = t;
                min_ = z;
            }
        }
    }
    cout << x << ' ' << y;
    return EXIT_SUCCESS;
}

/*#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <string>
#include <sstream>
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define lson l,m,rt*2
#define rson m+1,r,rt*2+1
#define mt(A,B) memset(A,B,sizeof(A))
#define mod 1000000007
using namespace std;
typedef long long LL;
const int N=200000+10;
const LL INF=0x3f3f3f3f3f3f3f3fLL;
int a[N],p[N];
int main()
{
#ifdef Local
    freopen("data.txt","r",stdin);
#endif
    int n,k,cnt=0,t=0,num,ans,sum,cur;
    cin>>n>>k;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        if(a[i]<0)cnt++;
    }
    if(cnt>k)puts("-1");
    else
    {
        sum=0;
        ans=0;
        cur=0;
        for(int i=0;i<n;i++)
        {
            if(a[i]<0&&i-1<0)cur++;
            else if(a[i]<0&&i+1==n)cur++;
            else if(a[i+1]>=0&&a[i]<0)cur++;
        }
        for(int i=0;i<n;i++)
        {
            if(a[i]>=0)
            {
                sum++;
            }
            else
            {
                if(sum!=0)
                {
                    p[t]=sum;
                    //cout<<sum<<" "<<t<<" "<<p[t]<<endl;
                    sum=0;
                    t++;
                }
            }
        }
        if(a[n-1]>=0)p[t++]=sum;
        sort(p,p+t);
        //cout<<cur<<" "<<t<<endl;
        /*for(int i=0;i<t;i++)
        {
            cout<<p[i]<<" ";
        }
        cout<<endl;
        if(a[0]>=0)ans=-1;
        ans=ans+t+cur;
        num=k-cnt;
        for(int i=0;i<t;i++)
        {
            if(p[i]<=num&&p[i]>0)
            {
                num-=p[i];
                ans--
                ;
            }
            else break;
        }
        cout<<ans<<endl;
    }
}
*/
#include <iostream>
#include <queue>
#include <stack>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <string>
#include <sstream>
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define lson l,m,rt*2
#define rson m+1,r,rt*2+1
#define mt(A,B) memset(A,B,sizeof(A))
#define mod 1000000007
using namespace std;
typedef long long LL;
const int N=200000+10;
const LL INF=0x3f3f3f3f3f3f3f3fLL;

int main()
{
#ifdef Local
    freopen("data.txt","r",stdin);
#endif
   int i,j,k,n,p,a,b;
   cin>>n;
   p=N;
   a=1;
   b=n;
   for(int i=1;i<=n;i++)
   {
       //if(!n%i)cout<<1<<endl;
       if(n%i==0&&abs((n/i)-i)<p)
       {
           p=min(p,abs((n/i)-i));
           a=min(n/i,i);
           b=max(n/i,i);

       }
   }
   cout<<a<<" "<<b<<endl;

}

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  cin >> N;
  int A=1,B=N;
  for (int a = 1; a <=N; a++) {
    if (N % a == 0) {
      int b = N / a;
      if (b < a) {
        break;
      }
      /*if (B - A > b - a) {
        A = a;
        B = b;
      }*/
    }
  }
  cout << A << ' '  << B << endl;
  return 0;
}

#include <bits/stdc++.h>

#define out_file(x) freopen(x".in", "r", stdin); freopen(x".out", "w", stdout);
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define ls else
#define rtn return
#define sqr(x) (x)*(x)
#define mp make_pair
#define pb push_back
#define sd second
#define ft first
#define TAK "YES"
#define Tak "Yes"
#define tak "yes"

using namespace std;

typedef pair <int,int> pii;
typedef vector < pii > vii;
typedef vector <int> vi;
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    int n;
    cin >> n;
    int a = 1, b = n;
    for(int i = 1; i <= n; i++)
    {
        if(n%i == 0 && abs(n - 2*i) > abs(b - a))
            a = i,
            b = n-i;
        //cout << i << ' ' << a << ' ' << b << '\n';
    }
    cout << a << ' ' << b;

}

#include<bits/stdc++.h>
#include<stdio.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;

#define ll                  long long
#define scl(n)              scanf("%lld",&n)
#define scll(n, m)          scanf("%lld%lld",&n, &m)
#define scc(c)	            scanf("%c",&c)
#define fr(i,n)             for (ll i=0;i<n;i++)
#define fr1(i,n)            for(ll i=1;i<=n;i++)
#define pfl(x)              printf("%lld\n",x)
#define pb                  push_back
#define debug               cout<<"I am here"<<endl;
#define pno                 cout<<"NO"<<endl
#define pys                 cout<<"YES"<<endl
#define tcas(i,t)           for(ll i=1;i<=t;i++)
#define all(x) 	            (x).begin(), (x).end()
#define allrev(x)           (x).rbegin(),(x).rend()
#define pr                  pair<ll, ll>
#define ff                  first
#define ss                  second
#define pn                  printf("\n")

#define l(s)                s.size()
#define asort(a)            sort(a,a+n)
#define dsort(a)            sort(a,a+n,greater<int>())
#define uniquee(x)          x.erase(unique(x.begin(), x.end()),x.end())
#define el                  cout<<endl
#define md                  1000000007
#define inf                 1e18
#define ps                  cout<<" ";
#define Pai                 acos(-1.0)
#define mem(a,i)            memset(a, i, sizeof(a))
#define pcas(i)             cout<<"Case "<<i<<": "<<endl;
#define seg_tree(n) 	    ll left=n*2,right=l+1,mid=(l+r)/2
#define fast 	ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

#define N 200005

int main()
{
    ll t;
    //cin>>t;
    t=1;
    tcas(cs, t)
    {
        ll m,n,b,c,d,i,j,k,x,y,z,l,r, p, q;
        ll cnt=0,cn=0,ans=0,sum=0 , mn=inf;
        scl(n);

        ll rt=sqrt(n);

        x=y=-1;
        fr1(i , 100005)
        {
            j=rt;
            if(i*j==n )
            {
                if(mn>  abs(i-j) )
                {
                    mn=abs(i-j);
                    x=i , y=j;
                }
            }
        }

        if(x==-1)x=1, y=n;
        if(x>y )swap(x, y);
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

#include<iostream>
#include<math.h>
#include<string>
using namespace std;
int main(){
	int n,x=1,b,i=1;
	float s;
	cin >> n;
	x = sqrt(n);
	s = sqrt(n);
		if (x == s){ cout << x << " " << x << endl; return 0; }
		if (n % 2 == 0){
			b = sqrt(n);
			i = b;
			while (true){
				if (b*i == n){ cout << b << " " << i << endl; break; }
				i++;
				if (b*i > n){ b--; i = b; }
			}
		}
		if (n % 2 != 0)
		{

			if (n % 3 == 0){
				b = sqrt(n);
				i = b;
				while (true){
					if (b*i == n){ cout << b << " " << i << endl; break; }
					i++;
					if (b*i > n){ b--; i = b; }

				}
			}
			else cout << 1 << " " << n << endl;
		}

	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
#include <list>
#include <sstream>
#include <queue>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

//LAKAD MATATAAAG!!! Normalin, normalin.

int n;

int main() {
	cin >> n;
	for (int i = (int)sqrt(n); i <= n; i++) {
		if (!(n%i)) {
			cout << n / i << " " << i << endl;
			break;
		}
	}
	return 0;
}

#include<stdio.h>
int main()
{
long long int n,i,a,b,min=9999;
scanf("%lld",&n);
for(i=1;i<=n;i++)
{
if(n%i==0)
{
if(i<=n/i&&n/i-i<min)
{
min=n/i-i;
a=i;
b=n/i;
}
}
}
printf("%lld %lld\n",a,b);
return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a=1,b,ans=INT_MAX;
    cin>>n;
    b=n;
    for(int z=n;z>=0;z--)
    {
        if(a*b == n)
        {
            ans=min(ans,abs(a-b));
        }
    }
    cout<<ans;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    int one, two, least = 10000000;
    for(int i = 1; i < n; ++i) {
        if(n%i==0) {
            if(least > abs(i-n/i)) {
                least = abs(i-n/i);
                one = min(i, n/i);
                two = max(i, n/i);
            }
        }
    }
    cout << one << ' ' << two << '\n';
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,i,j,x,y;
    cin>>n;
    for(i=1;i<=n/2;i++)
        for(j=n;j>=n/2;j--)
            if(i*j==n)
                x=i,y=j;
    cout<<x<<" "<<y;
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

int main(){
	long long int n;
	cin >> n;
	long long int a,b;
	a = 1;
	b= n;
	long long int pa=1,pb=n;
	while(a <=  b){
		while(a*b < n) a++;
		if(a*b == n){
			pa = a;
			pb = b;
		}
		b--;
	}
	if(n==2) swap(pa,pb);
	cout << pa << " " << pb << endl;
}

#include<iostream>
#include<string>
#include<map>
#include<set>
using namespace std;
int main()
{
	int n;
	cin>>n;
   string ss;
   cin>>ss;
   int b=0;
   map<char,int> m;
   for(int i=0;i<n;i++)
   {
	   if(ss[i]=='?')
		   b++;
	   else
		   m[ss[i]]++;
   }
   for(int i=0;i<=b;i++)
   {
	   for(int j=0;j<=b;j++)
	   {
		   for(int k=0;k<=b;k++)
		   {
			   if(i+j+k<=b)
			   {
				   int c=b-i-j-k;
				   set<int> s;
				   s.insert(m['A']+i);
				   s.insert(m['G']+j);
				   s.insert(m['C']+k);
				   s.insert(m['T']+c);
				   if(s.size()==1)
				   {
					  int b1=i;
					  int b2=j;
					  int b3=k;
					  int b4=c;

						   for(int ii=0;ii<ss.size();ii++)
						   {
							   if(ss[ii]=='?'){
								   ss[ii]='A';
								   b1--;
							   }
							    if(b1==0)
							   break;
						   }

						    for(int ii=0;ii<ss.size();ii++)
						   {
							   if(ss[ii]=='?'){
								   ss[ii]='G';
								   b2--;
							   }
							    if(b2==0)
							   break;
						   }

						    for(int ii=0;ii<ss.size();ii++)
						   {
							   if(ss[ii]=='?'){
								   ss[ii]='T';
								   b4--;
							   }
							    if(b4==0)
							   break;
						   }

						    for(int ii=0;ii<ss.size();ii++)
						   {
							   if(ss[ii]=='?'){
								   ss[ii]='C';
								   b3--;
							   }
							    if(b3==0)
							   break;
						   }

					   break;
				   }
			   }
		   }
	   }
   }
   cout<<ss<<endl;

}

#include<bits/stdc++.h>
using namespace std;
pair<int,int>pr;
int main()
{
	int a,b,n;
	cin>>n;
	if(n==1)
	cout<<"1 1"<<endl;
	else
	{

	a=1;b=n;
	for(int i=2;a<b;i++)
	{ pr.first=a;pr.second=b;
		if(n%i==0)
		{
			a=i;b=n/i;
		}

	}
	cout<<pr.first<<" "<<pr.second<<endl;
}
}

#include <iostream>
#include <cstring>
#include <cmath>

using namespace std;

int main(void)
{
    int S, a, b;
    cin >> S;
    int y = ceil(sqrt(S));
    //cout << "y = " << y << endl;
    for (int i = 0; i < S; i++)
    {
    	if ( (y+i)*(y-i) == S )
    	{
    		cout << y - i << ' ' << y + i << endl;
    		return 0;
    	}
    }
    return 0;
}

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std ;
ll n ,m , x  ,z  , cnt  , ans,mx  , d  , xx , zz , y , T   ;
vector< ll > v , v1 ;
map< int , int > mp ;
float r ;
vector< pair < int  , int > > p ;
string s ;
char g ;
int main()
{
    cin >> x ;
    cnt = sqrt(x) ;
    if( x % cnt != 0 )
        cnt --  ;
    cout << cnt << " " <<   x / cnt ;
}

#include <iostream>
#include <math.h>
using namespace std;
int n;
int main () {
	cin >> n;
	int a = 1;
	int b = n;
	for (int i = 1; i < sqrt(n); i++) {
		if (n % i == 0) {
			a = i;
			b = n/i;
		}
	}
	cout << a << " " << b << endl;
}

#include <bits/stdc++.h>
// #include <boost/math/common_factor.hpp>
// #include <boost/algorithm/string.hpp>

#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define endl "\n"
#define MOD 1000000007
#define len(x) x.size()
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
#define all(v) v.begin(), v.end()
#define alla(a,n) a, a + n
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<string> vs;

// int isituniquee(string A)
// {
//   sort(A.begin(),A.end());
//   A.erase(unique(A.begin(),A.end()),A.end());
//   return (A.size());
//     // return A;
// }
// bool isPerfectSquare(long double x)
// {
//   // Find floating point value of
//   // square root of x.
//   long double sr = sqrt(x);

//   // If square root is an integer
//   return ((sr - floor(sr)) == 0);
// }

int32_t main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin) ;
    freopen("output.txt", "w", stdout) ;
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL) ; cout.tie(NULL) ;

    int n; cin >> n;//1 2 3 4 //
    int k = 0;
    // for (int i = 1; i <= n; i++)
    // {
    //     for (int j = n; j >= 1; j--)
    //     {
    //         if (i*j==n && i <= j)
    //         {
    //             cout << i << " "<< j;
    //             k = 1;
    //             break;
    //         }
    //     }
    //     if (k == 1)
    //     break;
    // }
    cout << 1 << " " << n;
return 0;
}

#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int main(){
	int n,x,y,minn=6666666;
	scanf("%d",&n);
	for(int i=1;i<=n/2;i++){
		if(n%i!=0) continue;
		if(abs(i-n/i)<minn){
			x=i,y=n/i;
			minn=abs(x-y);
		}
	}
	printf("%d %d",x,y);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	int *n1=&n;
	int i;
	int *i1=&i;
	cin>>*n1;
	for(*i1=(sqrt(*n1));*i1>=1;*i1--)
	{
		if(*n1%i==0)
		{
			cout<<*i1<<" "<<(*n1/(*i1))<<endl;
			return 0;
		}
	}
	return 0;
}

#include <bits/stdc++.h>
#define DEBUG cout << "AQUI!" << endl;
using namespace std;

int main(){
	int n;
		cin >> n;
		int a=0,b=n;
			for(int i=1;i<sqrt(n);i++)
			{
				if(n%i==0){
					if(i-n/i < b-a){
						a = min(i,n/i);
						b = max(i,n/i);
					}
				}
			}
			cout << a << " " << b << endl;
}