int a=int.Parse(Console.ReadLine());
List<int> list = new List<int>();
bool[] u=new bool[2000001];
for(int i=0; i < a; i++)
{
string[] b = Console.ReadLine().Split(' ');
double[]c=Array.ConvertAll(b, double.Parse);
for(int j=1; j <= c[1] ; j++)
{
int d = Convert.ToInt32(Math.Floor(c[0]*j));
u[d] = !u[d];
if (u[d])
{
list.Add(d);
}
else
{
list.Remove(d);
}
}
}
foreach(var i in list)
Console.WriteLine(i);