#include<iostream>
#include<math.h>
#include<iomanip>
using namespace std;
const int N = 2000010;
bool open[N];
int main() {
int n;
double a, t;
cin >> n;
while (n > 0) {
n--;
cin >> a >> t;
for (size_t i = 1; i <= N; i++) {
for (size_t j = 1; j <= t; j++) {
if (i == floor(a * j)) {
if (open[i]) {
open[i] = false;
}
else {
open[i] = true;
}
}
}
}
}
for (size_t i = 1; i <= N; i++) {
if (open[i]) {
printf("%d", i);
}
}
return 0;
}