#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define time_taken_start int begtime = clock();
#define time_taken_end int endtime = clock(); \
                      cerr << "\n\n" << "Time elapsed: " << \
                      (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n"; \
                      return 0;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define mod 1000000007
#define inf 1000000000000000007
#define eps 0.0000000001
#define pi acosl(-1)
#define pii pair<int,int>
#define pdd pair<ld,ld>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define vii vector<int>
#define vpl vector<pll>
#define vll vector<ll>
#define mseti multiset <ll>
#define msetd multiset <ll,greater<ll>>
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define stp fixed<<setprecision(20)
#define endl '\n'
ull a;
ull power(ull x,ull y)
{
    ull res=1;

    while(y>0)
    {
        if(y&1)
            res=res*x;
        res%=a;
        y=y>>1;
        x=x*x;
        x%=a;
    }
    return res;
}
int main()
{
	FAST
	#ifdef ayk_16
		freopen("input.txt","rt",stdin);
		freopen("output.txt","wt",stdout);
	#endif
	cin>>a;
	ull q=power(10,17);
	ull val=0;
	for(ll i=1;i<=45;i++)
	{
		val+=q;
		val%=a;
	}
	q=val;
	val=0;
	for(ll i=1;i<=18;i++)
	{
		val+=q;
		val%=a;
	}
	q=a-val;
	cout<<q<<' '<<(q+1000000000000000000-1);
}


#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define time_taken_start int begtime = clock();
#define time_taken_end int endtime = clock(); \
                      cerr << "\n\n" << "Time elapsed: " << \
                      (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n"; \
                      return 0;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define mod 1000000007
#define inf 1000000000000000007
#define eps 0.0000000001
#define pi acosl(-1)
#define pii pair<int,int>
#define pdd pair<ld,ld>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define vii vector<int>
#define vpl vector<pll>
#define vll vector<ll>
#define mseti multiset <ll>
#define msetd multiset <ll,greater<ll>>
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define stp fixed<<setprecision(20)
#define endl '\n'
ull a;
ull power(ull x,ull y)
{
    ull res=1;

    while(y>0)
    {
        if(y&1)
            res=res*x;
        res%=a;
        y=y>>1;
        x=x*x;
        x%=a;
    }
    return res;
}
int main()
{
	FAST
	#ifdef ayk_16
		freopen("input.txt","rt",stdin);
		freopen("output.txt","wt",stdout);
	#endif
	cin>>a;
	ull q=power(10,17);
	ull val=1;
	for(ll i=1;i<=45;i++)
	{
		val+=q;
		val%=a;
	}
	q=val;
	for(ll i=1;i<=18;i++)
	{
		val+=q;
		val%=a;
	}
	q=a-val;
	cout<<q<<' '<<(q+1000000000000000000-1);
}


#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);
#define time_taken_start int begtime = clock();
#define time_taken_end int endtime = clock(); \
                      cerr << "\n\n" << "Time elapsed: " << \
                      (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n"; \
                      return 0;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define mod 1000000007
#define inf 1000000000000000007
#define eps 0.0000000001
#define pi acosl(-1)
#define pii pair<int,int>
#define pdd pair<ld,ld>
#define pll pair<ll,ll>
#define ff first
#define ss second
#define vii vector<int>
#define vpl vector<pll>
#define vll vector<ll>
#define mseti multiset <ll>
#define msetd multiset <ll,greater<ll>>
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define stp fixed<<setprecision(20)
#define endl '\n'
ull a;
ull power(ull x,ull y)
{
    ull res=1;

    while(y>0)
    {
        if(y&1)
            res=res*x;
        res%=a;
        y=y>>1;
        x=x*x;
        x%=a;
    }
    return res;
}
int main()
{
	FAST
	#ifdef ayk_16
		freopen("input.txt","rt",stdin);
		freopen("output.txt","wt",stdout);
	#endif
	cin>>a;
	ull q=power(10,17);
	ull val=0;
	for(ll i=1;i<=45;i++)
	{
		val+=q;
		val%=a;
	}
	q=val;
	for(ll i=1;i<=18;i++)
	{
		val+=q;
		val%=a;
	}
	q=a-val;
	cout<<q<<' '<<(q+1000000000000000000-1);
}


#include <bits/stdc++.h>
#define ull uint64_t
#define ll long long int
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define mx5 100005
#define mx52 200005
#define mx6 1000005
#define mod 1000000007
#define smod 998244353
#define nfs                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
using namespace std;

template <typename T>
bool MinPlace(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool MaxPlace(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename S, typename T>
ostream &operator<<(ostream &out, const pair<S, T> &p)
{
    out << "{" << p.ff << ", " << p.ss << "}";
    return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v)
{
    out << "[";
    for (int i = 0; i < (int)v.size(); i++)
    {
        out << v[i];
        if (i != (int)v.size() - 1)
            out << ", ";
    }
    out << "]";
    return out;
}

int main()
{
    nfs;
    int i, j, a;
    cin >> a;
    ll val = int64_t(1e17) % a;
    for (int i = 0; i < 45 * 18; i++)
        val = (val + int64_t(1e17)) % a;
    val = (val + 1) % a;
    ll x = (a - val) % a;
    cout << (x + 1) << " " << (int64_t(1e18) + x) << "\n";
}


#include <bits/stdc++.h>
#define ull uint64_t
#define ll long long int
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define mx5 100005
#define mx52 200005
#define mx6 1000005
#define mod 1000000007
#define smod 998244353
#define nfs                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
using namespace std;

template <typename T>
bool MinPlace(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool MaxPlace(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename S, typename T>
ostream &operator<<(ostream &out, const pair<S, T> &p)
{
    out << "{" << p.ff << ", " << p.ss << "}";
    return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v)
{
    out << "[";
    for (int i = 0; i < (int)v.size(); i++)
    {
        out << v[i];
        if (i != (int)v.size() - 1)
            out << ", ";
    }
    out << "]";
    return out;
}

int main()
{
    nfs;
    int i, j, a;
    cin >> a;
    ll val = long(1e17) % a;
    for (int i = 0; i < 45 * 18; i++)
        val = (val + long(1e17)) % a;
    val = (val + 1) % a;
    ll x = (a - val) % a;
    cout << x << " " << (long(1e18) + x) << "\n";
}


#include <bits/stdc++.h>
#define ull uint64_t
#define ll long long int
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define mx5 100005
#define mx52 200005
#define mx6 1000005
#define mod 1000000007
#define smod 998244353
#define nfs                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
using namespace std;

template <typename T>
bool MinPlace(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool MaxPlace(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename S, typename T>
ostream &operator<<(ostream &out, const pair<S, T> &p)
{
    out << "{" << p.ff << ", " << p.ss << "}";
    return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v)
{
    out << "[";
    for (int i = 0; i < (int)v.size(); i++)
    {
        out << v[i];
        if (i != (int)v.size() - 1)
            out << ", ";
    }
    out << "]";
    return out;
}

int main()
{
    nfs;
    int i, j, a;
    cin >> a;
    ll val = int64_t(1e17) % a;
    for (int i = 0; i < 45 * 18; i++)
        val = (val + int64_t(1e17)) % a;
    val = (val + 1) % a;
    ll x = (a - val) % a;
    cout << x << " " << (int64_t(1e18) + x) << "\n";
}


#include <bits/stdc++.h>
#define ull uint64_t
#define ll long long int
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define mx5 100005
#define mx52 200005
#define mx6 1000005
#define mod 1000000007
#define smod 998244353
#define nfs                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
using namespace std;

template <typename T>
bool MinPlace(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool MaxPlace(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename S, typename T>
ostream &operator<<(ostream &out, const pair<S, T> &p)
{
    out << "{" << p.ff << ", " << p.ss << "}";
    return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v)
{
    out << "[";
    for (int i = 0; i < (int)v.size(); i++)
    {
        out << v[i];
        if (i != (int)v.size() - 1)
            out << ", ";
    }
    out << "]";
    return out;
}

int main()
{
    nfs;
    ll a;
    cin >> a;
    ll v17 = 1, val = 0;
    for (int i = 0; i < 17; i++)
        v17 *= 10;
    for (int i = 0; i < (45 * 18); i++)
        val = (val + v17) % a;
    ll x = a - val % a;
    cout << x << " " << (v17 * 10 + x - 1) << "\n";
}


#include <bits/stdc++.h>
#define ull uint64_t
#define ll long long int
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define mx5 100005
#define mx52 200005
#define mx6 1000005
#define mod 1000000007
#define smod 998244353
#define nfs                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
using namespace std;

template <typename T>
bool MinPlace(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool MaxPlace(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename S, typename T>
ostream &operator<<(ostream &out, const pair<S, T> &p)
{
    out << "{" << p.ff << ", " << p.ss << "}";
    return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v)
{
    out << "[";
    for (int i = 0; i < (int)v.size(); i++)
    {
        out << v[i];
        if (i != (int)v.size() - 1)
            out << ", ";
    }
    out << "]";
    return out;
}

int main()
{
    nfs;
    ll a;
    cin >> a;
    ll v17 = 1, val = 0;
    for (int i = 0; i < 17; i++)
        v17 *= 10;
    for (int i = 0; i < (45 * 18); i++)
        val = (val + v17) % a;
    ll x = (a - val) % a;
    cout << x << " " << (v17 * 10 + x - 1) << "\n";
}


#include <bits/stdc++.h>
#define ull uint64_t
#define ll long long int
#define pb push_back
#define mp make_pair
#define pi pair<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define mx5 100005
#define mx52 200005
#define mx6 1000005
#define mod 1000000007
#define smod 998244353
#define nfs                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
using namespace std;

template <typename T>
bool MinPlace(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool MaxPlace(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename S, typename T>
ostream &operator<<(ostream &out, const pair<S, T> &p)
{
    out << "{" << p.ff << ", " << p.ss << "}";
    return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v)
{
    out << "[";
    for (int i = 0; i < (int)v.size(); i++)
    {
        out << v[i];
        if (i != (int)v.size() - 1)
            out << ", ";
    }
    out << "]";
    return out;
}

int main()
{
    nfs;
    int i, j, a;
    cin >> a;
    ll v17 = 1, val = 0;
    for (int i = 0; i < 17; i++)
        v17 *= 10;
    for (int i = 0; i < 45 * 18; i++)
        val = (val + v17) % a;
    ll x = (a - val) % a;
    cout << x << " " << (v17 * 10 + x - 1) << "\n";
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(int i=(a),_end_=(b);i<=_end_;i++)
#define DREP(i,a,b) for(int i=(a),_end_=(b);i>=_end_;i--)
#define EREP(i,a) for(int i=start[(a)];i;i=e[i].next)
template<class T>inline void chkmax(T &a,T b){ if(a<b)a=b;}
template<class T>inline void chkmin(T &a,T b){ if(a>b)a=b;}
#define fi first
#define se second
#define mkr(a,b) make_pair(a,b)
#define SZ(A) ((int)A.size())
inline int read()
{
	int sum=0,p=1;char ch=getchar();
	while(!(('0'<=ch && ch<='9') || ch=='-'))ch=getchar();
	if(ch=='-')p=-1,ch=getchar();
	while('0'<=ch && ch<='9')sum=sum*10+ch-48,ch=getchar();
	return sum*p;
}

int n;
ll a;

inline ll mul(ll a,ll b,const ll mod)
{
	a%=mod; b%=mod;
	return (( a*b - (ll)floor((long double)a/mod*b)*mod )%mod+mod)%mod;
}

ll x;

inline void Out(ll t)
{
	static ll rk[100],tp=0;
	while(t)rk[++tp]=t%10,t/=10;
	rk[20]=1;
	DREP(i,20,1)printf("%lld",rk[i]);
}

inline void init()
{
	cin>>a;
	x=1;
	REP(i,1,19)x=mul(x,10,a);
	x=mul(x,45,a); x=mul(x,19,a);
	x=(x+1)%a;
	ll t=a-x;
	printf("%lld ",t+1); Out(t);
}

int main()
{
	init();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(int i=(a),_end_=(b);i<=_end_;i++)
#define DREP(i,a,b) for(int i=(a),_end_=(b);i>=_end_;i--)
#define EREP(i,a) for(int i=start[(a)];i;i=e[i].next)
template<class T>inline void chkmax(T &a,T b){ if(a<b)a=b;}
template<class T>inline void chkmin(T &a,T b){ if(a>b)a=b;}
#define fi first
#define se second
#define mkr(a,b) make_pair(a,b)
#define SZ(A) ((int)A.size())
inline int read()
{
	int sum=0,p=1;char ch=getchar();
	while(!(('0'<=ch && ch<='9') || ch=='-'))ch=getchar();
	if(ch=='-')p=-1,ch=getchar();
	while('0'<=ch && ch<='9')sum=sum*10+ch-48,ch=getchar();
	return sum*p;
}

int n;
ll a;

inline ll mul(ll a,ll b,const ll mod)
{
	a%=mod; b%=mod;
	return (( a*b - (ll)floor((long double)a/mod*b)*mod )%mod+mod)%mod;
}

ll x;

inline void Out(ll t)
{
	static ll rk[100],tp=0;
	while(t)rk[++tp]=t%10,t/=10;
	rk[20]=1;
	DREP(i,20,1)printf("%lld",rk[i]);
}

inline void init()
{
	cin>>a;
	x=1;
	REP(i,1,19)x=mul(x,10,a);
	x=mul(x,45,a); x=mul(x,19,a);
	x=(x+1)%a;
	ll t=a-x;
	printf("%lld ",t); Out(t);
}

int main()
{
	init();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(int i=(a),_end_=(b);i<=_end_;i++)
#define DREP(i,a,b) for(int i=(a),_end_=(b);i>=_end_;i--)
#define EREP(i,a) for(int i=start[(a)];i;i=e[i].next)
template<class T>inline void chkmax(T &a,T b){ if(a<b)a=b;}
template<class T>inline void chkmin(T &a,T b){ if(a>b)a=b;}
#define fi first
#define se second
#define mkr(a,b) make_pair(a,b)
#define SZ(A) ((int)A.size())
inline int read()
{
	int sum=0,p=1;char ch=getchar();
	while(!(('0'<=ch && ch<='9') || ch=='-'))ch=getchar();
	if(ch=='-')p=-1,ch=getchar();
	while('0'<=ch && ch<='9')sum=sum*10+ch-48,ch=getchar();
	return sum*p;
}

const int maxp=20;

int n;
ll a;

inline ll mul(ll a,ll b,const ll mod)
{
	a%=mod; b%=mod;
	return (( a*b - (ll)floor((long double)a/mod*b)*mod )%mod+mod)%mod;
}

ll x;

inline void Out(ll t)
{
	static ll rk[100],tp=0;
	while(t)rk[++tp]=t%10,t/=10;
	rk[maxp+1]=1;
	DREP(i,maxp+1,1)printf("%lld",rk[i]);
}

inline void init()
{
	cin>>a;
	x=1;
	REP(i,1,maxp-1)x=mul(x,10,a);
	x=mul(x,45,a); x=mul(x,maxp,a);
	x=(x+1)%a;
	ll t=a-x;
	printf("%lld ",t+1); Out(t);
}

int main()
{
	init();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(int i=(a),_end_=(b);i<=_end_;i++)
#define DREP(i,a,b) for(int i=(a),_end_=(b);i>=_end_;i--)
#define EREP(i,a) for(int i=start[(a)];i;i=e[i].next)
template<class T>inline void chkmax(T &a,T b){ if(a<b)a=b;}
template<class T>inline void chkmin(T &a,T b){ if(a>b)a=b;}
#define fi first
#define se second
#define mkr(a,b) make_pair(a,b)
#define SZ(A) ((int)A.size())
inline int read()
{
	int sum=0,p=1;char ch=getchar();
	while(!(('0'<=ch && ch<='9') || ch=='-'))ch=getchar();
	if(ch=='-')p=-1,ch=getchar();
	while('0'<=ch && ch<='9')sum=sum*10+ch-48,ch=getchar();
	return sum*p;
}

const int maxp=3;

int n;
ll a;

inline ll mul(ll a,ll b,const ll mod)
{
	a%=mod; b%=mod;
	return (( a*b - (ll)floor((long double)a/mod*b)*mod )%mod+mod)%mod;
}

ll x;

inline void Out(ll t)
{
	static ll rk[100],tp=0;
	while(t)rk[++tp]=t%10,t/=10;
	rk[maxp+1]=1;
	DREP(i,maxp+1,1)printf("%lld",rk[i]);
}

inline void init()
{
	cin>>a;
	x=1;
	REP(i,1,maxp-1)x=mul(x,10,a);
	x=mul(x,45,a); x=mul(x,maxp,a);
	x=(x+1)%a;
	ll t=a-x;
	printf("%lld ",t+1); Out(t);
}

int main()
{
	init();
	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
unsigned long long power[20], AA;
unsigned long long solve(unsigned long long x) {
	x++;
	unsigned long long ret = 0, f[19];
	for (int i = 0; i < 19; i++) { f[i] = (x / power[i]) % 10; }
	for (int i = 18; i >= 0; i--) {
		unsigned long long B = 0, c = 0;
		while (x >= power[i]) { x -= power[i]; B += power[i]; ret += power[i] * c; c++; }
		for (int j = 18; j > i; j--)ret += f[j] * B;
		for (int j = i - 1; j >= 0; j--)ret += 45ULL * (B / 10ULL);
	}
	return ret;
}
unsigned long long sum(unsigned long long U) {
	string B = to_string(U);
	unsigned long long D = 0;
	for (int i = 0; i < B.size(); i++)D += (B[i] - '0');
	return D;
}
pair<unsigned long long, unsigned long long>solves(unsigned long long A) {
	unsigned long long L = 0, R = (3ULL << 56), M, minx = (1ULL << 60);
	for (int i = 0; i < 60; i++) {
		M = (L + R) / 2;
		unsigned long long V = solve(M);
		if (V < A) { L = M; }
		else { R = M; minx = min(minx, M); }
	}
	vector<unsigned long long>E; unsigned long long Q = solve(minx);
	for (int i = 0; i <= 20000; i++)E.push_back(solve(i));
	for (unsigned long long i = minx; i <= minx + 20000; i++) {
		int pos1 = lower_bound(E.begin(), E.end(), Q - A) - E.begin();
		if (pos1 < E.size() && E[pos1] == Q - A) {
			return make_pair(pos1 + 1, i);
		}
		Q += sum(i + 1);
	}
	return make_pair(0, 0);
}
int main() {
	cin >> AA; power[0] = 1; for (int i = 1; i < 20; i++)power[i] = power[i - 1] * 10ULL;
	unsigned long long BB = AA;
	while (BB <= (7ULL << 61)) {
		pair<unsigned long long, unsigned long long>V = solves(BB);
		if (V.first != 0ULL) { cout << V.first << " " << V.second << endl; break; }
	}
	return 0;
}


#include<iostream>
#include<cstring>
#include<cstdio>
#define ll long long
#define N 1000000000
using namespace std;
long long tmp[6],n,occ[1005],Res[1005],P[25];
struct G
{
	int s[5],len;
	G(){len=0;memset(s,0,sizeof(s));}
	G(ll x){memset(s,0,sizeof(s));for(len=0;x;x/=N) s[len++]=x%N;}
	G operator * (const G&b)
	{
		G c;c.len=min(len+b.len,5);
		memset(tmp,0,sizeof(tmp));
		for(int i=0;i<len;++i)
			for(int j=0;j<b.len;++j)
				tmp[i+j]+=1LL*s[i]*b.s[j];
		for(int i=0;i<c.len;++i) c.s[i]=tmp[i]%N,tmp[i+1]+=tmp[i]/N;
		for(;c.len&&c.s[c.len-1]==0;)--c.len;
		return c;
	}
	friend bool operator < (const G&a,const G&b)
	{
		if(a.len!=b.len) return a.len<b.len;
		for(int i=a.len-1;i>=0;--i)
			if(a.s[i]<b.s[i]) return true;
			else if(a.s[i]>b.s[i]) return false;
		return false;
	}
	G operator - (const G&b)
	{
		G c;c.len=len;
		for(int i=0;i<c.len;++i)
			if((c.s[i]+=s[i]-b.s[i])<0) c.s[i]+=N,--c.s[i+1];
		for(;c.len&&c.s[c.len-1]==0;) --c.len;
		return c;
	}
	G operator + (const G&b)
	{
		G c;c.len=max(b.len,len);
		for(int i=0;i<c.len;++i)
		{
			c.s[i]+=s[i]+b.s[i];
			if(c.s[i]>=N) ++c.s[i+1],c.s[i]-=N;
		}
		for(;c.len<5&&c.s[c.len];) ++c.len;
		return c;
	}
	ll num()
	{
	//	cout<<"Calcnum";
	//	for(int i=len-1;i>=0;--i) printf("%d  ",s[i]);
	//	cout<<endl;
		ll x=0;
		for(int i=len-1;i>=0;--i)
			x=x*N+s[i];
		return x;
	}
}pw[20],m,x;
int s[25],len;
G Calc(ll x)
{
//	cout<<"Calc"<<x<<endl;
	G res;len=0;ll pre=0;
	for(ll t=x;t;t/=10) s[++len]=t%10,P[len]=0;
	for(int i=1;i<=len;++i) for(int j=i;j;--j) P[i]=P[i]*10+s[j];
	for(int i=len;i;pre=pre*10+s[i],--i) for(int j=1;j<=9;++j)
	{
	//	cout<<i<<" "<<pre<<" *1e"<<i-1<<"*"<<j<<endl;
		res=res+G(pre)*pw[i-1]*G(j);
		if(j<s[i]) res=res+pw[i-1]*G(j);
		else if(j==s[i]) res=res+G(j)*G(P[i-1]+1);
	}
	return res;
}

int main()
{
	scanf("%lld",&n);m=G(n);pw[0]=G(1);
	for(int i=1;i<=18;++i) pw[i]=pw[i-1]*G(10);
	for(int t=1;;++t)
	{
		x=x+m;
		long long l=1,r=4e18,mid,res;
		while(l<=r)
		{
			mid=l+r>>1;
			if(Calc(mid)<x) l=mid+1;
			else res=mid,r=mid-1;
		}
	//	cout<<x.num()<<endl;
	//	cout<<Calc(res).num();
		ll f=(Calc(res)-x).num();
	//	cout<<t<<" "<<res<<" "<<f<<endl;
		if(occ[f]) return 0*printf("%lld %lld\n",Res[occ[f]]+1,res);
		else occ[f]=t,Res[t]=res;
	}
	return 0;
}


#include <bits/stdc++.h>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
#define MOD 1000000007LL
#define endl "\n"
#define fst first
#define snd second
const ll UNDEF = -1;
const ll INF=1e18;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
#ifdef DEBUG_CAT

#define dbg(...)   printf( __VA_ARGS__ )
#else
#define dbg(...)   /****nothing****/
#endif
/*
  ######################################################################
  #######################   THE   BIG   INT   ##########################
*/
const int base = 1000000000;
const int base_digits = 9;
struct bigint {
    vector<int> a;
    int sign;
    /*<arpa>*/
    int size(){
  if(a.empty())return 0;
  int ans=(a.size()-1)*base_digits;
  int ca=a.back();
  while(ca)
      ans++,ca/=10;
  return ans;
    }
    bigint operator ^(const bigint &v){
  bigint ans=1,a=*this,b=v;
  while(!b.isZero()){
      if(b%2)
    ans*=a;
      a*=a,b/=2;
  }
  return ans;
    }
    string to_string(){
  stringstream ss;
  ss << *this;
  string s;
  ss >> s;
  return s;
    }
    int sumof(){
  string s = to_string();
  int ans = 0;
  for(auto c : s)  ans += c - '0';
  return ans;
    }
    /*</arpa>*/
    bigint() :
  sign(1) {
    }

    bigint(long long v) {
  *this = v;
    }

    bigint(const string &s) {
  read(s);
    }

    void operator=(const bigint &v) {
  sign = v.sign;
  a = v.a;
    }

    void operator=(long long v) {
  sign = 1;
  a.clear();
  if (v < 0)
      sign = -1, v = -v;
  for (; v > 0; v = v / base)
      a.push_back(v % base);
    }

    bigint operator+(const bigint &v) const {
  if (sign == v.sign) {
      bigint res = v;

      for (int i = 0, carry = 0; i < (int) max(a.size(), v.a.size()) || carry; ++i) {
    if (i == (int) res.a.size())
        res.a.push_back(0);
    res.a[i] += carry + (i < (int) a.size() ? a[i] : 0);
    carry = res.a[i] >= base;
    if (carry)
        res.a[i] -= base;
      }
      return res;
  }
  return *this - (-v);
    }

    bigint operator-(const bigint &v) const {
  if (sign == v.sign) {
      if (abs() >= v.abs()) {
    bigint res = *this;
    for (int i = 0, carry = 0; i < (int) v.a.size() || carry; ++i) {
        res.a[i] -= carry + (i < (int) v.a.size() ? v.a[i] : 0);
        carry = res.a[i] < 0;
        if (carry)
      res.a[i] += base;
    }
    res.trim();
    return res;
      }
      return -(v - *this);
  }
  return *this + (-v);
    }

    void operator*=(int v) {
  if (v < 0)
      sign = -sign, v = -v;
  for (int i = 0, carry = 0; i < (int) a.size() || carry; ++i) {
      if (i == (int) a.size())
    a.push_back(0);
      long long cur = a[i] * (long long) v + carry;
      carry = (int) (cur / base);
      a[i] = (int) (cur % base);
      //asm("divl %%ecx" : "=a"(carry), "=d"(a[i]) : "A"(cur), "c"(base));
  }
  trim();
    }

    bigint operator*(int v) const {
  bigint res = *this;
  res *= v;
  return res;
    }

    friend pair<bigint, bigint> divmod(const bigint &a1, const bigint &b1) {
  int norm = base / (b1.a.back() + 1);
  bigint a = a1.abs() * norm;
  bigint b = b1.abs() * norm;
  bigint q, r;
  q.a.resize(a.a.size());

  for (int i = a.a.size() - 1; i >= 0; i--) {
      r *= base;
      r += a.a[i];
      int s1 = r.a.size() <= b.a.size() ? 0 : r.a[b.a.size()];
      int s2 = r.a.size() <= b.a.size() - 1 ? 0 : r.a[b.a.size() - 1];
      int d = ((long long) base * s1 + s2) / b.a.back();
      r -= b * d;
      while (r < 0)
    r += b, --d;
      q.a[i] = d;
  }

  q.sign = a1.sign * b1.sign;
  r.sign = a1.sign;
  q.trim();
  r.trim();
  return make_pair(q, r / norm);
    }

    bigint operator/(const bigint &v) const {
  return divmod(*this, v).first;
    }

    bigint operator%(const bigint &v) const {
  return divmod(*this, v).second;
    }

    void operator/=(int v) {
  if (v < 0)
      sign = -sign, v = -v;
  for (int i = (int) a.size() - 1, rem = 0; i >= 0; --i) {
      long long cur = a[i] + rem * (long long) base;
      a[i] = (int) (cur / v);
      rem = (int) (cur % v);
  }
  trim();
    }

    bigint operator/(int v) const {
  bigint res = *this;
  res /= v;
  return res;
    }

    int operator%(int v) const {
  if (v < 0)
      v = -v;
  int m = 0;
  for (int i = a.size() - 1; i >= 0; --i)
      m = (a[i] + m * (long long) base) % v;
  return m * sign;
    }

    void operator+=(const bigint &v) {
  *this = *this + v;
    }
    void operator-=(const bigint &v) {
  *this = *this - v;
    }
    void operator*=(const bigint &v) {
  *this = *this * v;
    }
    void operator/=(const bigint &v) {
  *this = *this / v;
    }

    bool operator<(const bigint &v) const {
  if (sign != v.sign)
      return sign < v.sign;
  if (a.size() != v.a.size())
      return a.size() * sign < v.a.size() * v.sign;
  for (int i = a.size() - 1; i >= 0; i--)
      if (a[i] != v.a[i])
    return a[i] * sign < v.a[i] * sign;
  return false;
    }

    bool operator>(const bigint &v) const {
  return v < *this;
    }
    bool operator<=(const bigint &v) const {
  return !(v < *this);
    }
    bool operator>=(const bigint &v) const {
  return !(*this < v);
    }
    bool operator==(const bigint &v) const {
  return !(*this < v) && !(v < *this);
    }
    bool operator!=(const bigint &v) const {
  return *this < v || v < *this;
    }

    void trim() {
  while (!a.empty() && !a.back())
      a.pop_back();
  if (a.empty())
      sign = 1;
    }

    bool isZero() const {
  return a.empty() || (a.size() == 1 && !a[0]);
    }

    bigint operator-() const {
  bigint res = *this;
  res.sign = -sign;
  return res;
    }

    bigint abs() const {
  bigint res = *this;
  res.sign *= res.sign;
  return res;
    }

    long long longValue() const {
  long long res = 0;
  for (int i = a.size() - 1; i >= 0; i--)
      res = res * base + a[i];
  return res * sign;
    }

    friend bigint gcd(const bigint &a, const bigint &b) {
  return b.isZero() ? a : gcd(b, a % b);
    }
    friend bigint lcm(const bigint &a, const bigint &b) {
  return a / gcd(a, b) * b;
    }

    void read(const string &s) {
  sign = 1;
  a.clear();
  int pos = 0;
  while (pos < (int) s.size() && (s[pos] == '-' || s[pos] == '+')) {
      if (s[pos] == '-')
    sign = -sign;
      ++pos;
  }
  for (int i = s.size() - 1; i >= pos; i -= base_digits) {
      int x = 0;
      for (int j = max(pos, i - base_digits + 1); j <= i; j++)
    x = x * 10 + s[j] - '0';
      a.push_back(x);
  }
  trim();
    }

    friend istream& operator>>(istream &stream, bigint &v) {
  string s;
  stream >> s;
  v.read(s);
  return stream;
    }

    friend ostream& operator<<(ostream &stream, const bigint &v) {
  if (v.sign == -1)
      stream << '-';
  stream << (v.a.empty() ? 0 : v.a.back());
  for (int i = (int) v.a.size() - 2; i >= 0; --i)
      stream << setw(base_digits) << setfill('0') << v.a[i];
  return stream;
    }

    static vector<int> convert_base(const vector<int> &a, int old_digits, int new_digits) {
  vector<long long> p(max(old_digits, new_digits) + 1);
  p[0] = 1;
  for (int i = 1; i < (int) p.size(); i++)
      p[i] = p[i - 1] * 10;
  vector<int> res;
  long long cur = 0;
  int cur_digits = 0;
  for (int i = 0; i < (int) a.size(); i++) {
      cur += a[i] * p[cur_digits];
      cur_digits += old_digits;
      while (cur_digits >= new_digits) {
    res.push_back(int(cur % p[new_digits]));
    cur /= p[new_digits];
    cur_digits -= new_digits;
      }
  }
  res.push_back((int) cur);
  while (!res.empty() && !res.back())
      res.pop_back();
  return res;
    }

    typedef vector<long long> vll;

    static vll karatsubaMultiply(const vll &a, const vll &b) {
  int n = a.size();
  vll res(n + n);
  if (n <= 32) {
      for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
        res[i + j] += a[i] * b[j];
      return res;
  }

  int k = n >> 1;
  vll a1(a.begin(), a.begin() + k);
  vll a2(a.begin() + k, a.end());
  vll b1(b.begin(), b.begin() + k);
  vll b2(b.begin() + k, b.end());

  vll a1b1 = karatsubaMultiply(a1, b1);
  vll a2b2 = karatsubaMultiply(a2, b2);

  for (int i = 0; i < k; i++)
      a2[i] += a1[i];
  for (int i = 0; i < k; i++)
      b2[i] += b1[i];

  vll r = karatsubaMultiply(a2, b2);
  for (int i = 0; i < (int) a1b1.size(); i++)
      r[i] -= a1b1[i];
  for (int i = 0; i < (int) a2b2.size(); i++)
      r[i] -= a2b2[i];

  for (int i = 0; i < (int) r.size(); i++)
      res[i + k] += r[i];
  for (int i = 0; i < (int) a1b1.size(); i++)
      res[i] += a1b1[i];
  for (int i = 0; i < (int) a2b2.size(); i++)
      res[i + n] += a2b2[i];
  return res;
    }

    bigint operator*(const bigint &v) const {
  vector<int> a6 = convert_base(this->a, base_digits, 6);
  vector<int> b6 = convert_base(v.a, base_digits, 6);
  vll a(a6.begin(), a6.end());
  vll b(b6.begin(), b6.end());
  while (a.size() < b.size())
      a.push_back(0);
  while (b.size() < a.size())
      b.push_back(0);
  while (a.size() & (a.size() - 1))
      a.push_back(0), b.push_back(0);
  vll c = karatsubaMultiply(a, b);
  bigint res;
  res.sign = sign * v.sign;
  for (int i = 0, carry = 0; i < (int) c.size(); i++) {
      long long cur = c[i] + carry;
      res.a.push_back((int) (cur % 1000000));
      carry = (int) (cur / 1000000);
  }
  res.a = convert_base(res.a, 6, base_digits);
  res.trim();
  return res;
    }
};
/*
  #######################   THE   BIG   INT   ##########################
  ######################################################################
*/
ll f(ll x) {
  ll ans=0;
  while(x>0) {
    ans+=x%10;
    x/=10;
  }
  return ans;
}
void check(ll l, ll r, ll a) {
  assert(l>0);
  assert(l<=r);
  ll ans=0;
  for (ll x=l;x<=r;x++) {
    ans=(ans+f(x))%a;
  }
  assert(ans==0);
}
bool solve(ll _a) {
  ll n=50;
  bigint a(_a);
  bigint rhs(45*n);
  for (ll i=0;i<n-1;i++) rhs=rhs*10;
  bigint k=(rhs+a-1)/a;
  bigint x=k*a-rhs;
  if (x==0) x+=a;
  bigint tn=1;
  for (ll i=0;i<n;i++) tn*=10;
  bigint r=tn+x-1;
  bigint l=x;
  cout<<l<<" "<<r<<endl;
  //check(l.longValue(),r.longValue(),_a);
}
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
  //for (ll a=1;a<=1000;a++) solve(a);
  //return 0;
  ll _a; cin>>_a;
  //if (_a==1) {
  //  cout<<"1 2"<<endl;
  //  return 0;
  //}
  solve(_a);
}


#include <bits/stdc++.h>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
#define MOD 1000000007LL
#define endl "\n"
#define fst first
#define snd second
const ll UNDEF = -1;
const ll INF=1e18;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
#ifdef DEBUG_CAT

#define dbg(...)   printf( __VA_ARGS__ )
#else
#define dbg(...)   /****nothing****/
#endif
/*
  ######################################################################
  #######################   THE   BIG   INT   ##########################
*/
const int base = 1000000000;
const int base_digits = 9;
struct bigint {
    vector<int> a;
    int sign;
    /*<arpa>*/
    int size(){
  if(a.empty())return 0;
  int ans=(a.size()-1)*base_digits;
  int ca=a.back();
  while(ca)
      ans++,ca/=10;
  return ans;
    }
    bigint operator ^(const bigint &v){
  bigint ans=1,a=*this,b=v;
  while(!b.isZero()){
      if(b%2)
    ans*=a;
      a*=a,b/=2;
  }
  return ans;
    }
    string to_string(){
  stringstream ss;
  ss << *this;
  string s;
  ss >> s;
  return s;
    }
    int sumof(){
  string s = to_string();
  int ans = 0;
  for(auto c : s)  ans += c - '0';
  return ans;
    }
    /*</arpa>*/
    bigint() :
  sign(1) {
    }

    bigint(long long v) {
  *this = v;
    }

    bigint(const string &s) {
  read(s);
    }

    void operator=(const bigint &v) {
  sign = v.sign;
  a = v.a;
    }

    void operator=(long long v) {
  sign = 1;
  a.clear();
  if (v < 0)
      sign = -1, v = -v;
  for (; v > 0; v = v / base)
      a.push_back(v % base);
    }

    bigint operator+(const bigint &v) const {
  if (sign == v.sign) {
      bigint res = v;

      for (int i = 0, carry = 0; i < (int) max(a.size(), v.a.size()) || carry; ++i) {
    if (i == (int) res.a.size())
        res.a.push_back(0);
    res.a[i] += carry + (i < (int) a.size() ? a[i] : 0);
    carry = res.a[i] >= base;
    if (carry)
        res.a[i] -= base;
      }
      return res;
  }
  return *this - (-v);
    }

    bigint operator-(const bigint &v) const {
  if (sign == v.sign) {
      if (abs() >= v.abs()) {
    bigint res = *this;
    for (int i = 0, carry = 0; i < (int) v.a.size() || carry; ++i) {
        res.a[i] -= carry + (i < (int) v.a.size() ? v.a[i] : 0);
        carry = res.a[i] < 0;
        if (carry)
      res.a[i] += base;
    }
    res.trim();
    return res;
      }
      return -(v - *this);
  }
  return *this + (-v);
    }

    void operator*=(int v) {
  if (v < 0)
      sign = -sign, v = -v;
  for (int i = 0, carry = 0; i < (int) a.size() || carry; ++i) {
      if (i == (int) a.size())
    a.push_back(0);
      long long cur = a[i] * (long long) v + carry;
      carry = (int) (cur / base);
      a[i] = (int) (cur % base);
      //asm("divl %%ecx" : "=a"(carry), "=d"(a[i]) : "A"(cur), "c"(base));
  }
  trim();
    }

    bigint operator*(int v) const {
  bigint res = *this;
  res *= v;
  return res;
    }

    friend pair<bigint, bigint> divmod(const bigint &a1, const bigint &b1) {
  int norm = base / (b1.a.back() + 1);
  bigint a = a1.abs() * norm;
  bigint b = b1.abs() * norm;
  bigint q, r;
  q.a.resize(a.a.size());

  for (int i = a.a.size() - 1; i >= 0; i--) {
      r *= base;
      r += a.a[i];
      int s1 = r.a.size() <= b.a.size() ? 0 : r.a[b.a.size()];
      int s2 = r.a.size() <= b.a.size() - 1 ? 0 : r.a[b.a.size() - 1];
      int d = ((long long) base * s1 + s2) / b.a.back();
      r -= b * d;
      while (r < 0)
    r += b, --d;
      q.a[i] = d;
  }

  q.sign = a1.sign * b1.sign;
  r.sign = a1.sign;
  q.trim();
  r.trim();
  return make_pair(q, r / norm);
    }

    bigint operator/(const bigint &v) const {
  return divmod(*this, v).first;
    }

    bigint operator%(const bigint &v) const {
  return divmod(*this, v).second;
    }

    void operator/=(int v) {
  if (v < 0)
      sign = -sign, v = -v;
  for (int i = (int) a.size() - 1, rem = 0; i >= 0; --i) {
      long long cur = a[i] + rem * (long long) base;
      a[i] = (int) (cur / v);
      rem = (int) (cur % v);
  }
  trim();
    }

    bigint operator/(int v) const {
  bigint res = *this;
  res /= v;
  return res;
    }

    int operator%(int v) const {
  if (v < 0)
      v = -v;
  int m = 0;
  for (int i = a.size() - 1; i >= 0; --i)
      m = (a[i] + m * (long long) base) % v;
  return m * sign;
    }

    void operator+=(const bigint &v) {
  *this = *this + v;
    }
    void operator-=(const bigint &v) {
  *this = *this - v;
    }
    void operator*=(const bigint &v) {
  *this = *this * v;
    }
    void operator/=(const bigint &v) {
  *this = *this / v;
    }

    bool operator<(const bigint &v) const {
  if (sign != v.sign)
      return sign < v.sign;
  if (a.size() != v.a.size())
      return a.size() * sign < v.a.size() * v.sign;
  for (int i = a.size() - 1; i >= 0; i--)
      if (a[i] != v.a[i])
    return a[i] * sign < v.a[i] * sign;
  return false;
    }

    bool operator>(const bigint &v) const {
  return v < *this;
    }
    bool operator<=(const bigint &v) const {
  return !(v < *this);
    }
    bool operator>=(const bigint &v) const {
  return !(*this < v);
    }
    bool operator==(const bigint &v) const {
  return !(*this < v) && !(v < *this);
    }
    bool operator!=(const bigint &v) const {
  return *this < v || v < *this;
    }

    void trim() {
  while (!a.empty() && !a.back())
      a.pop_back();
  if (a.empty())
      sign = 1;
    }

    bool isZero() const {
  return a.empty() || (a.size() == 1 && !a[0]);
    }

    bigint operator-() const {
  bigint res = *this;
  res.sign = -sign;
  return res;
    }

    bigint abs() const {
  bigint res = *this;
  res.sign *= res.sign;
  return res;
    }

    long long longValue() const {
  long long res = 0;
  for (int i = a.size() - 1; i >= 0; i--)
      res = res * base + a[i];
  return res * sign;
    }

    friend bigint gcd(const bigint &a, const bigint &b) {
  return b.isZero() ? a : gcd(b, a % b);
    }
    friend bigint lcm(const bigint &a, const bigint &b) {
  return a / gcd(a, b) * b;
    }

    void read(const string &s) {
  sign = 1;
  a.clear();
  int pos = 0;
  while (pos < (int) s.size() && (s[pos] == '-' || s[pos] == '+')) {
      if (s[pos] == '-')
    sign = -sign;
      ++pos;
  }
  for (int i = s.size() - 1; i >= pos; i -= base_digits) {
      int x = 0;
      for (int j = max(pos, i - base_digits + 1); j <= i; j++)
    x = x * 10 + s[j] - '0';
      a.push_back(x);
  }
  trim();
    }

    friend istream& operator>>(istream &stream, bigint &v) {
  string s;
  stream >> s;
  v.read(s);
  return stream;
    }

    friend ostream& operator<<(ostream &stream, const bigint &v) {
  if (v.sign == -1)
      stream << '-';
  stream << (v.a.empty() ? 0 : v.a.back());
  for (int i = (int) v.a.size() - 2; i >= 0; --i)
      stream << setw(base_digits) << setfill('0') << v.a[i];
  return stream;
    }

    static vector<int> convert_base(const vector<int> &a, int old_digits, int new_digits) {
  vector<long long> p(max(old_digits, new_digits) + 1);
  p[0] = 1;
  for (int i = 1; i < (int) p.size(); i++)
      p[i] = p[i - 1] * 10;
  vector<int> res;
  long long cur = 0;
  int cur_digits = 0;
  for (int i = 0; i < (int) a.size(); i++) {
      cur += a[i] * p[cur_digits];
      cur_digits += old_digits;
      while (cur_digits >= new_digits) {
    res.push_back(int(cur % p[new_digits]));
    cur /= p[new_digits];
    cur_digits -= new_digits;
      }
  }
  res.push_back((int) cur);
  while (!res.empty() && !res.back())
      res.pop_back();
  return res;
    }

    typedef vector<long long> vll;

    static vll karatsubaMultiply(const vll &a, const vll &b) {
  int n = a.size();
  vll res(n + n);
  if (n <= 32) {
      for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
        res[i + j] += a[i] * b[j];
      return res;
  }

  int k = n >> 1;
  vll a1(a.begin(), a.begin() + k);
  vll a2(a.begin() + k, a.end());
  vll b1(b.begin(), b.begin() + k);
  vll b2(b.begin() + k, b.end());

  vll a1b1 = karatsubaMultiply(a1, b1);
  vll a2b2 = karatsubaMultiply(a2, b2);

  for (int i = 0; i < k; i++)
      a2[i] += a1[i];
  for (int i = 0; i < k; i++)
      b2[i] += b1[i];

  vll r = karatsubaMultiply(a2, b2);
  for (int i = 0; i < (int) a1b1.size(); i++)
      r[i] -= a1b1[i];
  for (int i = 0; i < (int) a2b2.size(); i++)
      r[i] -= a2b2[i];

  for (int i = 0; i < (int) r.size(); i++)
      res[i + k] += r[i];
  for (int i = 0; i < (int) a1b1.size(); i++)
      res[i] += a1b1[i];
  for (int i = 0; i < (int) a2b2.size(); i++)
      res[i + n] += a2b2[i];
  return res;
    }

    bigint operator*(const bigint &v) const {
  vector<int> a6 = convert_base(this->a, base_digits, 6);
  vector<int> b6 = convert_base(v.a, base_digits, 6);
  vll a(a6.begin(), a6.end());
  vll b(b6.begin(), b6.end());
  while (a.size() < b.size())
      a.push_back(0);
  while (b.size() < a.size())
      b.push_back(0);
  while (a.size() & (a.size() - 1))
      a.push_back(0), b.push_back(0);
  vll c = karatsubaMultiply(a, b);
  bigint res;
  res.sign = sign * v.sign;
  for (int i = 0, carry = 0; i < (int) c.size(); i++) {
      long long cur = c[i] + carry;
      res.a.push_back((int) (cur % 1000000));
      carry = (int) (cur / 1000000);
  }
  res.a = convert_base(res.a, 6, base_digits);
  res.trim();
  return res;
    }
};
/*
  #######################   THE   BIG   INT   ##########################
  ######################################################################
*/
ll f(ll x) {
  ll ans=0;
  while(x>0) {
    ans+=x%10;
    x/=10;
  }
  return ans;
}
void check(ll l, ll r, ll a) {
  ll ans=0;
  for (ll x=l;x<=r;x++) {
    ans=(ans+f(x))%a;
  }
  assert(ans==0);
}
bool solven(ll _a, ll n) {
  bigint a(_a);
  bigint rhs(45*n);
  for (ll i=0;i<n-1;i++) rhs=rhs*10;
  bigint k=(rhs+a-1)/a;
  bigint x=k*a-rhs;
  if (x==0) return false;
  bigint tn=1;
  for (ll i=0;i<n;i++) tn*=10;
  bigint r=tn+x-1;
  bigint l=x;
  cout<<l<<" "<<r<<endl;
  return true;
}
void solve(ll _a) {
  for (ll n=40;n<80;n++) {
    bool got=solven(_a,n);
    if (got) return;
  }
  //cout<<"k:"<<k<<" k*a:"<<k*a<< " rhs:"<<rhs<<endl;
  //check(l.longValue(), r.longValue(), _a);
}
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
  //for (ll a=1;a<=1000;a++) solve(a);
  //return 0;
  ll _a; cin>>_a;
  if (_a==1) {
    cout<<"1 2"<<endl;
    return 0;
  }
  solve(_a);
}


#include <bits/stdc++.h>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define PB push_back
#define MP make_pair
#define MOD 1000000007LL
#define endl "\n"
#define fst first
#define snd second
const ll UNDEF = -1;
const ll INF=1e18;
template<typename T> inline bool chkmax(T &aa, T bb) { return aa < bb ? aa = bb, true : false; }
template<typename T> inline bool chkmin(T &aa, T bb) { return aa > bb ? aa = bb, true : false; }
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
#ifdef DEBUG_CAT

#define dbg(...)   printf( __VA_ARGS__ )
#else
#define dbg(...)   /****nothing****/
#endif
/*
  ######################################################################
  #######################   THE   BIG   INT   ##########################
*/
const int base = 1000000000;
const int base_digits = 9;
struct bigint {
    vector<int> a;
    int sign;
    /*<arpa>*/
    int size(){
  if(a.empty())return 0;
  int ans=(a.size()-1)*base_digits;
  int ca=a.back();
  while(ca)
      ans++,ca/=10;
  return ans;
    }
    bigint operator ^(const bigint &v){
  bigint ans=1,a=*this,b=v;
  while(!b.isZero()){
      if(b%2)
    ans*=a;
      a*=a,b/=2;
  }
  return ans;
    }
    string to_string(){
  stringstream ss;
  ss << *this;
  string s;
  ss >> s;
  return s;
    }
    int sumof(){
  string s = to_string();
  int ans = 0;
  for(auto c : s)  ans += c - '0';
  return ans;
    }
    /*</arpa>*/
    bigint() :
  sign(1) {
    }

    bigint(long long v) {
  *this = v;
    }

    bigint(const string &s) {
  read(s);
    }

    void operator=(const bigint &v) {
  sign = v.sign;
  a = v.a;
    }

    void operator=(long long v) {
  sign = 1;
  a.clear();
  if (v < 0)
      sign = -1, v = -v;
  for (; v > 0; v = v / base)
      a.push_back(v % base);
    }

    bigint operator+(const bigint &v) const {
  if (sign == v.sign) {
      bigint res = v;

      for (int i = 0, carry = 0; i < (int) max(a.size(), v.a.size()) || carry; ++i) {
    if (i == (int) res.a.size())
        res.a.push_back(0);
    res.a[i] += carry + (i < (int) a.size() ? a[i] : 0);
    carry = res.a[i] >= base;
    if (carry)
        res.a[i] -= base;
      }
      return res;
  }
  return *this - (-v);
    }

    bigint operator-(const bigint &v) const {
  if (sign == v.sign) {
      if (abs() >= v.abs()) {
    bigint res = *this;
    for (int i = 0, carry = 0; i < (int) v.a.size() || carry; ++i) {
        res.a[i] -= carry + (i < (int) v.a.size() ? v.a[i] : 0);
        carry = res.a[i] < 0;
        if (carry)
      res.a[i] += base;
    }
    res.trim();
    return res;
      }
      return -(v - *this);
  }
  return *this + (-v);
    }

    void operator*=(int v) {
  if (v < 0)
      sign = -sign, v = -v;
  for (int i = 0, carry = 0; i < (int) a.size() || carry; ++i) {
      if (i == (int) a.size())
    a.push_back(0);
      long long cur = a[i] * (long long) v + carry;
      carry = (int) (cur / base);
      a[i] = (int) (cur % base);
      //asm("divl %%ecx" : "=a"(carry), "=d"(a[i]) : "A"(cur), "c"(base));
  }
  trim();
    }

    bigint operator*(int v) const {
  bigint res = *this;
  res *= v;
  return res;
    }

    friend pair<bigint, bigint> divmod(const bigint &a1, const bigint &b1) {
  int norm = base / (b1.a.back() + 1);
  bigint a = a1.abs() * norm;
  bigint b = b1.abs() * norm;
  bigint q, r;
  q.a.resize(a.a.size());

  for (int i = a.a.size() - 1; i >= 0; i--) {
      r *= base;
      r += a.a[i];
      int s1 = r.a.size() <= b.a.size() ? 0 : r.a[b.a.size()];
      int s2 = r.a.size() <= b.a.size() - 1 ? 0 : r.a[b.a.size() - 1];
      int d = ((long long) base * s1 + s2) / b.a.back();
      r -= b * d;
      while (r < 0)
    r += b, --d;
      q.a[i] = d;
  }

  q.sign = a1.sign * b1.sign;
  r.sign = a1.sign;
  q.trim();
  r.trim();
  return make_pair(q, r / norm);
    }

    bigint operator/(const bigint &v) const {
  return divmod(*this, v).first;
    }

    bigint operator%(const bigint &v) const {
  return divmod(*this, v).second;
    }

    void operator/=(int v) {
  if (v < 0)
      sign = -sign, v = -v;
  for (int i = (int) a.size() - 1, rem = 0; i >= 0; --i) {
      long long cur = a[i] + rem * (long long) base;
      a[i] = (int) (cur / v);
      rem = (int) (cur % v);
  }
  trim();
    }

    bigint operator/(int v) const {
  bigint res = *this;
  res /= v;
  return res;
    }

    int operator%(int v) const {
  if (v < 0)
      v = -v;
  int m = 0;
  for (int i = a.size() - 1; i >= 0; --i)
      m = (a[i] + m * (long long) base) % v;
  return m * sign;
    }

    void operator+=(const bigint &v) {
  *this = *this + v;
    }
    void operator-=(const bigint &v) {
  *this = *this - v;
    }
    void operator*=(const bigint &v) {
  *this = *this * v;
    }
    void operator/=(const bigint &v) {
  *this = *this / v;
    }

    bool operator<(const bigint &v) const {
  if (sign != v.sign)
      return sign < v.sign;
  if (a.size() != v.a.size())
      return a.size() * sign < v.a.size() * v.sign;
  for (int i = a.size() - 1; i >= 0; i--)
      if (a[i] != v.a[i])
    return a[i] * sign < v.a[i] * sign;
  return false;
    }

    bool operator>(const bigint &v) const {
  return v < *this;
    }
    bool operator<=(const bigint &v) const {
  return !(v < *this);
    }
    bool operator>=(const bigint &v) const {
  return !(*this < v);
    }
    bool operator==(const bigint &v) const {
  return !(*this < v) && !(v < *this);
    }
    bool operator!=(const bigint &v) const {
  return *this < v || v < *this;
    }

    void trim() {
  while (!a.empty() && !a.back())
      a.pop_back();
  if (a.empty())
      sign = 1;
    }

    bool isZero() const {
  return a.empty() || (a.size() == 1 && !a[0]);
    }

    bigint operator-() const {
  bigint res = *this;
  res.sign = -sign;
  return res;
    }

    bigint abs() const {
  bigint res = *this;
  res.sign *= res.sign;
  return res;
    }

    long long longValue() const {
  long long res = 0;
  for (int i = a.size() - 1; i >= 0; i--)
      res = res * base + a[i];
  return res * sign;
    }

    friend bigint gcd(const bigint &a, const bigint &b) {
  return b.isZero() ? a : gcd(b, a % b);
    }
    friend bigint lcm(const bigint &a, const bigint &b) {
  return a / gcd(a, b) * b;
    }

    void read(const string &s) {
  sign = 1;
  a.clear();
  int pos = 0;
  while (pos < (int) s.size() && (s[pos] == '-' || s[pos] == '+')) {
      if (s[pos] == '-')
    sign = -sign;
      ++pos;
  }
  for (int i = s.size() - 1; i >= pos; i -= base_digits) {
      int x = 0;
      for (int j = max(pos, i - base_digits + 1); j <= i; j++)
    x = x * 10 + s[j] - '0';
      a.push_back(x);
  }
  trim();
    }

    friend istream& operator>>(istream &stream, bigint &v) {
  string s;
  stream >> s;
  v.read(s);
  return stream;
    }

    friend ostream& operator<<(ostream &stream, const bigint &v) {
  if (v.sign == -1)
      stream << '-';
  stream << (v.a.empty() ? 0 : v.a.back());
  for (int i = (int) v.a.size() - 2; i >= 0; --i)
      stream << setw(base_digits) << setfill('0') << v.a[i];
  return stream;
    }

    static vector<int> convert_base(const vector<int> &a, int old_digits, int new_digits) {
  vector<long long> p(max(old_digits, new_digits) + 1);
  p[0] = 1;
  for (int i = 1; i < (int) p.size(); i++)
      p[i] = p[i - 1] * 10;
  vector<int> res;
  long long cur = 0;
  int cur_digits = 0;
  for (int i = 0; i < (int) a.size(); i++) {
      cur += a[i] * p[cur_digits];
      cur_digits += old_digits;
      while (cur_digits >= new_digits) {
    res.push_back(int(cur % p[new_digits]));
    cur /= p[new_digits];
    cur_digits -= new_digits;
      }
  }
  res.push_back((int) cur);
  while (!res.empty() && !res.back())
      res.pop_back();
  return res;
    }

    typedef vector<long long> vll;

    static vll karatsubaMultiply(const vll &a, const vll &b) {
  int n = a.size();
  vll res(n + n);
  if (n <= 32) {
      for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
        res[i + j] += a[i] * b[j];
      return res;
  }

  int k = n >> 1;
  vll a1(a.begin(), a.begin() + k);
  vll a2(a.begin() + k, a.end());
  vll b1(b.begin(), b.begin() + k);
  vll b2(b.begin() + k, b.end());

  vll a1b1 = karatsubaMultiply(a1, b1);
  vll a2b2 = karatsubaMultiply(a2, b2);

  for (int i = 0; i < k; i++)
      a2[i] += a1[i];
  for (int i = 0; i < k; i++)
      b2[i] += b1[i];

  vll r = karatsubaMultiply(a2, b2);
  for (int i = 0; i < (int) a1b1.size(); i++)
      r[i] -= a1b1[i];
  for (int i = 0; i < (int) a2b2.size(); i++)
      r[i] -= a2b2[i];

  for (int i = 0; i < (int) r.size(); i++)
      res[i + k] += r[i];
  for (int i = 0; i < (int) a1b1.size(); i++)
      res[i] += a1b1[i];
  for (int i = 0; i < (int) a2b2.size(); i++)
      res[i + n] += a2b2[i];
  return res;
    }

    bigint operator*(const bigint &v) const {
  vector<int> a6 = convert_base(this->a, base_digits, 6);
  vector<int> b6 = convert_base(v.a, base_digits, 6);
  vll a(a6.begin(), a6.end());
  vll b(b6.begin(), b6.end());
  while (a.size() < b.size())
      a.push_back(0);
  while (b.size() < a.size())
      b.push_back(0);
  while (a.size() & (a.size() - 1))
      a.push_back(0), b.push_back(0);
  vll c = karatsubaMultiply(a, b);
  bigint res;
  res.sign = sign * v.sign;
  for (int i = 0, carry = 0; i < (int) c.size(); i++) {
      long long cur = c[i] + carry;
      res.a.push_back((int) (cur % 1000000));
      carry = (int) (cur / 1000000);
  }
  res.a = convert_base(res.a, 6, base_digits);
  res.trim();
  return res;
    }
};
/*
  #######################   THE   BIG   INT   ##########################
  ######################################################################
*/
ll f(ll x) {
  ll ans=0;
  while(x>0) {
    ans+=x%10;
    x/=10;
  }
  return ans;
}
void check(ll l, ll r, ll a) {
  ll ans=0;
  for (ll x=l;x<=r;x++) {
    ans=(ans+f(x))%a;
  }
  assert(ans==0);
}
void solve(ll _a) {
  bigint a(_a);
  ll n=50;
  bigint rhs(45*n);
  for (ll i=0;i<n-1;i++) rhs=rhs*10;
  bigint k=(rhs+a-1)/a;
  bigint x=k*a-rhs;
  bigint tn=1;
  for (ll i=0;i<n;i++) tn*=10;
  bigint r=tn+x-1;
  bigint l=x;
  cout<<l<<" "<<r<<endl;
  //cout<<"k:"<<k<<" k*a:"<<k*a<< " rhs:"<<rhs<<endl;
  //check(l.longValue(), r.longValue(), _a);
}
int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0);
  //for (ll a=1;a<=1000;a++) solve(a);
  //return 0;
  ll _a; cin>>_a;
  solve(_a);
}


#include<bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
ll read(){
	ll x=0,pos=1;char ch=getchar();
	for(;!isdigit(ch);ch=getchar()) if(ch=='-') pos=0;
	for(;isdigit(ch);ch=getchar()) x=(x<<1)+(x<<3)+ch-'0';
	return pos?x:-x;
}
ll mx;
int main(){
 	ll a=read();
 	mx=(1000000000000000000ll)%a*9ll%a*9ll%a;
 	ll ori= a-mx;
 	printf("%lld %lld",ori,ori+1000000000000000000ll-1ll);
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
using namespace std;
int read(){
	int x=0,pos=1;char ch=getchar();
	for(;!isdigit(ch);ch=getchar()) if(ch=='-') pos=0;
	for(;isdigit(ch);ch=getchar()) x=(x<<1)+(x<<3)+ch-'0';
	return pos?x:-x;
}
ll mx;
int main(){
 	ll a=read();
 	mx=(1000000000000000000ll)%a*9ll%a*9ll%a;
 	ll ori= a-mx;
 	printf("%lld %lld",ori,ori+1000000000000000000ll-1ll);
	return 0;
}


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

typedef long long ll;
#define CERR(x) cerr << #x << " = " << x << endl
ll pow10[20];

ll solve(ll n) {
  int len = 0, d[20];
  ll nn = n;
  while (nn) {
    d[len++] = nn % 10;
    nn /= 10;
  }
  ll ans = 0;
  for (int i = 0; i < len; ++i) {
    for (int dd = 1; dd <= 9; ++dd) {
      ll cnt = n / pow10[i + 1] * pow10[i];
      if (d[i] > dd) {
        cnt += pow10[i];
      } else if (d[i] == dd) {
        cnt += n % pow10[i] + 1;
      }
      ans += cnt * dd;
    }
  }
  return ans;
}

ll f(ll n) {
  ll sum = 0;
  while (n) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main(void) {
  pow10[0] = 1;
  for (int i = 1; i <= 18; ++i) {
    pow10[i] = pow10[i - 1] * 10;
  }
  ll a;
  scanf("%lld", &a);
  ll low = 1, high = 20000000000000000;
  while (high - low > 1) {
    ll mid = low + (high - low) / 2;
    if (solve(mid) >= a) {
      high = mid;
    } else {
      low = mid;
    }
  }
  ll sum = solve(low);
  high = low; low = 1;
  while (true) {
    while (sum < a) {
      ++high;
      sum += f(high);
    }
    if (sum == a) {
      printf("%lld %lld\n", low, high);
      break;
    }
    sum -= f(low);
    ++low;
  }
  return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

typedef long long ll;

ll pow10[20];

ll solve(ll n) {
  int len = 0, d[20];
  ll nn = n;
  while (nn) {
    d[len++] = nn % 10;
    nn /= 10;
  }
  ll ans = 0;
  for (int i = 0; i < len; ++i) {
    for (int dd = 1; dd <= 9; ++dd) {
      ll cnt = n / pow10[i + 1];
      if (d[i] >= dd) {
        ++cnt;
      }
      ans += cnt * dd;
    }
  }
  return ans;
}

ll f(ll n) {
  ll sum = 0;
  while (n) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

int main(void) {
  pow10[0] = 1;
  for (int i = 1; i <= 18; ++i) {
    pow10[i] = pow10[i - 1] * 10;
  }
  ll a;
  scanf("%lld", &a);
  ll low = 1, high = 210000000000000000;
  while (high - low > 1) {
    ll mid = (low + high) >> 1;
    if (solve(mid) >= a) {
      high = mid;
    } else {
      low = mid;
    }
  }
  ll sum = solve(low);
  high = low; low = 1;
  while (true) {
    while (sum < a) {
      ++high;
      sum += f(high);
    }
    if (sum == a) {
      printf("%lld %lld\n", low, high);
      break;
    }
    sum -= f(low);
    ++low;
  }
  return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;
int up[20][2];
pll dp[20][2][2];
ll MAX = 1e18+1;
pll f(int i,bool b,bool b1){
    if(i == 20){
        return mp(1,0);
    }
    if(dp[i][b][b1].fr != -1)return dp[i][b][b1];
    int mn = up[i][0];
    if(b)mn = 0;
    int mx = up[i][1];
    if(b1)mx = 9;
    ll r = 0;
    ll r1 = 0;
    for(int j=mn ; j<=mx ; j++){
        r += min(min(MAX,f(i+1,b||(j > up[i][0]),b1||(j < up[i][1])).fr*j)+f(i+1,b||(j > up[i][0]),b1||(j < up[i][1])).sc,MAX);
        r = min(r,MAX);
        r1 += f(i+1,b||(j > up[i][0]),b1||(j < up[i][1])).fr;
    }
    return dp[i][b][b1] = mp(r1,r);
}

void f1(int i,bool b,bool b1){
    if(i == 20){
        return ;
    }
    if(dp[i][b][b1].fr == -1)return;
    int mn = up[i][0];
    if(b)mn = 0;
    int mx = up[i][1];
    if(b1)mx = 9;
    ll r = 0;
    ll r1 = 0;
    for(int j=mn ; j<=mx ; j++){
       f1(i+1,b||(j > up[i][0]),b1||(j < up[i][1]));
    }
    dp[i][b][b1] = mp(-1,-1);
}

void con(ll x,int i){
    int j = 19;
    while(j>=0){
        up[j--][i] = x%10;
        x/=10;
    }
}

int main() {
    ll n;
    cin>>n;
    for(int i=0 ; i<20 ;i ++){
        dp[i][0][0] = mp(-1,-1);
        dp[i][0][1] = mp(-1,-1);
        dp[i][1][1] = mp(-1,-1);
        dp[i][1][0] = mp(-1,-1);
    }
    for(int j=1 ; j<=1e6 ; j++){
        //cout<<j<<endl;
        con(j,0);
        ll l= j,h = 1e17;
        ll r = -1;
        while(l<=h){
            ll m = (l+h)/2;

            con(m,1);
            ll res = f(0,0,0).sc;
            f1(0,0,0);
            if(res < n)l = m+1;
            else if(res > n)h = m-1;
            else{
                r =m;
                break;
            }
        }
        if(r != -1){
            cout<<j<<" "<<r<<endl;
            return 0;
        }
    }

    return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;
int up[20][2];
ll dp[20][2][2];
ll MAX = 1e18+1;
ll f(int i,bool b,bool b1){
    if(i == 20){
        return 0;
    }
    if(dp[i][b][b1] != -1)return dp[i][b][b1];
    int mn = up[i][0];
    if(b)mn = 0;
    int mx = up[i][1];
    if(b1)mx = 9;
    ll r = 0;
    for(int j=mn ; j<=mx ; j++){
        r += min(MAX,f(i+1,b|(j > up[i][0]),b1|(j < up[i][1]))+j);
        r = min(r,MAX);
    }
    return dp[i][b][b1] = r;
}

void con(ll x,int i){
    int j = 19;
    while(j>=0){
        up[j--][i] = x%10;
        x/=10;
    }
}

int main() {
    ll n;
    cin>>n;
    for(int j=1 ; j<=1e6 ; j++){
        //cout<<j<<endl;
        con(j,0);
        ll l= j,h = 1e17;
        ll r = -1;
        while(l<=h){
            ll m = (l+h)/2;
            memset(dp,-1,sizeof dp);
            con(m,1);
            ll res = f(0,0,0);
            if(res < n)l = m+1;
            else if(res > n)h = m-1;
            else{
                r =m;
                break;
            }
        }
        if(r != -1){
            cout<<j<<" "<<r<<endl;
            return 0;
        }
    }

    return 0;
}


#include <bits/stdc++.h>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fr first
#define sc second
#define ll  long long
#define mp make_pair
#define mod 1000000007

using namespace std;
int up[20][2];
pll dp[20][2][2];
ll MAX = 1e18+1;
pll f(int i,bool b,bool b1){
    if(i == 20){
        return mp(1,0);
    }
    if(dp[i][b][b1].fr != -1)return dp[i][b][b1];
    int mn = up[i][0];
    if(b)mn = 0;
    int mx = up[i][1];
    if(b1)mx = 9;
    ll r = 0;
    ll r1 = 0;
    for(int j=mn ; j<=mx ; j++){
        r += min(min(MAX,f(i+1,b||(j > up[i][0]),b1||(j < up[i][1])).fr*j)+f(i+1,b||(j > up[i][0]),b1||(j < up[i][1])).sc,MAX);
        r = min(r,MAX);
        r1 += f(i+1,b||(j > up[i][0]),b1||(j < up[i][1])).fr;
    }
    return dp[i][b][b1] = mp(r1,r);
}

void f1(int i,bool b,bool b1){
    if(i == 20){
        return ;
    }
    if(dp[i][b][b1].fr == -1)return;
    int mn = up[i][0];
    if(b)mn = 0;
    int mx = up[i][1];
    if(b1)mx = 9;
    ll r = 0;
    ll r1 = 0;
    for(int j=mn ; j<=mx ; j++){
       f1(i+1,b||(j > up[i][0]),b1||(j < up[i][1]));
    }
    dp[i][b][b1] = mp(-1,-1);
}

void con(ll x,int i){
    int j = 19;
    while(j>=0){
        up[j--][i] = x%10;
        x/=10;
    }
}

int main() {
    ll n;
    cin>>n;
    for(int i=0 ; i<20 ;i ++){
        dp[i][0][0] = mp(-1,-1);
        dp[i][0][1] = mp(-1,-1);
        dp[i][1][1] = mp(-1,-1);
        dp[i][1][0] = mp(-1,-1);
    }
    for(int j=1 ; j<=1e6 ; j++){
        //cout<<j<<endl;
        con(j,0);
        ll l= j,h = 1e16;
        ll r = -1;
        while(l<=h){
            ll m = (l+h)/2;

            con(m,1);
            ll res = f(0,0,0).sc;
            f1(0,0,0);
            if(res < n)l = m+1;
            else if(res > n)h = m-1;
            else{
                r =m;
                break;
            }
        }
        if(r != -1){
            cout<<j<<" "<<r<<endl;
            return 0;
        }
    }

    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fl first
#define fr second
using namespace std;

typedef long long LL;
typedef pair<int, int> pii;

const int N = 200000 + 5;struct BigInteger
{
    static const int BASE = 100000000; //和WIDTH保持一致
    static const int WIDTH = 8;        //八位一存储,如修改记得修改输出中的%08d
    bool sign;                         //符号, 0表示负数
    size_t length;                     //位数
    vector<int> num;                   //反序存
    //构造函数
    BigInteger(long long x = 0) { *this = x; }
    BigInteger(const string &x) { *this = x; }
    BigInteger(const BigInteger &x) { *this = x; }
    //剪掉前导0，并且求一下数的位数
    void cutLeadingZero()
    {
        while (num.back() == 0 && num.size() != 1)
        {
            num.pop_back();
        }
        int tmp = num.back();
        if (tmp == 0)
        {
            length = 1;
        }
        else
        {
            length = (num.size() - 1) * WIDTH;
            while (tmp > 0)
            {
                length++;
                tmp /= 10;
            }
        }
    }
    //赋值运算符
    BigInteger &operator=(long long x)
    {
        num.clear();
        if (x >= 0)
        {
            sign = true;
        }
        else
        {
            sign = false;
            x = -x;
        }
        do
        {
            num.push_back(x % BASE);
            x /= BASE;
        } while (x > 0);
        cutLeadingZero();
        return *this;
    }
    BigInteger &operator=(const string &str)
    {
        num.clear();
        sign = (str[0] != '-'); //设置符号
        int x, len = (str.size() - 1 - (!sign)) / WIDTH + 1;
        for (int i = 0; i < len; i++)
        {
            int End = str.size() - i * WIDTH;
            int start = max((int)(!sign), End - WIDTH); //防止越界
            sscanf(str.substr(start, End - start).c_str(), "%d", &x);
            num.push_back(x);
        }
        cutLeadingZero();
        return *this;
    }
    BigInteger &operator=(const BigInteger &tmp)
    {
        num = tmp.num;
        sign = tmp.sign;
        length = tmp.length;
        return *this;
    }
    //绝对值
    BigInteger abs() const
    {
        BigInteger ans(*this);
        ans.sign = true;
        return ans;
    }
    //正号
    const BigInteger &operator+() const { return *this; }
    //负号
    BigInteger operator-() const
    {
        BigInteger ans(*this);
        if (ans != 0)
            ans.sign = !ans.sign;
        return ans;
    }
    // + 运算符
    BigInteger operator+(const BigInteger &b) const
    {
        if (!b.sign)
        {
            return *this - (-b);
        }
        if (!sign)
        {
            return b - (-*this);
        }
        BigInteger ans;
        ans.num.clear();
        for (int i = 0, g = 0;; i++)
        {
            if (g == 0 && i >= num.size() && i >= b.num.size())
                break;
            int x = g;
            if (i < num.size())
                x += num[i];
            if (i < b.num.size())
                x += b.num[i];
            ans.num.push_back(x % BASE);
            g = x / BASE;
        }
        ans.cutLeadingZero();
        return ans;
    }
    // - 运算符
    BigInteger operator-(const BigInteger &b) const
    {
        if (!b.sign)
        {
            return *this + (-b);
        }
        if (!sign)
        {
            return -((-*this) + b);
        }
        if (*this < b)
        {
            return -(b - *this);
        }
        BigInteger ans;
        ans.num.clear();
        for (int i = 0, g = 0;; i++)
        {
            if (g == 0 && i >= num.size() && i >= b.num.size())
                break;
            int x = g;
            g = 0;
            if (i < num.size())
                x += num[i];
            if (i < b.num.size())
                x -= b.num[i];
            if (x < 0)
            {
                x += BASE;
                g = -1;
            }
            ans.num.push_back(x);
        }
        ans.cutLeadingZero();
        return ans;
    }
    // * 运算符
    BigInteger operator*(const BigInteger &b) const
    {
        int lena = num.size(), lenb = b.num.size();
        BigInteger ans;
        for (int i = 0; i < lena + lenb; i++)
            ans.num.push_back(0);
        for (int i = 0, g = 0; i < lena; i++)
        {
            g = 0;
            for (int j = 0; j < lenb; j++)
            {
                long long x = ans.num[i + j];
                x += (long long)num[i] * (long long)b.num[j];
                ans.num[i + j] = x % BASE;
                g = x / BASE;
                ans.num[i + j + 1] += g;
            }
        }
        ans.cutLeadingZero();
        ans.sign = (ans.length == 1 && ans.num[0] == 0) || (sign == b.sign);
        return ans;
    }
    //*10^n 大数除大数中用到
    BigInteger e(size_t n) const
    {
        int tmp = n % WIDTH;
        BigInteger ans;
        ans.length = n + 1;
        n /= WIDTH;
        while (ans.num.size() <= n)
            ans.num.push_back(0);
        ans.num[n] = 1;
        while (tmp--)
            ans.num[n] *= 10;
        return ans * (*this);
    }
    // /运算符 (大数除大数)
    BigInteger operator/(const BigInteger &b) const
    {
        BigInteger aa((*this).abs());
        BigInteger bb(b.abs());
        if (aa < bb)
            return 0;
        char *str = new char[aa.length + 1];
        memset(str, 0, sizeof(char) * (aa.length + 1));
        BigInteger tmp;
        int lena = aa.length, lenb = bb.length;
        for (int i = 0; i <= lena - lenb; i++)
        {
            tmp = bb.e(lena - lenb - i);
            while (aa >= tmp)
            {
                str[i]++;
                aa = aa - tmp;
            }
            str[i] += '0';
        }
        BigInteger ans(str);
        delete[] str;
        ans.sign = (ans == 0 || sign == b.sign);
        return ans;
    }
    // %运算符
    BigInteger operator%(const BigInteger &b) const
    {
        return *this - *this / b * b;
    }
    // ++ 运算符
    BigInteger &operator++()
    {
        *this = *this + 1;
        return *this;
    }
    // -- 运算符
    BigInteger &operator--()
    {
        *this = *this - 1;
        return *this;
    }
    // += 运算符
    BigInteger &operator+=(const BigInteger &b)
    {
        *this = *this + b;
        return *this;
    }
    // -= 运算符
    BigInteger &operator-=(const BigInteger &b)
    {
        *this = *this - b;
        return *this;
    }
    // *=运算符
    BigInteger &operator*=(const BigInteger &b)
    {
        *this = *this * b;
        return *this;
    }
    // /= 运算符
    BigInteger &operator/=(const BigInteger &b)
    {
        *this = *this / b;
        return *this;
    }
    // %=运算符
    BigInteger &operator%=(const BigInteger &b)
    {
        *this = *this % b;
        return *this;
    }
    // < 运算符
    bool operator<(const BigInteger &b) const
    {
        if (sign != b.sign) //正负，负正
        {
            return !sign;
        }
        else if (!sign && !b.sign) //负负
        {
            return -b < -*this;
        }
        //正正
        if (num.size() != b.num.size())
            return num.size() < b.num.size();
        for (int i = num.size() - 1; i >= 0; i--)
            if (num[i] != b.num[i])
                return num[i] < b.num[i];
        return false;
    }
    bool operator>(const BigInteger &b) const { return b < *this; }                     // >  运算符
    bool operator<=(const BigInteger &b) const { return !(b < *this); }                 // <= 运算符
    bool operator>=(const BigInteger &b) const { return !(*this < b); }                 // >= 运算符
    bool operator!=(const BigInteger &b) const { return b < *this || *this < b; }       // != 运算符
    bool operator==(const BigInteger &b) const { return !(b < *this) && !(*this < b); } //==运算符
    // 逻辑运算符
    bool operator||(const BigInteger &b) const { return *this != 0 || b != 0; } // || 运算符
    bool operator&&(const BigInteger &b) const { return *this != 0 && b != 0; } // && 运算符
    bool operator!() { return (bool)(*this == 0); }                             // ！ 运算符

    //重载<<使得可以直接输出大数
    friend ostream &operator<<(ostream &out, const BigInteger &x)
    {
        if (!x.sign)
            out << '-';
        out << x.num.back();
        for (int i = x.num.size() - 2; i >= 0; i--)
        {
            char buf[10];
            //如WIDTH和BASR有变化,此处要修改为%0(WIDTH)d
            sprintf(buf, "%08d", x.num[i]);
            for (int j = 0; j < strlen(buf); j++)
                out << buf[j];
        }
        return out;
    }
    //重载>>使得可以直接输入大数
    friend istream &operator>>(istream &in, BigInteger &x)
    {
        string str;
        in >> str;
        size_t len = str.size();
        int start = 0;
        if (str[0] == '-')
            start = 1;
        if (str[start] == '\0')
            return in;
        for (int i = start; i < len; i++)
        {
            if (str[i] < '0' || str[i] > '9')
                return in;
        }
        x.sign = !start;
        x = str.c_str();
        return in;
    }
};

typedef BigInteger Int;

int main()
{
    Int a;
    cin >> a;
    Int l = 1, r = 1e18;
    r *= 10;
    Int s = 0, now = 1e18;
    s += now * 10 * 9 / 2 * 19;
    s += 1;
    Int x = s % a;
    l += a - x, r += a - x;
    cout << l << " " << r << endl;
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fl first
#define fr second
using namespace std;

typedef long long LL;
typedef pair<int, int> pii;

const int N = 200000 + 5;struct BigInteger
{
    static const int BASE = 100000000; //和WIDTH保持一致
    static const int WIDTH = 8;        //八位一存储,如修改记得修改输出中的%08d
    bool sign;                         //符号, 0表示负数
    size_t length;                     //位数
    vector<int> num;                   //反序存
    //构造函数
    BigInteger(long long x = 0) { *this = x; }
    BigInteger(const string &x) { *this = x; }
    BigInteger(const BigInteger &x) { *this = x; }
    //剪掉前导0，并且求一下数的位数
    void cutLeadingZero()
    {
        while (num.back() == 0 && num.size() != 1)
        {
            num.pop_back();
        }
        int tmp = num.back();
        if (tmp == 0)
        {
            length = 1;
        }
        else
        {
            length = (num.size() - 1) * WIDTH;
            while (tmp > 0)
            {
                length++;
                tmp /= 10;
            }
        }
    }
    //赋值运算符
    BigInteger &operator=(long long x)
    {
        num.clear();
        if (x >= 0)
        {
            sign = true;
        }
        else
        {
            sign = false;
            x = -x;
        }
        do
        {
            num.push_back(x % BASE);
            x /= BASE;
        } while (x > 0);
        cutLeadingZero();
        return *this;
    }
    BigInteger &operator=(const string &str)
    {
        num.clear();
        sign = (str[0] != '-'); //设置符号
        int x, len = (str.size() - 1 - (!sign)) / WIDTH + 1;
        for (int i = 0; i < len; i++)
        {
            int End = str.size() - i * WIDTH;
            int start = max((int)(!sign), End - WIDTH); //防止越界
            sscanf(str.substr(start, End - start).c_str(), "%d", &x);
            num.push_back(x);
        }
        cutLeadingZero();
        return *this;
    }
    BigInteger &operator=(const BigInteger &tmp)
    {
        num = tmp.num;
        sign = tmp.sign;
        length = tmp.length;
        return *this;
    }
    //绝对值
    BigInteger abs() const
    {
        BigInteger ans(*this);
        ans.sign = true;
        return ans;
    }
    //正号
    const BigInteger &operator+() const { return *this; }
    //负号
    BigInteger operator-() const
    {
        BigInteger ans(*this);
        if (ans != 0)
            ans.sign = !ans.sign;
        return ans;
    }
    // + 运算符
    BigInteger operator+(const BigInteger &b) const
    {
        if (!b.sign)
        {
            return *this - (-b);
        }
        if (!sign)
        {
            return b - (-*this);
        }
        BigInteger ans;
        ans.num.clear();
        for (int i = 0, g = 0;; i++)
        {
            if (g == 0 && i >= num.size() && i >= b.num.size())
                break;
            int x = g;
            if (i < num.size())
                x += num[i];
            if (i < b.num.size())
                x += b.num[i];
            ans.num.push_back(x % BASE);
            g = x / BASE;
        }
        ans.cutLeadingZero();
        return ans;
    }
    // - 运算符
    BigInteger operator-(const BigInteger &b) const
    {
        if (!b.sign)
        {
            return *this + (-b);
        }
        if (!sign)
        {
            return -((-*this) + b);
        }
        if (*this < b)
        {
            return -(b - *this);
        }
        BigInteger ans;
        ans.num.clear();
        for (int i = 0, g = 0;; i++)
        {
            if (g == 0 && i >= num.size() && i >= b.num.size())
                break;
            int x = g;
            g = 0;
            if (i < num.size())
                x += num[i];
            if (i < b.num.size())
                x -= b.num[i];
            if (x < 0)
            {
                x += BASE;
                g = -1;
            }
            ans.num.push_back(x);
        }
        ans.cutLeadingZero();
        return ans;
    }
    // * 运算符
    BigInteger operator*(const BigInteger &b) const
    {
        int lena = num.size(), lenb = b.num.size();
        BigInteger ans;
        for (int i = 0; i < lena + lenb; i++)
            ans.num.push_back(0);
        for (int i = 0, g = 0; i < lena; i++)
        {
            g = 0;
            for (int j = 0; j < lenb; j++)
            {
                long long x = ans.num[i + j];
                x += (long long)num[i] * (long long)b.num[j];
                ans.num[i + j] = x % BASE;
                g = x / BASE;
                ans.num[i + j + 1] += g;
            }
        }
        ans.cutLeadingZero();
        ans.sign = (ans.length == 1 && ans.num[0] == 0) || (sign == b.sign);
        return ans;
    }
    //*10^n 大数除大数中用到
    BigInteger e(size_t n) const
    {
        int tmp = n % WIDTH;
        BigInteger ans;
        ans.length = n + 1;
        n /= WIDTH;
        while (ans.num.size() <= n)
            ans.num.push_back(0);
        ans.num[n] = 1;
        while (tmp--)
            ans.num[n] *= 10;
        return ans * (*this);
    }
    // /运算符 (大数除大数)
    BigInteger operator/(const BigInteger &b) const
    {
        BigInteger aa((*this).abs());
        BigInteger bb(b.abs());
        if (aa < bb)
            return 0;
        char *str = new char[aa.length + 1];
        memset(str, 0, sizeof(char) * (aa.length + 1));
        BigInteger tmp;
        int lena = aa.length, lenb = bb.length;
        for (int i = 0; i <= lena - lenb; i++)
        {
            tmp = bb.e(lena - lenb - i);
            while (aa >= tmp)
            {
                str[i]++;
                aa = aa - tmp;
            }
            str[i] += '0';
        }
        BigInteger ans(str);
        delete[] str;
        ans.sign = (ans == 0 || sign == b.sign);
        return ans;
    }
    // %运算符
    BigInteger operator%(const BigInteger &b) const
    {
        return *this - *this / b * b;
    }
    // ++ 运算符
    BigInteger &operator++()
    {
        *this = *this + 1;
        return *this;
    }
    // -- 运算符
    BigInteger &operator--()
    {
        *this = *this - 1;
        return *this;
    }
    // += 运算符
    BigInteger &operator+=(const BigInteger &b)
    {
        *this = *this + b;
        return *this;
    }
    // -= 运算符
    BigInteger &operator-=(const BigInteger &b)
    {
        *this = *this - b;
        return *this;
    }
    // *=运算符
    BigInteger &operator*=(const BigInteger &b)
    {
        *this = *this * b;
        return *this;
    }
    // /= 运算符
    BigInteger &operator/=(const BigInteger &b)
    {
        *this = *this / b;
        return *this;
    }
    // %=运算符
    BigInteger &operator%=(const BigInteger &b)
    {
        *this = *this % b;
        return *this;
    }
    // < 运算符
    bool operator<(const BigInteger &b) const
    {
        if (sign != b.sign) //正负，负正
        {
            return !sign;
        }
        else if (!sign && !b.sign) //负负
        {
            return -b < -*this;
        }
        //正正
        if (num.size() != b.num.size())
            return num.size() < b.num.size();
        for (int i = num.size() - 1; i >= 0; i--)
            if (num[i] != b.num[i])
                return num[i] < b.num[i];
        return false;
    }
    bool operator>(const BigInteger &b) const { return b < *this; }                     // >  运算符
    bool operator<=(const BigInteger &b) const { return !(b < *this); }                 // <= 运算符
    bool operator>=(const BigInteger &b) const { return !(*this < b); }                 // >= 运算符
    bool operator!=(const BigInteger &b) const { return b < *this || *this < b; }       // != 运算符
    bool operator==(const BigInteger &b) const { return !(b < *this) && !(*this < b); } //==运算符
    // 逻辑运算符
    bool operator||(const BigInteger &b) const { return *this != 0 || b != 0; } // || 运算符
    bool operator&&(const BigInteger &b) const { return *this != 0 && b != 0; } // && 运算符
    bool operator!() { return (bool)(*this == 0); }                             // ！ 运算符

    //重载<<使得可以直接输出大数
    friend ostream &operator<<(ostream &out, const BigInteger &x)
    {
        if (!x.sign)
            out << '-';
        out << x.num.back();
        for (int i = x.num.size() - 2; i >= 0; i--)
        {
            char buf[10];
            //如WIDTH和BASR有变化,此处要修改为%0(WIDTH)d
            sprintf(buf, "%08d", x.num[i]);
            for (int j = 0; j < strlen(buf); j++)
                out << buf[j];
        }
        return out;
    }
    //重载>>使得可以直接输入大数
    friend istream &operator>>(istream &in, BigInteger &x)
    {
        string str;
        in >> str;
        size_t len = str.size();
        int start = 0;
        if (str[0] == '-')
            start = 1;
        if (str[start] == '\0')
            return in;
        for (int i = start; i < len; i++)
        {
            if (str[i] < '0' || str[i] > '9')
                return in;
        }
        x.sign = !start;
        x = str.c_str();
        return in;
    }
};

typedef BigInteger Int;

int main()
{
    Int a;
    cin >> a;
    Int l = 1, r = 1e18;
    r *= 10;
    Int s = 0, now = 1e17;
    s += now * 10 * 9 / 2 * 18;
    s += 1;
    Int x = s % a;
    l += a - x, r += a - x;
    cout << l << " " << r << endl;
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fl first
#define fr second
using namespace std;

typedef long long LL;
typedef pair<int, int> pii;

const int N = 200000 + 5;struct BigInteger
{
    static const int BASE = 100000000; //和WIDTH保持一致
    static const int WIDTH = 8;        //八位一存储,如修改记得修改输出中的%08d
    bool sign;                         //符号, 0表示负数
    size_t length;                     //位数
    vector<int> num;                   //反序存
    //构造函数
    BigInteger(long long x = 0) { *this = x; }
    BigInteger(const string &x) { *this = x; }
    BigInteger(const BigInteger &x) { *this = x; }
    //剪掉前导0，并且求一下数的位数
    void cutLeadingZero()
    {
        while (num.back() == 0 && num.size() != 1)
        {
            num.pop_back();
        }
        int tmp = num.back();
        if (tmp == 0)
        {
            length = 1;
        }
        else
        {
            length = (num.size() - 1) * WIDTH;
            while (tmp > 0)
            {
                length++;
                tmp /= 10;
            }
        }
    }
    //赋值运算符
    BigInteger &operator=(long long x)
    {
        num.clear();
        if (x >= 0)
        {
            sign = true;
        }
        else
        {
            sign = false;
            x = -x;
        }
        do
        {
            num.push_back(x % BASE);
            x /= BASE;
        } while (x > 0);
        cutLeadingZero();
        return *this;
    }
    BigInteger &operator=(const string &str)
    {
        num.clear();
        sign = (str[0] != '-'); //设置符号
        int x, len = (str.size() - 1 - (!sign)) / WIDTH + 1;
        for (int i = 0; i < len; i++)
        {
            int End = str.size() - i * WIDTH;
            int start = max((int)(!sign), End - WIDTH); //防止越界
            sscanf(str.substr(start, End - start).c_str(), "%d", &x);
            num.push_back(x);
        }
        cutLeadingZero();
        return *this;
    }
    BigInteger &operator=(const BigInteger &tmp)
    {
        num = tmp.num;
        sign = tmp.sign;
        length = tmp.length;
        return *this;
    }
    //绝对值
    BigInteger abs() const
    {
        BigInteger ans(*this);
        ans.sign = true;
        return ans;
    }
    //正号
    const BigInteger &operator+() const { return *this; }
    //负号
    BigInteger operator-() const
    {
        BigInteger ans(*this);
        if (ans != 0)
            ans.sign = !ans.sign;
        return ans;
    }
    // + 运算符
    BigInteger operator+(const BigInteger &b) const
    {
        if (!b.sign)
        {
            return *this - (-b);
        }
        if (!sign)
        {
            return b - (-*this);
        }
        BigInteger ans;
        ans.num.clear();
        for (int i = 0, g = 0;; i++)
        {
            if (g == 0 && i >= num.size() && i >= b.num.size())
                break;
            int x = g;
            if (i < num.size())
                x += num[i];
            if (i < b.num.size())
                x += b.num[i];
            ans.num.push_back(x % BASE);
            g = x / BASE;
        }
        ans.cutLeadingZero();
        return ans;
    }
    // - 运算符
    BigInteger operator-(const BigInteger &b) const
    {
        if (!b.sign)
        {
            return *this + (-b);
        }
        if (!sign)
        {
            return -((-*this) + b);
        }
        if (*this < b)
        {
            return -(b - *this);
        }
        BigInteger ans;
        ans.num.clear();
        for (int i = 0, g = 0;; i++)
        {
            if (g == 0 && i >= num.size() && i >= b.num.size())
                break;
            int x = g;
            g = 0;
            if (i < num.size())
                x += num[i];
            if (i < b.num.size())
                x -= b.num[i];
            if (x < 0)
            {
                x += BASE;
                g = -1;
            }
            ans.num.push_back(x);
        }
        ans.cutLeadingZero();
        return ans;
    }
    // * 运算符
    BigInteger operator*(const BigInteger &b) const
    {
        int lena = num.size(), lenb = b.num.size();
        BigInteger ans;
        for (int i = 0; i < lena + lenb; i++)
            ans.num.push_back(0);
        for (int i = 0, g = 0; i < lena; i++)
        {
            g = 0;
            for (int j = 0; j < lenb; j++)
            {
                long long x = ans.num[i + j];
                x += (long long)num[i] * (long long)b.num[j];
                ans.num[i + j] = x % BASE;
                g = x / BASE;
                ans.num[i + j + 1] += g;
            }
        }
        ans.cutLeadingZero();
        ans.sign = (ans.length == 1 && ans.num[0] == 0) || (sign == b.sign);
        return ans;
    }
    //*10^n 大数除大数中用到
    BigInteger e(size_t n) const
    {
        int tmp = n % WIDTH;
        BigInteger ans;
        ans.length = n + 1;
        n /= WIDTH;
        while (ans.num.size() <= n)
            ans.num.push_back(0);
        ans.num[n] = 1;
        while (tmp--)
            ans.num[n] *= 10;
        return ans * (*this);
    }
    // /运算符 (大数除大数)
    BigInteger operator/(const BigInteger &b) const
    {
        BigInteger aa((*this).abs());
        BigInteger bb(b.abs());
        if (aa < bb)
            return 0;
        char *str = new char[aa.length + 1];
        memset(str, 0, sizeof(char) * (aa.length + 1));
        BigInteger tmp;
        int lena = aa.length, lenb = bb.length;
        for (int i = 0; i <= lena - lenb; i++)
        {
            tmp = bb.e(lena - lenb - i);
            while (aa >= tmp)
            {
                str[i]++;
                aa = aa - tmp;
            }
            str[i] += '0';
        }
        BigInteger ans(str);
        delete[] str;
        ans.sign = (ans == 0 || sign == b.sign);
        return ans;
    }
    // %运算符
    BigInteger operator%(const BigInteger &b) const
    {
        return *this - *this / b * b;
    }
    // ++ 运算符
    BigInteger &operator++()
    {
        *this = *this + 1;
        return *this;
    }
    // -- 运算符
    BigInteger &operator--()
    {
        *this = *this - 1;
        return *this;
    }
    // += 运算符
    BigInteger &operator+=(const BigInteger &b)
    {
        *this = *this + b;
        return *this;
    }
    // -= 运算符
    BigInteger &operator-=(const BigInteger &b)
    {
        *this = *this - b;
        return *this;
    }
    // *=运算符
    BigInteger &operator*=(const BigInteger &b)
    {
        *this = *this * b;
        return *this;
    }
    // /= 运算符
    BigInteger &operator/=(const BigInteger &b)
    {
        *this = *this / b;
        return *this;
    }
    // %=运算符
    BigInteger &operator%=(const BigInteger &b)
    {
        *this = *this % b;
        return *this;
    }
    // < 运算符
    bool operator<(const BigInteger &b) const
    {
        if (sign != b.sign) //正负，负正
        {
            return !sign;
        }
        else if (!sign && !b.sign) //负负
        {
            return -b < -*this;
        }
        //正正
        if (num.size() != b.num.size())
            return num.size() < b.num.size();
        for (int i = num.size() - 1; i >= 0; i--)
            if (num[i] != b.num[i])
                return num[i] < b.num[i];
        return false;
    }
    bool operator>(const BigInteger &b) const { return b < *this; }                     // >  运算符
    bool operator<=(const BigInteger &b) const { return !(b < *this); }                 // <= 运算符
    bool operator>=(const BigInteger &b) const { return !(*this < b); }                 // >= 运算符
    bool operator!=(const BigInteger &b) const { return b < *this || *this < b; }       // != 运算符
    bool operator==(const BigInteger &b) const { return !(b < *this) && !(*this < b); } //==运算符
    // 逻辑运算符
    bool operator||(const BigInteger &b) const { return *this != 0 || b != 0; } // || 运算符
    bool operator&&(const BigInteger &b) const { return *this != 0 && b != 0; } // && 运算符
    bool operator!() { return (bool)(*this == 0); }                             // ！ 运算符

    //重载<<使得可以直接输出大数
    friend ostream &operator<<(ostream &out, const BigInteger &x)
    {
        if (!x.sign)
            out << '-';
        out << x.num.back();
        for (int i = x.num.size() - 2; i >= 0; i--)
        {
            char buf[10];
            //如WIDTH和BASR有变化,此处要修改为%0(WIDTH)d
            sprintf(buf, "%08d", x.num[i]);
            for (int j = 0; j < strlen(buf); j++)
                out << buf[j];
        }
        return out;
    }
    //重载>>使得可以直接输入大数
    friend istream &operator>>(istream &in, BigInteger &x)
    {
        string str;
        in >> str;
        size_t len = str.size();
        int start = 0;
        if (str[0] == '-')
            start = 1;
        if (str[start] == '\0')
            return in;
        for (int i = start; i < len; i++)
        {
            if (str[i] < '0' || str[i] > '9')
                return in;
        }
        x.sign = !start;
        x = str.c_str();
        return in;
    }
};

typedef BigInteger Int;

int main()
{
    Int a;
    cin >> a;
    Int l = 1, r = 1e18;
    r *= 10;
    Int s = 0, now = 1e18;
    for (int i = 1; i <= 18; i++)
    {
        s += now * 10 * 9 / 2;
    }
    s += 1;
    Int x = s % a;
    l += a - x, r += a - x;
    cout << l << " " << r << endl;
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fl first
#define fr second
using namespace std;

typedef long long LL;
typedef pair<int, int> pii;

const int N = 200000 + 5;struct BigInteger
{
    static const int BASE = 100000000; //和WIDTH保持一致
    static const int WIDTH = 8;        //八位一存储,如修改记得修改输出中的%08d
    bool sign;                         //符号, 0表示负数
    size_t length;                     //位数
    vector<int> num;                   //反序存
    //构造函数
    BigInteger(long long x = 0) { *this = x; }
    BigInteger(const string &x) { *this = x; }
    BigInteger(const BigInteger &x) { *this = x; }
    //剪掉前导0，并且求一下数的位数
    void cutLeadingZero()
    {
        while (num.back() == 0 && num.size() != 1)
        {
            num.pop_back();
        }
        int tmp = num.back();
        if (tmp == 0)
        {
            length = 1;
        }
        else
        {
            length = (num.size() - 1) * WIDTH;
            while (tmp > 0)
            {
                length++;
                tmp /= 10;
            }
        }
    }
    //赋值运算符
    BigInteger &operator=(long long x)
    {
        num.clear();
        if (x >= 0)
        {
            sign = true;
        }
        else
        {
            sign = false;
            x = -x;
        }
        do
        {
            num.push_back(x % BASE);
            x /= BASE;
        } while (x > 0);
        cutLeadingZero();
        return *this;
    }
    BigInteger &operator=(const string &str)
    {
        num.clear();
        sign = (str[0] != '-'); //设置符号
        int x, len = (str.size() - 1 - (!sign)) / WIDTH + 1;
        for (int i = 0; i < len; i++)
        {
            int End = str.size() - i * WIDTH;
            int start = max((int)(!sign), End - WIDTH); //防止越界
            sscanf(str.substr(start, End - start).c_str(), "%d", &x);
            num.push_back(x);
        }
        cutLeadingZero();
        return *this;
    }
    BigInteger &operator=(const BigInteger &tmp)
    {
        num = tmp.num;
        sign = tmp.sign;
        length = tmp.length;
        return *this;
    }
    //绝对值
    BigInteger abs() const
    {
        BigInteger ans(*this);
        ans.sign = true;
        return ans;
    }
    //正号
    const BigInteger &operator+() const { return *this; }
    //负号
    BigInteger operator-() const
    {
        BigInteger ans(*this);
        if (ans != 0)
            ans.sign = !ans.sign;
        return ans;
    }
    // + 运算符
    BigInteger operator+(const BigInteger &b) const
    {
        if (!b.sign)
        {
            return *this - (-b);
        }
        if (!sign)
        {
            return b - (-*this);
        }
        BigInteger ans;
        ans.num.clear();
        for (int i = 0, g = 0;; i++)
        {
            if (g == 0 && i >= num.size() && i >= b.num.size())
                break;
            int x = g;
            if (i < num.size())
                x += num[i];
            if (i < b.num.size())
                x += b.num[i];
            ans.num.push_back(x % BASE);
            g = x / BASE;
        }
        ans.cutLeadingZero();
        return ans;
    }
    // - 运算符
    BigInteger operator-(const BigInteger &b) const
    {
        if (!b.sign)
        {
            return *this + (-b);
        }
        if (!sign)
        {
            return -((-*this) + b);
        }
        if (*this < b)
        {
            return -(b - *this);
        }
        BigInteger ans;
        ans.num.clear();
        for (int i = 0, g = 0;; i++)
        {
            if (g == 0 && i >= num.size() && i >= b.num.size())
                break;
            int x = g;
            g = 0;
            if (i < num.size())
                x += num[i];
            if (i < b.num.size())
                x -= b.num[i];
            if (x < 0)
            {
                x += BASE;
                g = -1;
            }
            ans.num.push_back(x);
        }
        ans.cutLeadingZero();
        return ans;
    }
    // * 运算符
    BigInteger operator*(const BigInteger &b) const
    {
        int lena = num.size(), lenb = b.num.size();
        BigInteger ans;
        for (int i = 0; i < lena + lenb; i++)
            ans.num.push_back(0);
        for (int i = 0, g = 0; i < lena; i++)
        {
            g = 0;
            for (int j = 0; j < lenb; j++)
            {
                long long x = ans.num[i + j];
                x += (long long)num[i] * (long long)b.num[j];
                ans.num[i + j] = x % BASE;
                g = x / BASE;
                ans.num[i + j + 1] += g;
            }
        }
        ans.cutLeadingZero();
        ans.sign = (ans.length == 1 && ans.num[0] == 0) || (sign == b.sign);
        return ans;
    }
    //*10^n 大数除大数中用到
    BigInteger e(size_t n) const
    {
        int tmp = n % WIDTH;
        BigInteger ans;
        ans.length = n + 1;
        n /= WIDTH;
        while (ans.num.size() <= n)
            ans.num.push_back(0);
        ans.num[n] = 1;
        while (tmp--)
            ans.num[n] *= 10;
        return ans * (*this);
    }
    // /运算符 (大数除大数)
    BigInteger operator/(const BigInteger &b) const
    {
        BigInteger aa((*this).abs());
        BigInteger bb(b.abs());
        if (aa < bb)
            return 0;
        char *str = new char[aa.length + 1];
        memset(str, 0, sizeof(char) * (aa.length + 1));
        BigInteger tmp;
        int lena = aa.length, lenb = bb.length;
        for (int i = 0; i <= lena - lenb; i++)
        {
            tmp = bb.e(lena - lenb - i);
            while (aa >= tmp)
            {
                str[i]++;
                aa = aa - tmp;
            }
            str[i] += '0';
        }
        BigInteger ans(str);
        delete[] str;
        ans.sign = (ans == 0 || sign == b.sign);
        return ans;
    }
    // %运算符
    BigInteger operator%(const BigInteger &b) const
    {
        return *this - *this / b * b;
    }
    // ++ 运算符
    BigInteger &operator++()
    {
        *this = *this + 1;
        return *this;
    }
    // -- 运算符
    BigInteger &operator--()
    {
        *this = *this - 1;
        return *this;
    }
    // += 运算符
    BigInteger &operator+=(const BigInteger &b)
    {
        *this = *this + b;
        return *this;
    }
    // -= 运算符
    BigInteger &operator-=(const BigInteger &b)
    {
        *this = *this - b;
        return *this;
    }
    // *=运算符
    BigInteger &operator*=(const BigInteger &b)
    {
        *this = *this * b;
        return *this;
    }
    // /= 运算符
    BigInteger &operator/=(const BigInteger &b)
    {
        *this = *this / b;
        return *this;
    }
    // %=运算符
    BigInteger &operator%=(const BigInteger &b)
    {
        *this = *this % b;
        return *this;
    }
    // < 运算符
    bool operator<(const BigInteger &b) const
    {
        if (sign != b.sign) //正负，负正
        {
            return !sign;
        }
        else if (!sign && !b.sign) //负负
        {
            return -b < -*this;
        }
        //正正
        if (num.size() != b.num.size())
            return num.size() < b.num.size();
        for (int i = num.size() - 1; i >= 0; i--)
            if (num[i] != b.num[i])
                return num[i] < b.num[i];
        return false;
    }
    bool operator>(const BigInteger &b) const { return b < *this; }                     // >  运算符
    bool operator<=(const BigInteger &b) const { return !(b < *this); }                 // <= 运算符
    bool operator>=(const BigInteger &b) const { return !(*this < b); }                 // >= 运算符
    bool operator!=(const BigInteger &b) const { return b < *this || *this < b; }       // != 运算符
    bool operator==(const BigInteger &b) const { return !(b < *this) && !(*this < b); } //==运算符
    // 逻辑运算符
    bool operator||(const BigInteger &b) const { return *this != 0 || b != 0; } // || 运算符
    bool operator&&(const BigInteger &b) const { return *this != 0 && b != 0; } // && 运算符
    bool operator!() { return (bool)(*this == 0); }                             // ！ 运算符

    //重载<<使得可以直接输出大数
    friend ostream &operator<<(ostream &out, const BigInteger &x)
    {
        if (!x.sign)
            out << '-';
        out << x.num.back();
        for (int i = x.num.size() - 2; i >= 0; i--)
        {
            char buf[10];
            //如WIDTH和BASR有变化,此处要修改为%0(WIDTH)d
            sprintf(buf, "%08d", x.num[i]);
            for (int j = 0; j < strlen(buf); j++)
                out << buf[j];
        }
        return out;
    }
    //重载>>使得可以直接输入大数
    friend istream &operator>>(istream &in, BigInteger &x)
    {
        string str;
        in >> str;
        size_t len = str.size();
        int start = 0;
        if (str[0] == '-')
            start = 1;
        if (str[start] == '\0')
            return in;
        for (int i = start; i < len; i++)
        {
            if (str[i] < '0' || str[i] > '9')
                return in;
        }
        x.sign = !start;
        x = str.c_str();
        return in;
    }
};

typedef BigInteger Int;

int main()
{
    Int a;
    cin >> a;
    Int l = 1, r = 1e18;
    r *= 10;
    Int s = 0, now = 1e18;
    s += now * 10 * 9 / 2 * 18;
    s += 1;
    Int x = s % a;
    l += a - x, r += a - x;
    cout << l << " " << r << endl;
    return 0;
}


#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define fl first
#define fr second
using namespace std;

typedef long long LL;
typedef __int128 BLL;
typedef pair<int, int> pii;

const int N = 200000 + 5;

void print(BLL x)
{
    if (x <= 0) return;
    print(x / 10);
    printf("%d", (int)(x % 10));
}

int main()
{
    LL a;
    cin >> a;
    BLL l = (BLL)1, r = (BLL)1e19;
    BLL s = 0, now = 1e18;
    for (int i = 1; i <= 18; i++)
    {
        s += now * 10 * 9 / 2;
    }
    LL x = s % a;
    l += a - x, r += a - x;
    print(l);
    puts("");
    print(r);
    return 0;
}