#include<bits/stdc++.h>
using namespace std;
int n,x,y,a[1001],b[1001];
long long s[1001][5001],m[5001],d[5001],t[5001];
void c_g(int a,int b)
{
for(int i=5000; i>=0; i--){
s[a][i]=s[a-1][i];
}
for(int i=5000; i>=0; i--){
s[a][i]*=b;
}
for(int i=5000; i>0; i--){
s[a][i-1]+=s[a][i]/10;
s[a][i]%=10;
}
return ;
}
void c_u(int a,int b)
{
for(int i=0; i<=5000; i++){
m[i]=s[a][i];
}
for(int i=0; i<=5000; i++){
t[i]=m[i]/b;
m[i+1]+=(m[i]%b)*10;
}
m[5000]=0;
return ;
}
void maxx()
{
for(int i=0; i<=5000; i++){
if(d[i]>t[i]){
return ;
}
if(d[i]<t[i]){
break;
}
}
for(int i=0; i<=5000; i++){
d[i]=t[i];
}
return ;
}
int main()
{
cin>>n>>x>>y;
for(int i=0; i<n; i++){
cin>>a[i]>>b[i];
}
for(int i=0; i<n; i++){
for(int j=1; j<n; j++){
if(a[j-1]*b[j-1]>a[j]*b[j]){
swap(a[j-1],a[j]);
swap(b[j-1],b[j]);
}
}
}
int l=5000;
while(x>0){
s[0][l]=x%10;
l--;
x/=10;
}
for(int i=1; i<n; i++){
c_g(i,a[i-1]);
}
for(int i=0; i<n; i++){
c_u(i,b[i]);
maxx();
}
int st=0;
while(d[st]==0){
st++;
}
for(; st<=5000; st++){
cout<<d[st];
}
return 0;
}