#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <iterator>
#include <assert.h>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) sort(ALL(v)); v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}
typedef long long RInteger;
struct Rational{
	RInteger p,q;
	Rational(RInteger pp=1,RInteger qq=1):p(pp),q(qq){
		if(q==0)p=1;else if(p==0)q=1;
		else{
			if(q<0)q=-q,p=-p;
			RInteger g=__gcd(abs(p),q);
			p/=g;q/=g;
		}
	};
};
Rational operator+(const Rational &a,const Rational &b){
	return Rational(a.p*b.q+b.p*a.q,a.q*b.q);
}
Rational operator-(const Rational &a){
	return Rational(-a.p,a.q);
}
Rational operator-(const Rational &a,const Rational &b){
	return Rational(a.p*b.q-b.p*a.q,a.q*b.q);
}
Rational operator*(const Rational &a,const Rational &b){
	return Rational((a.p)*(b.p),(a.q)*(b.q));
}
Rational operator/(const Rational &a,const Rational &b){
	ll g1=__gcd(a.p, b.p);
	ll g2=__gcd(a.q, b.q);
	return Rational((a.p/g1)*(b.q/g2),(a.q/g2)*(b.p/g1));
}
bool operator==(const Rational &a,const Rational &b){
	return (a.p==b.p)&&(a.q==b.q);
}
bool cmp(const Rational &a,const Rational &b){
	ll g1=(a.p&&b.p) ? __gcd(abs(a.p), abs(b.p)) : 1;
	ll g2=__gcd(a.q, b.q);
	return (a.p/g1)*(b.q/g2)<(a.q/g2)*(b.p/g1);
}
bool operator<(const Rational &a,const Rational &b){
	return (a.p)*(b.q)<(a.q)*(b.p);
}
bool operator>(const Rational &a,const Rational &b){return b<a;}
bool operator<=(const Rational &a,const Rational &b){return (a<b)||(a==b);}
bool operator>=(const Rational &a,const Rational &b){return (a>b)||(a==b);}
bool operator!=(const Rational &a,const Rational &b){return !(b==a);}

typedef pair<Rational, Rational> P;

int n, m;

int cw(const P &x, const P &y){
	return cmp(x.first*y.second, x.second*y.first);
}

main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	scanf("%d", &n);
	vector<P> d;
	int mx = 0, my = 0;
	REP(i, n){
		int x, y;
		scanf("%d%d", &x, &y);
		d.eb(Rational(1, x), Rational(1, y));
	}
	vector<P> g = d;
	g.eb(10, 0);
	g.eb(0, 10);
	sort(ALL(g), [](const P &p, const P &q){
		if(p.first == q.first) return p.second > q.second;
		return p.first < q.first;
	});
	UNIQUE(g);
	vector<P> st;
	REP(i, g.size()){
		while(st.size()>1 && cw(st.back()-st[st.size()-2], g[i]-st[st.size()-2])) st.pop_back();
		st.pb(g[i]);
	}

	set<P> p;
	REP(i, st.size()) p.insert(st[i]);
	vi ans;
	REP(i, n) if(p.count(d[i]) || d[i].first.q == mx || d[i].second.q == my) ans.pb(i+1);
	REP(i, n) if(p.count(d[i])) ans.pb(i+1);
	sort(ALL(ans));
	REP(i, ans.size()) cout << ans[i] << " \n"[i+1==ans.size()];
	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define eps 1e-11
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	double x, y;
	int idx;
	inline bool operator<(const xd& b) const {
		return x!=b.x ? x<b.x : y<b.y;
	}
	inline bool operator==(const xd& b) const {
		return x==b.x && y==b.y;
	}
} all[200005];
int stk[200005], top;
bool ans[200005];

double cross_z(xd o, xd a, xd b) {
	return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x);
}

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		int x, y;
		REP(i, N) {
			RII(x, y);
			all[i].x = 100000./x, all[i].y = 100000./y;
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			if( i==0 || all[i].x != all[i-1].x ) {
				while( top>=2 && cross_z(all[stk[top-2]], all[stk[top-1]], all[i]) < -eps ) --top;
				stk[top++] = i;
			}
		}
		while( top>=2 && all[stk[top-2]].y < all[stk[top-1]].y ) --top;

		MSET(ans, false);
		REP(i, top)
			ans[all[stk[i]].idx] = true;
		for(int i=1; i<N; ++i)
			if( ans[i-1] && all[i] == all[i-1] )
				ans[i] = true;
		REP(i, N)
			if( ans[i] )
				printf("%d ", i+1);
		putchar('\n');
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define eps 1e-11
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	double x, y;
	int idx;
	inline bool operator<(const xd& b) const {
		return x!=b.x ? x<b.x : y<b.y;
	}
	inline bool operator<=(const xd& b) const {
		return x<=b.x && y<=b.y;
	}
} all[200005];
int stk[200005], top;

double cross_z(xd o, xd a, xd b) {
	return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x);
}

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		int x, y;
		REP(i, N) {
			RII(x, y);
			all[i].x = 100000./x, all[i].y = 100000./y;
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			while( top>=2 && cross_z(all[stk[top-2]], all[stk[top-1]], all[i]) < -eps ) --top;
			stk[top++] = i;
		}

		REP(i, top)
			stk[i] = all[stk[i]].idx+1;
		sort(stk, stk+top);
		REP(i, top-1)
			printf("%d ", stk[i]);
		printf("%d\n", stk[top-1]);
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define eps 1e-20
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	double x, y;
	int idx;
	inline bool operator<(const xd& b) const {
		return x!=b.x ? x<b.x : y<b.y;
	}
	inline bool operator==(const xd& b) const {
		return x==b.x && y==b.y;
	}
} all[200005];
int stk[200005], top;
bool ans[200005];

double cross_z(xd o, xd a, xd b) {
	return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x);
}

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		int x, y;
		REP(i, N) {
			RII(x, y);
			all[i].x = 1./x, all[i].y = 1./y;
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			if( i==0 || all[i].x != all[i-1].x ) {
				while( top>=2 && cross_z(all[stk[top-2]], all[stk[top-1]], all[i]) < -eps ) --top;
				stk[top++] = i;
			}
		}
		while( top>=2 && all[stk[top-2]].y < all[stk[top-1]].y ) --top;

		MSET(ans, false);
		REP(i, top)
			ans[all[stk[i]].idx] = true;
		for(int i=1; i<N; ++i)
			if( ans[all[i-1].idx] && all[i] == all[i-1] )
				ans[all[i].idx] = true;
		REP(i, N)
			if( ans[i] )
				printf("%d ", i+1);
		putchar('\n');
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	int x, y, idx;
	inline bool operator<(const xd& b) const {
		return x^b.x ? x<b.x : y<b.y;
	}
	inline bool operator<=(const xd& b) const {
		return x<=b.x && y<=b.y;
	}
} all[200005];
int stk[200005], top;

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		REP(i, N) {
			RII(all[i].x, all[i].y);
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			while( top && all[stk[top-1]] <= all[i] ) --top;
			stk[top++] = i;
		}
		REP(i, top)
			stk[i] = all[stk[i]].idx+1;
		sort(stk, stk+top);
		REP(i, top-1)
			printf("%d ", stk[i]);
		printf("%d\n", stk[top-1]);
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define eps 1e-11
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	double x, y;
	int idx;
	inline bool operator<(const xd& b) const {
		return x!=b.x ? x<b.x : y<b.y;
	}
	inline bool operator==(const xd& b) const {
		return x==b.x && y==b.y;
	}
} all[200005];
int stk[200005], top;
bool ans[200005];

double cross_z(xd o, xd a, xd b) {
	return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x);
}

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		int x, y;
		REP(i, N) {
			RII(x, y);
			all[i].x = 100000./x, all[i].y = 100000./y;
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			if( i==0 || all[i].x != all[i-1].x ) {
				while( top>=2 && cross_z(all[stk[top-2]], all[stk[top-1]], all[i]) < -eps ) --top;
				stk[top++] = i;
			}
		}
		while( top>=2 && all[stk[top-2]].y < all[stk[top-1]].y ) --top;

		MSET(ans, false);
		REP(i, top)
			ans[all[stk[i]].idx] = true;
		for(int i=1; i<N; ++i)
			if( ans[all[i-1].idx] && all[i] == all[i-1] )
				ans[all[i].idx] = true;
		REP(i, N)
			if( ans[i] )
				printf("%d ", i+1);
		putchar('\n');
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	int x, y, idx;
	bool operator<(const xd& b) const {
		return x^b.x ? x<b.x : y<b.y;
	}
} all[200005];
int stk[200005], top;

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		REP(i, N) {
			RII(all[i].x, all[i].y);
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			while( top && all[stk[top-1]].y < all[i].y ) --top;
			stk[top++] = i;
		}
		REP(i, top)
			stk[i] = all[stk[i]].idx+1;
		sort(stk, stk+top);
		REP(i, top-1)
			printf("%d ", stk[i]);
		printf("%d\n", stk[top-1]);
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define eps 1e-11
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	double x, y;
	int idx;
	inline bool operator<(const xd& b) const {
		return x!=b.x ? x<b.x : y<b.y;
	}
	inline bool operator==(const xd& b) const {
		return x==b.x && y==b.y;
	}
} all[200005];
int stk[200005], top;
bool ans[200005];

double cross_z(xd o, xd a, xd b) {
	return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x);
}

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		int x, y;
		REP(i, N) {
			RII(x, y);
			all[i].x = 100000./x, all[i].y = 100000./y;
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			if( i==0 || all[i].x != all[i-1].x ) {
				while( top>=2 && cross_z(all[stk[top-2]], all[stk[top-1]], all[i]) < -eps ) --top;
				stk[top++] = i;
			}
		}
		while( top>=2 && all[stk[top-2]].y < all[stk[top-1]].y ) --top;

		MSET(ans, false);
		REP(i, top)
			ans[all[stk[i]].idx] = true;
		for(int i=1; i<N; ++i)
			if( ans[all[i].idx-1] && all[i] == all[i-1] )
				ans[all[i].idx] = true;
		REP(i, N)
			if( ans[i] )
				printf("%d ", i+1);
		putchar('\n');
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define eps 1e-11
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	double x, y;
	int idx;
	inline bool operator<(const xd& b) const {
		return x!=b.x ? x<b.x : y<b.y;
	}
	inline bool operator==(const xd& b) const {
		return x==b.x && y==b.y;
	}
} all[200005];
int stk[200005], top;
bool ans[200005];

double cross_z(xd o, xd a, xd b) {
	return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x);
}

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		int x, y;
		REP(i, N) {
			RII(x, y);
			all[i].x = 100000./x, all[i].y = 100000./y;
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			if( i==0 || all[i].x != all[i-1].x ) {
				while( top>=2 && cross_z(all[stk[top-2]], all[stk[top-1]], all[i]) < -eps ) --top;
				stk[top++] = i;
			}
		}

		MSET(ans, false);
		REP(i, top)
			ans[all[stk[i]].idx] = true;
		for(int i=1; i<N; ++i)
			if( ans[i-1] && all[i] == all[i-1] )
				ans[i] = true;
		REP(i, N)
			if( ans[i] )
				printf("%d ", i+1);
		putchar('\n');
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	int x, y, idx;
	inline bool operator<(const xd& b) const {
		return x^b.x ? x<b.x : y<b.y;
	}
	inline bool operator<=(const xd& b) const {
		return x<=b.x && y<=b.y;
	}
} all[200005];
int stk[200005], top;

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		REP(i, N) {
			RII(all[i].x, all[i].y);
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			while( top && all[stk[top-1]] <= all[i] ) --top;
			stk[top++] = i;
		}
		if( N > 10 ) {
			REP(i, top-1)
				printf("%x %x ", all[stk[i]].x, all[stk[i]].y);
			printf("%x %x\n", all[stk[top-1]].x, all[stk[top-1]].y);
		}
		REP(i, top)
			stk[i] = all[stk[i]].idx+1;
		sort(stk, stk+top);
		REP(i, top-1)
			printf("%d ", stk[i]);
		printf("%d\n", stk[top-1]);
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define eps 1e-20
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	double x, y;
	int idx;
	inline bool operator<(const xd& b) const {
		return x!=b.x ? x<b.x : y<b.y;
	}
	inline bool operator==(const xd& b) const {
		return x==b.x && y==b.y;
	}
} all[200005];
int stk[200005], top;
bool ans[200005];

double cross_z(xd o, xd a, xd b) {
	return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x);
}

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		int x, y;
		REP(i, N) {
			RII(x, y);
			all[i].x = 1./x, all[i].y = 1./y;
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			//printf("%.10f %.10f\n", all[i].x, all[i].y);
			if( i==0 || all[i].x != all[i-1].x ) {
				while( top>=2 && cross_z(all[stk[top-2]], all[stk[top-1]], all[i]) < -eps ) --top;
				stk[top++] = i;
			}
		}
		while( top>=2 && all[stk[top-2]].y <= all[stk[top-1]].y ) --top;

		MSET(ans, false);
		REP(i, top)
			ans[all[stk[i]].idx] = true;
		for(int i=1; i<N; ++i)
			if( ans[all[i-1].idx] && all[i] == all[i-1] )
				ans[all[i].idx] = true;
		REP(i, N)
			if( ans[i] )
				printf("%d ", i+1);
		putchar('\n');
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define eps 1e-11
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	double x, y;
	int idx;
	inline bool operator<(const xd& b) const {
		return x!=b.x ? x<b.x : y<b.y;
	}
	inline bool operator==(const xd& b) const {
		return x==b.x && y==b.y;
	}
} all[200005];
int stk[200005], top;
bool ans[200005];

double cross_z(xd o, xd a, xd b) {
	return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x);
}

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		int x, y;
		REP(i, N) {
			RII(x, y);
			all[i].x = 100000./x, all[i].y = 100000./y;
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			if( i==0 || all[i].x != all[i-1].x ) {
				while( top>=2 && cross_z(all[stk[top-2]], all[stk[top-1]], all[i]) < -eps ) --top;
				stk[top++] = i;
			}
		}
		while( top>=2 && all[stk[top-2]].y <= all[stk[top-1]].y ) --top;

		MSET(ans, false);
		REP(i, top)
			ans[all[stk[i]].idx] = true;
		for(int i=1; i<N; ++i)
			if( ans[all[i-1].idx] && all[i] == all[i-1] )
				ans[all[i].idx] = true;
		REP(i, N)
			if( ans[i] )
				printf("%d ", i+1);
		putchar('\n');
	}

	return 0;
}


// Template.cpp by kevinptt 20150108
#include <bits/stdc++.h>
/*
#include <cstdio>
#include <cstring>
#include <cmath>

#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>

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

#define REP(I, N) for(int I=0; I<(N); ++I)
#define REP1(I, N) for(int I=1; I<=(N); ++I)
#define REPP(I, A, B) for(int I=(A); I<(B); ++I)
#define REPR(I, N) for(int I=N-1; I>=0; --I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int X; scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define MP make_pair
#define PB push_back
#define MSET(x, y) memset(x, y, sizeof(x))
#define F first
#define S second
#define eps 1e-15
typedef long long ll;
typedef pair<int,int> pii;

/***************************************************************/

struct xd {
	double x, y;
	int idx;
	inline bool operator<(const xd& b) const {
		return x!=b.x ? x<b.x : y<b.y;
	}
	inline bool operator==(const xd& b) const {
		return x==b.x && y==b.y;
	}
} all[200005];
int stk[200005], top;
bool ans[200005];

double cross_z(xd o, xd a, xd b) {
	return (a.x-o.x)*(b.y-o.y) - (a.y-o.y)*(b.x-o.x);
}

int main() {
#ifdef KEVINPTT
	//freopen("a.in", "r", stdin);
	//freopen("a.ans", "w", stdout);
#endif
	int N;
	while( ~RI(N) ) {
		int x, y;
		REP(i, N) {
			RII(x, y);
			all[i].x = 10000./x, all[i].y = 10000./y;
			all[i].idx = i;
		}
		sort(all, all+N);
		top = 0;
		REP(i, N) {
			if( i==0 || all[i].x != all[i-1].x ) {
				while( top>=2 && cross_z(all[stk[top-2]], all[stk[top-1]], all[i]) < -eps ) --top;
				stk[top++] = i;
			}
		}
		while( top>=2 && all[stk[top-2]].y < all[stk[top-1]].y ) --top;

		MSET(ans, false);
		REP(i, top)
			ans[all[stk[i]].idx] = true;
		for(int i=1; i<N; ++i)
			if( ans[all[i-1].idx] && all[i] == all[i-1] )
				ans[all[i].idx] = true;
		REP(i, N)
			if( ans[i] )
				printf("%d ", i+1);
		putchar('\n');
	}

	return 0;
}


#pragma comment (linker, "/STACK:128000000")
//#include "testlib.h"
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <bitset>
//#include <unordered_map>
//#include <unordered_set>
#include <ctime>
#include <stack>
#include <queue>
#include <fstream>
using namespace std;
//#define FILENAME ""
#define mp make_pair
#define all(a) a.begin(), a.end()
typedef long long li;
typedef long double ld;
void solve();
void precalc();
clock_t start;
//int timer = 1;

bool doing = true;

int main() {
#ifdef room111
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen(FILENAME".in", "r", stdin);
	//freopen(FILENAME ".out", "w", stdout);
#endif
	int t = 1;
	cout.sync_with_stdio(0);
	cin.tie(0);
	precalc();
	cout.precision(10);
	cout << fixed;
	//cin >> t;
	start = clock();
	int testNum = 1;
	while (t--) {
		//cout << "Case #" << testNum++ << ":\n";
		solve();
		//++timer;
	}

#ifdef room111
	cerr << "\n\n" << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif

	return 0;
}

//BE CAREFUL: IS INT REALLY INT?

//#define int li

void precalc() {

}

int binpow(int q, int w, int mod) {
	if (!w)
		return 1;
	if (w & 1)
		return q * binpow(q, w - 1, mod) % mod;
	return binpow(q * q % mod, w / 2, mod);
}

int gcd(int q, int w) {
	while (w) {
		q %= w;
		swap(q, w);
	}
	return q;
}

//#define int li

//int mod = 1000000007;

ld eps = 1e-9;

ld PI = acos((ld)-1.0);

struct Point {
	ld x, y;
	vector<int> id;
	Point() { x = y = 0; }
	Point(ld x, ld y) :x(x), y(y) {}
	void scan() { cin >> x >> y; }
	bool operator < (const Point& other) const { return x + eps < other.x || fabs(x - other.x) < eps && y + eps < other.y; }
	Point operator - (const Point& other) const { return Point(x - other.x, y - other.y); }
	Point operator + (const Point& other) const { return Point(x + other.x, y + other.y); }
	Point operator * (ld c) const { return Point(x * c, y * c); }
	void print() const { cout << x << ' ' << y << ' ' << "\n"; }
	ld operator * (const Point& other) const { return x * other.y - y * other.x; }
	ld operator % (const Point& other) const { return x * other.x + y * other.y; }
	ld dist() const { return sqrt(x * x + y * y); }
	ld sqrDist() const { return x * x + y * y; }
	Point operator / (ld c) const { return Point(x / c, y / c); }
	bool operator == (const Point& other) const { return fabs(x - other.x) < eps && fabs(y - other.y) < eps; }
	Point rotate(ld alpha) const { return Point(x * cos(alpha) - y * sin(alpha), x * sin(alpha) + y * cos(alpha)); }
	Point normalized() const { return *this / dist(); }
};

void solve() {
	int n;
	cin >> n;
	vector<Point> points;
	map<pair<int, int>, int> ids;
	for (int i = 0; i < n; ++i) {
		int r, c;
		cin >> r >> c;
		int id = points.size();
		if (ids.count(mp(r, c))) {
			id = ids[mp(r, c)];
		}
		if (id == points.size()) {
			points.push_back(Point(1.0 / r, 1.0 / c));
			ids[mp(r, c)] = id;
		}
		points[id].id.push_back(i);
	}

	sort(all(points));

	vector<Point> up, down;

	for (int i = 0; i < points.size(); ++i) {
		while (up.size() > 1 && (up[up.size() - 2] - up.back()) * (points[i] - up.back()) < -eps) {
			up.pop_back();
		}
		up.push_back(points[i]);

		while (down.size() > 1 && (down[down.size() - 2] - down.back()) * (points[i] - down.back()) > eps) {
			down.pop_back();
		}
		down.push_back(points[i]);
	}

	vector<int> res(n, 0);

	for (int i = 0; i < down.size(); ++i) {
		int prev = i - 1;
		if (i > 0 && down[i].y + eps > down[i - 1].y) {
			break;
		}
		for (int to : down[i].id) {
			res[to] = 1;
		}
	}

	for (int i = 0; i < n; ++i) {
		if (res[i]) {
			cout << i + 1 << ' ';
		}
	}
	cout << "\n";

}


#pragma comment (linker, "/STACK:128000000")
//#include "testlib.h"
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <bitset>
//#include <unordered_map>
//#include <unordered_set>
#include <ctime>
#include <stack>
#include <queue>
#include <fstream>
using namespace std;
//#define FILENAME ""
#define mp make_pair
#define all(a) a.begin(), a.end()
typedef long long li;
typedef long double ld;
void solve();
void precalc();
clock_t start;
//int timer = 1;

bool doing = true;

int main() {
#ifdef room111
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen(FILENAME".in", "r", stdin);
	//freopen(FILENAME ".out", "w", stdout);
#endif
	int t = 1;
	cout.sync_with_stdio(0);
	cin.tie(0);
	precalc();
	cout.precision(10);
	cout << fixed;
	//cin >> t;
	start = clock();
	int testNum = 1;
	while (t--) {
		//cout << "Case #" << testNum++ << ":\n";
		solve();
		//++timer;
	}

#ifdef room111
	cerr << "\n\n" << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif

	return 0;
}

//BE CAREFUL: IS INT REALLY INT?

//#define int li

void precalc() {

}

int binpow(int q, int w, int mod) {
	if (!w)
		return 1;
	if (w & 1)
		return q * binpow(q, w - 1, mod) % mod;
	return binpow(q * q % mod, w / 2, mod);
}

int gcd(int q, int w) {
	while (w) {
		q %= w;
		swap(q, w);
	}
	return q;
}

//#define int li

//int mod = 1000000007;

ld eps = 1e-9;

ld PI = acos((ld)-1.0);

struct Point {
	ld x, y;
	int id;
	Point() { x = y = 0; }
	Point(ld x, ld y) :x(x), y(y) {}
	void scan() { cin >> x >> y; }
	bool operator < (const Point& other) const { return x + eps < other.x || fabs(x - other.x) < eps && y + eps < other.y; }
	Point operator - (const Point& other) const { return Point(x - other.x, y - other.y); }
	Point operator + (const Point& other) const { return Point(x + other.x, y + other.y); }
	Point operator * (ld c) const { return Point(x * c, y * c); }
	void print() const { cout << x << ' ' << y << ' ' << "\n"; }
	ld operator * (const Point& other) const { return x * other.y - y * other.x; }
	ld operator % (const Point& other) const { return x * other.x + y * other.y; }
	ld dist() const { return sqrt(x * x + y * y); }
	ld sqrDist() const { return x * x + y * y; }
	Point operator / (ld c) const { return Point(x / c, y / c); }
	bool operator == (const Point& other) const { return fabs(x - other.x) < eps && fabs(y - other.y) < eps; }
	Point rotate(ld alpha) const { return Point(x * cos(alpha) - y * sin(alpha), x * sin(alpha) + y * cos(alpha)); }
	Point normalized() const { return *this / dist(); }
};

void solve() {
	int n;
	cin >> n;
	vector<Point> points(n);
	for (int i = 0; i < n; ++i) {
		int r, c;
		cin >> r >> c;
		points[i] = Point(1.0 / r, 1.0 / c);
		points[i].id = i;
	}

	sort(all(points));

	vector<Point> up, down;

	for (int i = 0; i < n; ++i) {
		while (up.size() > 1 && (up[up.size() - 2] - up.back()) * (points[i] - up.back()) < -eps) {
			up.pop_back();
		}
		up.push_back(points[i]);

		while (down.size() > 1 && (down[down.size() - 2] - down.back()) * (points[i] - down.back()) > eps) {
			down.pop_back();
		}
		down.push_back(points[i]);
	}

	vector<int> res(n, 0);

	for (int i = 0; i < down.size(); ++i) {
		int prev = i - 1;
		if (i > 0 && down[i].y + eps > down[i - 1].y) {
			break;
		}
		res[down[i].id] = 1;
	}

	for (int i = 0; i < n; ++i) {
		if (res[i]) {
			cout << i + 1 << ' ';
		}
	}
	cout << "\n";

}


#pragma comment (linker, "/STACK:128000000")
//#include "testlib.h"
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <bitset>
//#include <unordered_map>
//#include <unordered_set>
#include <ctime>
#include <stack>
#include <queue>
#include <fstream>
using namespace std;
//#define FILENAME ""
#define mp make_pair
#define all(a) a.begin(), a.end()
typedef long long li;
typedef long double ld;
void solve();
void precalc();
clock_t start;
//int timer = 1;

bool doing = true;

int main() {
#ifdef room111
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen(FILENAME".in", "r", stdin);
	//freopen(FILENAME ".out", "w", stdout);
#endif
	int t = 1;
	cout.sync_with_stdio(0);
	cin.tie(0);
	precalc();
	cout.precision(10);
	cout << fixed;
	//cin >> t;
	start = clock();
	int testNum = 1;
	while (t--) {
		//cout << "Case #" << testNum++ << ":\n";
		solve();
		//++timer;
	}

#ifdef room111
	cerr << "\n\n" << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif

	return 0;
}

//BE CAREFUL: IS INT REALLY INT?

//#define int li

void precalc() {

}

int binpow(int q, int w, int mod) {
	if (!w)
		return 1;
	if (w & 1)
		return q * binpow(q, w - 1, mod) % mod;
	return binpow(q * q % mod, w / 2, mod);
}

int gcd(int q, int w) {
	while (w) {
		q %= w;
		swap(q, w);
	}
	return q;
}

//#define int li

//int mod = 1000000007;

ld eps = 1e-9;

ld PI = acos((ld)-1.0);

struct Point {
	ld x, y;
	int id;
	Point() { x = y = 0; }
	Point(ld x, ld y) :x(x), y(y) {}
	void scan() { cin >> x >> y; }
	bool operator < (const Point& other) const { return x + eps < other.x || fabs(x - other.x) < eps && y + eps < other.y; }
	Point operator - (const Point& other) const { return Point(x - other.x, y - other.y); }
	Point operator + (const Point& other) const { return Point(x + other.x, y + other.y); }
	Point operator * (ld c) const { return Point(x * c, y * c); }
	void print() const { cout << x << ' ' << y << ' ' << "\n"; }
	ld operator * (const Point& other) const { return x * other.y - y * other.x; }
	ld operator % (const Point& other) const { return x * other.x + y * other.y; }
	ld dist() const { return sqrt(x * x + y * y); }
	ld sqrDist() const { return x * x + y * y; }
	Point operator / (ld c) const { return Point(x / c, y / c); }
	bool operator == (const Point& other) const { return fabs(x - other.x) < eps && fabs(y - other.y) < eps; }
	Point rotate(ld alpha) const { return Point(x * cos(alpha) - y * sin(alpha), x * sin(alpha) + y * cos(alpha)); }
	Point normalized() const { return *this / dist(); }
};

void solve() {
	int n;
	cin >> n;
	vector<Point> points(n);
	for (int i = 0; i < n; ++i) {
		int r, c;
		cin >> r >> c;
		points[i] = Point(1.0 / r, 1.0 / c);
		points[i].id = i;
	}

	sort(all(points));

	vector<Point> up, down;

	for (int i = 0; i < n; ++i) {
		while (up.size() > 1 && (up[up.size() - 2] - up.back()) * (points[i] - up.back()) < -eps) {
			up.pop_back();
		}
		up.push_back(points[i]);

		while (down.size() > 1 && (down[down.size() - 2] - down.back()) * (points[i] - down.back()) > eps) {
			down.pop_back();
		}
		down.push_back(points[i]);
	}

	vector<int> res(n, 0);

	for (int i = 0; i < down.size(); ++i) {
		int prev = i - 1;
		if (i > 0 && down[i].y > down[i - 1].y) {
			break;
		}
		res[down[i].id] = 1;
	}

	for (int i = 0; i < n; ++i) {
		if (res[i]) {
			cout << i + 1 << ' ';
		}
	}
	cout << "\n";

}


#pragma comment (linker, "/STACK:128000000")
//#include "testlib.h"
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <bitset>
//#include <unordered_map>
//#include <unordered_set>
#include <ctime>
#include <stack>
#include <queue>
#include <fstream>
using namespace std;
//#define FILENAME ""
#define mp make_pair
#define all(a) a.begin(), a.end()
typedef long long li;
typedef long double ld;
void solve();
void precalc();
clock_t start;
//int timer = 1;

bool doing = true;

int main() {
#ifdef room111
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen(FILENAME".in", "r", stdin);
	//freopen(FILENAME ".out", "w", stdout);
#endif
	int t = 1;
	cout.sync_with_stdio(0);
	cin.tie(0);
	precalc();
	cout.precision(10);
	cout << fixed;
	//cin >> t;
	start = clock();
	int testNum = 1;
	while (t--) {
		//cout << "Case #" << testNum++ << ":\n";
		solve();
		//++timer;
	}

#ifdef room111
	cerr << "\n\n" << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif

	return 0;
}

//BE CAREFUL: IS INT REALLY INT?

//#define int li

void precalc() {

}

int binpow(int q, int w, int mod) {
	if (!w)
		return 1;
	if (w & 1)
		return q * binpow(q, w - 1, mod) % mod;
	return binpow(q * q % mod, w / 2, mod);
}

int gcd(int q, int w) {
	while (w) {
		q %= w;
		swap(q, w);
	}
	return q;
}

//#define int li

//int mod = 1000000007;

ld eps = 1e-18;

ld PI = acos((ld)-1.0);

struct Point {
	ld x, y;
	vector<int> id;
	Point() { x = y = 0; }
	Point(ld x, ld y) :x(x), y(y) {}
	void scan() { cin >> x >> y; }
	bool operator < (const Point& other) const { return x + eps < other.x || fabs(x - other.x) < eps && y + eps < other.y; }
	Point operator - (const Point& other) const { return Point(x - other.x, y - other.y); }
	Point operator + (const Point& other) const { return Point(x + other.x, y + other.y); }
	Point operator * (ld c) const { return Point(x * c, y * c); }
	void print() const { cout << x << ' ' << y << ' ' << "\n"; }
	ld operator * (const Point& other) const { return x * other.y - y * other.x; }
	ld operator % (const Point& other) const { return x * other.x + y * other.y; }
	ld dist() const { return sqrt(x * x + y * y); }
	ld sqrDist() const { return x * x + y * y; }
	Point operator / (ld c) const { return Point(x / c, y / c); }
	bool operator == (const Point& other) const { return fabs(x - other.x) < eps && fabs(y - other.y) < eps; }
	Point rotate(ld alpha) const { return Point(x * cos(alpha) - y * sin(alpha), x * sin(alpha) + y * cos(alpha)); }
	Point normalized() const { return *this / dist(); }
};

void solve() {
	int n;
	cin >> n;
	vector<Point> points;
	map<pair<int, int>, int> ids;
	for (int i = 0; i < n; ++i) {
		int r, c;
		cin >> r >> c;
		int id = points.size();
		if (ids.count(mp(r, c))) {
			id = ids[mp(r, c)];
		}
		if (id == points.size()) {
			points.push_back(Point((ld)1.0 / r, (ld)1.0 / c));
			ids[mp(r, c)] = id;
		}
		points[id].id.push_back(i);
	}

	sort(all(points));

	vector<Point> up, down;

	for (int i = 0; i < points.size(); ++i) {
		while (up.size() > 1 && (up[up.size() - 2] - up.back()) * (points[i] - up.back()) < -eps) {
			up.pop_back();
		}
		up.push_back(points[i]);

		while (down.size() > 1 && (down[down.size() - 2] - down.back()) * (points[i] - down.back()) > eps) {
			down.pop_back();
		}
		down.push_back(points[i]);
	}

	vector<int> res(n, 0);

	for (int i = 0; i < down.size(); ++i) {
		int prev = i - 1;
		if (i > 0 && down[i].y + eps > down[i - 1].y) {
			break;
		}
		for (int to : down[i].id) {
			res[to] = 1;
		}
	}

	for (int i = 0; i < n; ++i) {
		if (res[i]) {
			cout << i + 1 << ' ';
		}
	}
	cout << "\n";

}


#pragma comment (linker, "/STACK:128000000")
//#include "testlib.h"
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <bitset>
//#include <unordered_map>
//#include <unordered_set>
#include <ctime>
#include <stack>
#include <queue>
#include <fstream>
using namespace std;
//#define FILENAME ""
#define mp make_pair
#define all(a) a.begin(), a.end()
typedef long long li;
typedef long double ld;
void solve();
void precalc();
clock_t start;
//int timer = 1;

bool doing = true;

int main() {
#ifdef room111
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen(FILENAME".in", "r", stdin);
	//freopen(FILENAME ".out", "w", stdout);
#endif
	int t = 1;
	cout.sync_with_stdio(0);
	cin.tie(0);
	precalc();
	cout.precision(10);
	cout << fixed;
	//cin >> t;
	start = clock();
	int testNum = 1;
	while (t--) {
		//cout << "Case #" << testNum++ << ":\n";
		solve();
		//++timer;
	}

#ifdef room111
	cerr << "\n\n" << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif

	return 0;
}

//BE CAREFUL: IS INT REALLY INT?

//#define int li

void precalc() {

}

int binpow(int q, int w, int mod) {
	if (!w)
		return 1;
	if (w & 1)
		return q * binpow(q, w - 1, mod) % mod;
	return binpow(q * q % mod, w / 2, mod);
}

int gcd(int q, int w) {
	while (w) {
		q %= w;
		swap(q, w);
	}
	return q;
}

//#define int li

//int mod = 1000000007;

ld eps = 1e-9;

ld PI = acos((ld)-1.0);

struct Point {
	ld x, y;
	vector<int> id;
	Point() { x = y = 0; }
	Point(ld x, ld y) :x(x), y(y) {}
	void scan() { cin >> x >> y; }
	bool operator < (const Point& other) const { return x + eps < other.x || fabs(x - other.x) < eps && y + eps < other.y; }
	Point operator - (const Point& other) const { return Point(x - other.x, y - other.y); }
	Point operator + (const Point& other) const { return Point(x + other.x, y + other.y); }
	Point operator * (ld c) const { return Point(x * c, y * c); }
	void print() const { cout << x << ' ' << y << ' ' << "\n"; }
	ld operator * (const Point& other) const { return x * other.y - y * other.x; }
	ld operator % (const Point& other) const { return x * other.x + y * other.y; }
	ld dist() const { return sqrt(x * x + y * y); }
	ld sqrDist() const { return x * x + y * y; }
	Point operator / (ld c) const { return Point(x / c, y / c); }
	bool operator == (const Point& other) const { return fabs(x - other.x) < eps && fabs(y - other.y) < eps; }
	Point rotate(ld alpha) const { return Point(x * cos(alpha) - y * sin(alpha), x * sin(alpha) + y * cos(alpha)); }
	Point normalized() const { return *this / dist(); }
};

void solve() {
	int n;
	cin >> n;
	vector<Point> points;
	map<pair<int, int>, int> ids;
	for (int i = 0; i < n; ++i) {
		int r, c;
		cin >> r >> c;
		int id = i;
		if (ids.count(mp(r, c))) {
			id = ids[mp(r, c)];
		}
		if (id == i) {
			points.push_back(Point(1.0 / r, 1.0 / c));
			ids[mp(r, c)] = i;
		}
		points[id].id.push_back(i);
	}

	sort(all(points));

	vector<Point> up, down;

	for (int i = 0; i < points.size(); ++i) {
		while (up.size() > 1 && (up[up.size() - 2] - up.back()) * (points[i] - up.back()) < -eps) {
			up.pop_back();
		}
		up.push_back(points[i]);

		while (down.size() > 1 && (down[down.size() - 2] - down.back()) * (points[i] - down.back()) > eps) {
			down.pop_back();
		}
		down.push_back(points[i]);
	}

	vector<int> res(n, 0);

	for (int i = 0; i < down.size(); ++i) {
		int prev = i - 1;
		if (i > 0 && down[i].y + eps > down[i - 1].y) {
			break;
		}
		for (int to : down[i].id) {
			res[to] = 1;
		}
	}

	for (int i = 0; i < n; ++i) {
		if (res[i]) {
			cout << i + 1 << ' ';
		}
	}
	cout << "\n";

}


#pragma comment (linker, "/STACK:128000000")
//#include "testlib.h"
#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <bitset>
//#include <unordered_map>
//#include <unordered_set>
#include <ctime>
#include <stack>
#include <queue>
#include <fstream>
using namespace std;
//#define FILENAME ""
#define mp make_pair
#define all(a) a.begin(), a.end()
typedef long long li;
typedef long double ld;
void solve();
void precalc();
clock_t start;
//int timer = 1;

bool doing = true;

int main() {
#ifdef room111
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen(FILENAME".in", "r", stdin);
	//freopen(FILENAME ".out", "w", stdout);
#endif
	int t = 1;
	cout.sync_with_stdio(0);
	cin.tie(0);
	precalc();
	cout.precision(10);
	cout << fixed;
	//cin >> t;
	start = clock();
	int testNum = 1;
	while (t--) {
		//cout << "Case #" << testNum++ << ":\n";
		solve();
		//++timer;
	}

#ifdef room111
	cerr << "\n\n" << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif

	return 0;
}

//BE CAREFUL: IS INT REALLY INT?

//#define int li

void precalc() {

}

int binpow(int q, int w, int mod) {
	if (!w)
		return 1;
	if (w & 1)
		return q * binpow(q, w - 1, mod) % mod;
	return binpow(q * q % mod, w / 2, mod);
}

int gcd(int q, int w) {
	while (w) {
		q %= w;
		swap(q, w);
	}
	return q;
}

//#define int li

//int mod = 1000000007;

ld eps = 1e-12;

ld PI = acos((ld)-1.0);

struct Point {
	ld x, y;
	vector<int> id;
	Point() { x = y = 0; }
	Point(ld x, ld y) :x(x), y(y) {}
	void scan() { cin >> x >> y; }
	bool operator < (const Point& other) const { return x + eps < other.x || fabs(x - other.x) < eps && y + eps < other.y; }
	Point operator - (const Point& other) const { return Point(x - other.x, y - other.y); }
	Point operator + (const Point& other) const { return Point(x + other.x, y + other.y); }
	Point operator * (ld c) const { return Point(x * c, y * c); }
	void print() const { cout << x << ' ' << y << ' ' << "\n"; }
	ld operator * (const Point& other) const { return x * other.y - y * other.x; }
	ld operator % (const Point& other) const { return x * other.x + y * other.y; }
	ld dist() const { return sqrt(x * x + y * y); }
	ld sqrDist() const { return x * x + y * y; }
	Point operator / (ld c) const { return Point(x / c, y / c); }
	bool operator == (const Point& other) const { return fabs(x - other.x) < eps && fabs(y - other.y) < eps; }
	Point rotate(ld alpha) const { return Point(x * cos(alpha) - y * sin(alpha), x * sin(alpha) + y * cos(alpha)); }
	Point normalized() const { return *this / dist(); }
};

void solve() {
	int n;
	cin >> n;
	vector<Point> points;
	map<pair<int, int>, int> ids;
	for (int i = 0; i < n; ++i) {
		int r, c;
		cin >> r >> c;
		int id = points.size();
		if (ids.count(mp(r, c))) {
			id = ids[mp(r, c)];
		}
		if (id == points.size()) {
			points.push_back(Point((ld)1.0 / r, (ld)1.0 / c));
			ids[mp(r, c)] = id;
		}
		points[id].id.push_back(i);
	}

	sort(all(points));

	vector<Point> up, down;

	for (int i = 0; i < points.size(); ++i) {
		while (up.size() > 1 && (up[up.size() - 2] - up.back()) * (points[i] - up.back()) < -eps) {
			up.pop_back();
		}
		up.push_back(points[i]);

		while (down.size() > 1 && (down[down.size() - 2] - down.back()) * (points[i] - down.back()) > eps) {
			down.pop_back();
		}
		down.push_back(points[i]);
	}

	vector<int> res(n, 0);

	for (int i = 0; i < down.size(); ++i) {
		int prev = i - 1;
		if (i > 0 && down[i].y + eps > down[i - 1].y) {
			break;
		}
		for (int to : down[i].id) {
			res[to] = 1;
		}
	}

	for (int i = 0; i < n; ++i) {
		if (res[i]) {
			cout << i + 1 << ' ';
		}
	}
	cout << "\n";

}


#include <bits/stdc++.h>
#define REP(a,b) for(int a=0; a<(b); ++a)
#define FWD(a,b,c) for(int a=(b); a<(c); ++a)
#define FWDS(a,b,c,d) for(int a=(b); a<(c); a+=d)
#define BCK(a,b,c) for(int a=(b); a>(c); --a)
#define ALL(a) (a).begin(), (a).end()
#define SIZE(a) ((int)(a).size())
#define VAR(x) #x ": " << x << " "
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll
#define gcd __gcd
#define x first
#define y second
#define st first
#define nd second
#define pb push_back

using namespace std;

template<typename T> ostream& operator<<(ostream &out, const vector<T> &v){ out << "{"; for(const T &a : v) out << a << ", "; out << "}"; return out; }
template<typename S, typename T> ostream& operator<<(ostream &out, const pair<S,T> &p){ out << "(" << p.st << ", " << p.nd << ")"; return out; }

typedef long long LL;
typedef pair<int, int> PII;
typedef long double K;
typedef vector<int> VI;

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

int n;

struct zawodnik{
	int i, a, b;
};

vector<zawodnik> C;

bool operator<(zawodnik a, zawodnik b){
	if(a.a == b.a) return a.b < b.b;
	return a.a > b.a;
}

bool prawo(zawodnik a, zawodnik b, zawodnik c){
	// bx = (a.a - b.a) / (a.a * b.a)
	// by = (a.b - b.b) / (a.b * b.b)
	// cx = (a.a - c.a) / (a.a * c.a)
	// cy = (a.b - c.b) / (a.b * c.b)
	// bx * cy * a.a * a.b = (a.a - b.a) * (a.b - c.b) / (b.a * c.b)
	// by * cx * a.a * a.b = (a.b - b.b) * (a.a - c.a) / (b.b * c.a)
	return (LL)(a.a - b.a) * (a.b - c.b) * (b.b * c.a) < (LL)(a.b - b.b) * (a.a - c.a) * (b.a * c.b);
}

map<PII, bool> good;

int main(){
	scanf("%d", &n);
	PII crit;
	crit.st = 100010;
	FWD(i,0,n){
		int a, b;
		scanf("%d %d", &a, &b);
		zawodnik z;
		z.i = i+1;
		z.a = a;
		z.b = b;
		C.push_back(z);
		if(a > crit.st){
			crit.st = a;
			crit.nd = b;
		}else if(a == crit.st){
			crit.nd = max(crit.nd, b);
		}
	}

	{
		int i = 0;
		while(i < SIZE(C)){
			if(C[i].a == crit.st && C[i].b < crit.nd){
				swap(C[i], C.back());
				C.pop_back();
			}else
				++i;
		}
	}

	crit.nd = 100010;
	FWD(i,0,n){
		if(C[i].b > crit.nd){
			crit.nd = C[i].b;
			crit.st = C[i].a;
		}else if(C[i].b == crit.nd){
			crit.st = max(crit.st, C[i].a);
		}
	}

	{
		int i = 0;
		while(i < SIZE(C)){
			if(C[i].b == crit.nd && C[i].a < crit.st){
				swap(C[i], C.back());
				C.pop_back();
			}else
				++i;
		}
	}

	sort(C.begin(), C.end());
	vector<zawodnik> H;
	FWD(i,0,n){
		if(i && C[i-1].a == C[i].a && C[i-1].b == C[i].b)
			continue;
		while(H.size() > 1 && prawo(H[SIZE(H)-2], H.back(), C[i]))
			H.pop_back();
		H.push_back(C[i]);
	}
	FWD(i,0,SIZE(H)) good[PII(H[i].a, H[i].b)] = 1;
	vector<int> R;
	FWD(i,0,SIZE(C)) if(good[PII(C[i].a, C[i].b)]) R.push_back(C[i].i);
	sort(ALL(R));
	for(int x : R) printf("%d ", x);
	printf("\n");
	return 0;
}


#include <bits/stdc++.h>
#define REP(a,b) for(int a=0; a<(b); ++a)
#define FWD(a,b,c) for(int a=(b); a<(c); ++a)
#define FWDS(a,b,c,d) for(int a=(b); a<(c); a+=d)
#define BCK(a,b,c) for(int a=(b); a>(c); --a)
#define ALL(a) (a).begin(), (a).end()
#define SIZE(a) ((int)(a).size())
#define VAR(x) #x ": " << x << " "
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll
#define gcd __gcd
#define x first
#define y second
#define st first
#define nd second
#define pb push_back

using namespace std;

template<typename T> ostream& operator<<(ostream &out, const vector<T> &v){ out << "{"; for(const T &a : v) out << a << ", "; out << "}"; return out; }
template<typename S, typename T> ostream& operator<<(ostream &out, const pair<S,T> &p){ out << "(" << p.st << ", " << p.nd << ")"; return out; }

typedef long long LL;
typedef pair<int, int> PII;
typedef long double K;
typedef vector<int> VI;

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

const K EPS = 1e-9;

int n;

struct zawodnik{
	int i;
	K a, b;
};

vector<zawodnik> C;

bool operator<(zawodnik a, zawodnik b){
	if(fabs(a.a-b.a) < EPS) return a.b > b.b;
	return a.a < b.a;
}

bool prawo(zawodnik a, zawodnik b, zawodnik c){
	K bx, by, cx, cy;
	bx = b.a - a.a;
	by = b.b - a.b;
	cx = c.a - a.a;
	cy = c.b - a.b;
	return bx * cy - by * cx < -EPS;
}

int main(){
	scanf("%d", &n);
	FWD(i,0,n){
		int a, b;
		scanf("%d %d", &a, &b);
		zawodnik z;
		z.i = i+1;
		z.a = (K)1/a;
		z.b = (K)1/b;
		C.push_back(z);
	}
	sort(C.begin(), C.end());
	vector<zawodnik> H;
	FWD(i,0,n){
		while(H.size() > 1 && prawo(H[SIZE(H)-2], H.back(), C[i]))
			H.pop_back();
		H.push_back(C[i]);
	}
	vector<int> R;
	FWD(i,0,SIZE(H)) R.push_back(H[i].i);
	sort(ALL(R));
	for(int x : R) printf("%d ", x);
	printf("\n");
	return 0;
}


#include <bits/stdc++.h>
#define REP(a,b) for(int a=0; a<(b); ++a)
#define FWD(a,b,c) for(int a=(b); a<(c); ++a)
#define FWDS(a,b,c,d) for(int a=(b); a<(c); a+=d)
#define BCK(a,b,c) for(int a=(b); a>(c); --a)
#define ALL(a) (a).begin(), (a).end()
#define SIZE(a) ((int)(a).size())
#define VAR(x) #x ": " << x << " "
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll
#define gcd __gcd
#define x first
#define y second
#define st first
#define nd second
#define pb push_back

using namespace std;

template<typename T> ostream& operator<<(ostream &out, const vector<T> &v){ out << "{"; for(const T &a : v) out << a << ", "; out << "}"; return out; }
template<typename S, typename T> ostream& operator<<(ostream &out, const pair<S,T> &p){ out << "(" << p.st << ", " << p.nd << ")"; return out; }

typedef long long LL;
typedef pair<int, int> PII;
typedef long double K;
typedef vector<int> VI;

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

int n;

struct zawodnik{
	int i, a, b;
};

vector<zawodnik> C;

bool operator<(zawodnik a, zawodnik b){
	if(a.a == b.a) return a.b < b.b;
	return a.a > b.a;
}

bool prawo(zawodnik a, zawodnik b, zawodnik c){
	// bx = (a.a - b.a) / (a.a * b.a)
	// by = (a.b - b.b) / (a.b * b.b)
	// cx = (a.a - c.a) / (a.a * c.a)
	// cy = (a.b - c.b) / (a.b * c.b)
	// bx * cy * a.a * a.b = (a.a - b.a) * (a.b - c.b) / (b.a * c.b)
	// by * cx * a.a * a.b = (a.b - b.b) * (a.a - c.a) / (b.b * c.a)
	return (a.a - b.a) * (a.b - c.b) * (b.b * c.a) < (a.b - b.b) * (a.a - c.a) * (b.a * c.b);
}

int main(){
	scanf("%d", &n);
	FWD(i,0,n){
		int a, b;
		scanf("%d %d", &a, &b);
		zawodnik z;
		z.i = i+1;
		z.a = a;
		z.b = b;
		C.push_back(z);
	}
	sort(C.begin(), C.end());
	vector<zawodnik> H;
	FWD(i,0,n){
		while(H.size() > 1 && prawo(H[SIZE(H)-2], H.back(), C[i]))
			H.pop_back();
		H.push_back(C[i]);
	}
	vector<int> R;
	FWD(i,0,SIZE(H)) R.push_back(H[i].i);
	sort(ALL(R));
	for(int x : R) printf("%d ", x);
	printf("\n");
	return 0;
}


#include <bits/stdc++.h>
#define REP(a,b) for(int a=0; a<(b); ++a)
#define FWD(a,b,c) for(int a=(b); a<(c); ++a)
#define FWDS(a,b,c,d) for(int a=(b); a<(c); a+=d)
#define BCK(a,b,c) for(int a=(b); a>(c); --a)
#define ALL(a) (a).begin(), (a).end()
#define SIZE(a) ((int)(a).size())
#define VAR(x) #x ": " << x << " "
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll
#define gcd __gcd
#define x first
#define y second
#define st first
#define nd second
#define pb push_back

using namespace std;

template<typename T> ostream& operator<<(ostream &out, const vector<T> &v){ out << "{"; for(const T &a : v) out << a << ", "; out << "}"; return out; }
template<typename S, typename T> ostream& operator<<(ostream &out, const pair<S,T> &p){ out << "(" << p.st << ", " << p.nd << ")"; return out; }

typedef long long LL;
typedef pair<int, int> PII;
typedef long double K;
typedef vector<int> VI;

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

int n;

struct zawodnik{
	int i, a, b;
};

vector<zawodnik> C;

bool operator<(zawodnik a, zawodnik b){
	if(a.a == b.a) return a.b < b.b;
	return a.a > b.a;
}

bool prawo(zawodnik a, zawodnik b, zawodnik c){
	// bx = (a.a - b.a) / (a.a * b.a)
	// by = (a.b - b.b) / (a.b * b.b)
	// cx = (a.a - c.a) / (a.a * c.a)
	// cy = (a.b - c.b) / (a.b * c.b)
	// bx * cy * a.a * a.b = (a.a - b.a) * (a.b - c.b) / (b.a * c.b)
	// by * cx * a.a * a.b = (a.b - b.b) * (a.a - c.a) / (b.b * c.a)
	return ((LL)(a.a - b.a)) * (a.b - c.b) * b.b * c.a < ((LL)(a.b - b.b)) * (a.a - c.a) * b.a * c.b;
}

map<PII, bool> good;

int main(){
	scanf("%d", &n);
	PII crit;
	FWD(i,0,n){
		int a, b;
		scanf("%d %d", &a, &b);
		zawodnik z;
		z.i = i+1;
		z.a = a;
		z.b = b;
		C.push_back(z);
	}

	sort(C.begin(), C.end());
	vector<zawodnik> H;
	FWD(i,0,n){
		if(i && C[i-1].a == C[i].a && C[i-1].b == C[i].b)
			continue;
		while(H.size() > 1 && prawo(H[SIZE(H)-2], H.back(), C[i]))
			H.pop_back();
		H.push_back(C[i]);
	}
	{
		int i = 0;
		while(i + 1 < SIZE(H) && H[i].a == H[i+1].a && H[i].b < H[i+1].b) ++i;
		int j = SIZE(H)-1;
		while(j > 0 && (H[j].b < H[j-1].b || H[j].b == H[j-1].b && H[j].a < H[j-1].a)) --j;

		while(i <= j){
			good[PII(H[i].a, H[i].b)] = 1;
			++i;
		}
	}
	vector<int> R;
	FWD(i,0,SIZE(C)) if(good[PII(C[i].a, C[i].b)]) R.push_back(C[i].i);
	sort(ALL(R));
	for(int x : R) printf("%d ", x);
	printf("\n");
	return 0;
}


#include <bits/stdc++.h>
#define REP(a,b) for(int a=0; a<(b); ++a)
#define FWD(a,b,c) for(int a=(b); a<(c); ++a)
#define FWDS(a,b,c,d) for(int a=(b); a<(c); a+=d)
#define BCK(a,b,c) for(int a=(b); a>(c); --a)
#define ALL(a) (a).begin(), (a).end()
#define SIZE(a) ((int)(a).size())
#define VAR(x) #x ": " << x << " "
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll
#define gcd __gcd
#define x first
#define y second
#define st first
#define nd second
#define pb push_back

using namespace std;

template<typename T> ostream& operator<<(ostream &out, const vector<T> &v){ out << "{"; for(const T &a : v) out << a << ", "; out << "}"; return out; }
template<typename S, typename T> ostream& operator<<(ostream &out, const pair<S,T> &p){ out << "(" << p.st << ", " << p.nd << ")"; return out; }

typedef long long LL;
typedef pair<int, int> PII;
typedef long double K;
typedef vector<int> VI;

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

int n;

struct zawodnik{
	int i, a, b;
};

vector<zawodnik> C;

bool operator<(zawodnik a, zawodnik b){
	if(a.a == b.a) return a.b < b.b;
	return a.a > b.a;
}

bool prawo(zawodnik a, zawodnik b, zawodnik c){
	// bx = (a.a - b.a) / (a.a * b.a)
	// by = (a.b - b.b) / (a.b * b.b)
	// cx = (a.a - c.a) / (a.a * c.a)
	// cy = (a.b - c.b) / (a.b * c.b)
	// bx * cy * a.a * a.b = (a.a - b.a) * (a.b - c.b) / (b.a * c.b)
	// by * cx * a.a * a.b = (a.b - b.b) * (a.a - c.a) / (b.b * c.a)
	return (LL)(a.a - b.a) * (a.b - c.b) * (b.b * c.a) < (LL)(a.b - b.b) * (a.a - c.a) * (b.a * c.b);
}

int main(){
	scanf("%d", &n);
	FWD(i,0,n){
		int a, b;
		scanf("%d %d", &a, &b);
		zawodnik z;
		z.i = i+1;
		z.a = a;
		z.b = b;
		C.push_back(z);
	}
	sort(C.begin(), C.end());
	vector<zawodnik> H;
	FWD(i,0,n){
		while(H.size() > 1 && prawo(H[SIZE(H)-2], H.back(), C[i]))
			H.pop_back();
		H.push_back(C[i]);
	}
	vector<int> R;
	FWD(i,0,SIZE(H)) R.push_back(H[i].i);
	sort(ALL(R));
	for(int x : R) printf("%d ", x);
	printf("\n");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define ld long double
#define ll long long
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ld n, a, b;
    cin >> n >> a >> b;
    vector<int> v(n);
    for(int i = 0; i < n; i++){
        cin >> v[i];
    }
    for(int i = 0; i < n; i++){
        ll money = floor(v[i] * a / b);
        ll mink = ceil(money * b / a);
        ll extra = v[i] - mink;
        cout << extra << " ";

    }

    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define vii             vector<int>
#define vll             vector<ll>
#define mii             map<int, int>
#define mll             map<ll, ll>
#define si              set<int>
#define sl              set<ll>
#define umi             unordered_map<int, int>
#define uml             unordered_map<ll, ll>
#define usi             unordered_set<int>
#define usl             unordered_set<ll>
#define maxpq           priority_queue<int>
#define minpq           priority_queue<int,vii,greater<int>()>
#define pii             pair<int, int>
#define pll             pair<ll, ll>
#define pb              push_back
#define pf              push_front
#define mp              make_pair
#define endl            "\n"
#define desc            greater<int>()
#define F               first
#define S               second
#define mod             1000000007
#define pi              3.141592653589793238
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define FASTIO          ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag,
             tree_order_statistics_node_update> PBDS;

int main() {
    FASTIO
    ll n, a, b, i;
    cin>>n>>a>>b;
    ll ar[n];
    for(i = 0; i < n; i++)
        cin>>ar[i];
    for(i = 0; i < n; i++)
    {
        cout<<ar[i]%b<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define vii             vector<int>
#define vll             vector<ll>
#define mii             map<int, int>
#define mll             map<ll, ll>
#define si              set<int>
#define sl              set<ll>
#define umi             unordered_map<int, int>
#define uml             unordered_map<ll, ll>
#define usi             unordered_set<int>
#define usl             unordered_set<ll>
#define maxpq           priority_queue<int>
#define minpq           priority_queue<int,vii,greater<int>()>
#define pii             pair<int, int>
#define pll             pair<ll, ll>
#define pb              push_back
#define pf              push_front
#define mp              make_pair
#define endl            "\n"
#define desc            greater<int>()
#define F               first
#define S               second
#define mod             1000000007
#define pi              3.141592653589793238
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define FASTIO          ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag,
             tree_order_statistics_node_update> PBDS;

int main() {
    FASTIO
    ll n, a, b, i;
    cin>>n>>a>>b;
    ll ar[n];
    for(i = 0; i < n; i++)
        cin>>ar[i];
    for(i = 0; i < n; i++)
    {
        cout<<((ar[i]*a)%b)<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define vii             vector<int>
#define vll             vector<ll>
#define mii             map<int, int>
#define mll             map<ll, ll>
#define si              set<int>
#define sl              set<ll>
#define umi             unordered_map<int, int>
#define uml             unordered_map<ll, ll>
#define usi             unordered_set<int>
#define usl             unordered_set<ll>
#define maxpq           priority_queue<int>
#define minpq           priority_queue<int,vii,greater<int>()>
#define pii             pair<int, int>
#define pll             pair<ll, ll>
#define pb              push_back
#define pf              push_front
#define mp              make_pair
#define endl            "\n"
#define desc            greater<int>()
#define F               first
#define S               second
#define mod             1000000007
#define pi              3.141592653589793238
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define FASTIO          ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag,
             tree_order_statistics_node_update> PBDS;

int main() {
    FASTIO
    ll n, a, b, i;
    cin>>n>>a>>b;
    ll ar[n];
    for(i = 0; i < n; i++)
        cin>>ar[i];
    for(i = 0; i < n; i++)
    {
        if(a == 1)
            cout<<ar[i]%b<<" ";
        else
        {
            cout<<((ar[i]-a)%b)<<" ";
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define vii             vector<int>
#define vll             vector<ll>
#define mii             map<int, int>
#define mll             map<ll, ll>
#define si              set<int>
#define sl              set<ll>
#define umi             unordered_map<int, int>
#define uml             unordered_map<ll, ll>
#define usi             unordered_set<int>
#define usl             unordered_set<ll>
#define maxpq           priority_queue<int>
#define minpq           priority_queue<int,vii,greater<int>()>
#define pii             pair<int, int>
#define pll             pair<ll, ll>
#define pb              push_back
#define pf              push_front
#define mp              make_pair
#define endl            "\n"
#define desc            greater<int>()
#define F               first
#define S               second
#define mod             1000000007
#define pi              3.141592653589793238
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define FASTIO          ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag,
             tree_order_statistics_node_update> PBDS;

int main() {
    FASTIO
    ll n, a, b, i;
    cin>>n>>a>>b;
    ll ar[n];
    for(i = 0; i < n; i++)
        cin>>ar[i];
    for(i = 0; i < n; i++)
    {
        ll x = ar[i]*a/b;
        cout<<(ar[i] - x*b/a - (x*b)%a)<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll              long long
#define vii             vector<int>
#define vll             vector<ll>
#define mii             map<int, int>
#define mll             map<ll, ll>
#define si              set<int>
#define sl              set<ll>
#define umi             unordered_map<int, int>
#define uml             unordered_map<ll, ll>
#define usi             unordered_set<int>
#define usl             unordered_set<ll>
#define maxpq           priority_queue<int>
#define minpq           priority_queue<int,vii,greater<int>()>
#define pii             pair<int, int>
#define pll             pair<ll, ll>
#define pb              push_back
#define pf              push_front
#define mp              make_pair
#define endl            "\n"
#define desc            greater<int>()
#define F               first
#define S               second
#define mod             1000000007
#define pi              3.141592653589793238
#define setbits(x)      __builtin_popcountll(x)
#define zerobits(x)     __builtin_ctzll(x)
#define FASTIO          ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;
using namespace __gnu_pbds;

typedef tree<pii, null_type, less<pii>, rb_tree_tag,
             tree_order_statistics_node_update> PBDS;

int main() {
    FASTIO
    ll n, a, b, i;
    cin>>n>>a>>b;
    ll ar[n];
    for(i = 0; i < n; i++)
        cin>>ar[i];
    for(i = 0; i < n; i++)
    {
        // ll x = ar[i]*a/b;
        ll x = ar[i]*a/b;
        cout<<ar[i]-(x*b/a)-(x*b%a!=0)<<" ";
    }
    return 0;
}


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

#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define vvi vector<vi>
#define ff first
#define ss second
#define fastio ios_base::sync_with_stdio(false);  cin.tie(NULL)

const int N = 2*(1e5) +1;
const int inf = 1000000000;
int arr[N];

int32_t main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif

    int t=1;
    //cin>>t;
    while(t--){
        int n,p,k;
        cin>>n>>p>>k;
        vi v(n);
        for(int i=0;i<n;i++) cin>>v[i];
        int j=__gcd(p,k);
        j=k/j;
        for(int i=0;i<n;i++)
        cout<<(v[i]-j*(v[i]/j))/p<<" ";
        cout<<endl;

    }

}


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

#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define vvi vector<vi>
#define ff first
#define ss second
#define fastio ios_base::sync_with_stdio(false);  cin.tie(NULL)

const int N = 2*(1e5) +1;
const int inf = 1000000000;
int arr[N];

int32_t main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif

    int t=1;
    //cin>>t;
    while(t--){
        int n,p,k;
        cin>>n>>p>>k;
        vi v(n);
        for(int i=0;i<n;i++) cin>>v[i];
        for(int i=0;i<n;i++){
            if(p>=k)
            cout<<0<<" ";
        else
        cout<<((v[i]*p)%k)/p<<" ";}
        cout<<endl;

    }

}


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

#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define vvi vector<vi>
#define ff first
#define ss second
#define fastio ios_base::sync_with_stdio(false);  cin.tie(NULL)

const int N = 2*(1e5) +1;
const int inf = 1000000000;
int arr[N];

int32_t main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif

    int t=1;
    //cin>>t;
    while(t--){
        int n,p,k;
        cin>>n>>p>>k;
        vi v(n);
        for(int i=0;i<n;i++) cin>>v[i];
        int j=__gcd(p,k);
        j=k/j;
        for(int i=0;i<n;i++)
        cout<<min(v[i]-j*(v[i]/j),v[i]-(p*v[i])/k)<<" ";
        cout<<endl;

    }

}


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

#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define vvi vector<vi>
#define ff first
#define ss second
#define fastio ios_base::sync_with_stdio(false);  cin.tie(NULL)

const int N = 2*(1e5) +1;
const int inf = 1000000000;
int arr[N];

int32_t main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif

    int t=1;
    //cin>>t;
    while(t--){
        int n,p,k;
        cin>>n>>p>>k;
        vi v(n);
        for(int i=0;i<n;i++) cin>>v[i];
        int j=__gcd(p,k);
        j=k/j;
        for(int i=0;i<n;i++)
        cout<<min(v[i]-j*(v[i]/j),max(0,v[i]-(p*v[i])/k))<<" ";
        cout<<endl;

    }

}


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

#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define vvi vector<vi>
#define ff first
#define ss second
#define fastio ios_base::sync_with_stdio(false);  cin.tie(NULL)

const int N = 2*(1e5) +1;
const int inf = 1000000000;
int arr[N];

int32_t main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif

    int t=1;
    //cin>>t;
    while(t--){
        int n,p,k;
        cin>>n>>p>>k;
        vi v(n);
        for(int i=0;i<n;i++) cin>>v[i];
        int j=__gcd(p,k);
        j=k/j;
        for(int i=0;i<n;i++)
        cout<<v[i]-j*(v[i]/j)<<" ";
        cout<<endl;

    }

}


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

int cel(int x,int y){
    int val=x/y;
    if(x%y!=0){
        val++;
    }
    return val;
}

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

    int n,a,b;
    cin>>n>>a>>b;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        cout<<x-cel(((x*a)/b)*b,a)<<" ";
    }

    return 0;
}


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

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

    int n,a,b;
    cin>>n>>a>>b;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        cout<<x-ceil((((x*a)/b)*b)/(a*1.0))<<" ";
    }

    return 0;
}


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

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

    int n,a,b;
    cin>>n>>a>>b;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        cout<<(x*a)%b<<" ";
    }

    return 0;
}


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

int cel(int x,int y)
{
    int val=x/y;
    if(x%y!=0)
        val++;
    return val;
}

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

    int n,a,b;
    cin>>n>>a>>b;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        cout<<ceil((x*a)%b)<<" ";
    }

    return 0;
}


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

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define fori0(x) for(int i=0;i<x;i++)
#define forj0(x) for(int j=0;j<x;j++)
#define fork0(x) for(int k=0;k<x;k++)
#define fori1(x) for(int i=1;i<=x;i++)
#define forj1(x) for(int j=1;j<=x;j++)
#define fork1(x) for(int k=1;k<=x;k++)
#define foriv(v) for(int i=0;i<v.size();i++)
#define forjv(v) for(int j=0;j<v.size();j++)
#define forkv(v) for(int k=0;k<v.size();k++)
#define testcase(t) for(int te=1;te<=t;te++)
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)
#define FastRead ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

ll MOD = 998244353; // 998244353; // = (119<<23)+1
const int MX = 1e5+5;
const ll INF = 1e18;
const ld PI = 4*atan((ld)1);

template<class T> bool ckmin(T& a, const T& b)
{
    return a > b ? a = b, 1 : 0;
}
template<class T> bool ckmax(T& a, const T& b)
{
    return a < b ? a = b, 1 : 0;
}
ll num,num1,num2,num3,num4;
int test;
ll arr[MX];
int brr[MX];

int main()
{
    FastRead;
    vector<ll>vec;
    cin>>num1>>num2>>num3;
    ll mx=0;
    for(int i=1; i<=num1; i++)
    {
        cin>>arr[i];
    }
    for(int i=1; i<=num1; i++)
    {
        num=(arr[i]*num2)/num3;
        ll in=((num*num3))/num2;
        if((num*num3)!=(in*num2)){
            in++;
        }
        ll dif=arr[i]-in;
        cout<<dif<<" ";
    }

}


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

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define fori0(x) for(int i=0;i<x;i++)
#define forj0(x) for(int j=0;j<x;j++)
#define fork0(x) for(int k=0;k<x;k++)
#define fori1(x) for(int i=1;i<=x;i++)
#define forj1(x) for(int j=1;j<=x;j++)
#define fork1(x) for(int k=1;k<=x;k++)
#define foriv(v) for(int i=0;i<v.size();i++)
#define forjv(v) for(int j=0;j<v.size();j++)
#define forkv(v) for(int k=0;k<v.size();k++)
#define testcase(t) for(int te=1;te<=t;te++)
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)
#define FastRead ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

ll MOD = 998244353; // 998244353; // = (119<<23)+1
const int MX = 1e5+5;
const ll INF = 1e18;
const ld PI = 4*atan((ld)1);

template<class T> bool ckmin(T& a, const T& b)
{
    return a > b ? a = b, 1 : 0;
}
template<class T> bool ckmax(T& a, const T& b)
{
    return a < b ? a = b, 1 : 0;
}
ll num,num1,num2,num3,num4;
int test;
ll arr[MX];
int brr[MX];

int main()
{
    FastRead;
    vector<ll>vec;
    cin>>num1>>num2>>num3;
    ll mx=0;
    for(int i=1; i<=num1; i++)
    {
        cin>>arr[i];
    }
    for(int i=1; i<=num1; i++)
    {
        if(num2==1)
        {
            num=(arr[i]*num2)/num3;
            ll in=((num*num3))/num2;
            ll dif=arr[i]-in;
            cout<<dif<<" ";
        }
        else{
            num=(arr[i]*num2)/num3;
            ll in=((num*num3))/num2;
            ll dif=arr[i]-(in+1);
            cout<<dif<<" ";
        }
    }

}


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

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define fori0(x) for(int i=0;i<x;i++)
#define forj0(x) for(int j=0;j<x;j++)
#define fork0(x) for(int k=0;k<x;k++)
#define fori1(x) for(int i=1;i<=x;i++)
#define forj1(x) for(int j=1;j<=x;j++)
#define fork1(x) for(int k=1;k<=x;k++)
#define foriv(v) for(int i=0;i<v.size();i++)
#define forjv(v) for(int j=0;j<v.size();j++)
#define forkv(v) for(int k=0;k<v.size();k++)
#define testcase(t) for(int te=1;te<=t;te++)
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)
#define FastRead ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

ll MOD = 998244353; // 998244353; // = (119<<23)+1
const int MX = 1e5+5;
const ll INF = 1e18;
const ld PI = 4*atan((ld)1);

template<class T> bool ckmin(T& a, const T& b)
{
    return a > b ? a = b, 1 : 0;
}
template<class T> bool ckmax(T& a, const T& b)
{
    return a < b ? a = b, 1 : 0;
}
ll num,num1,num2,num3,num4;
int test;
ll arr[MX];
int brr[MX];
bool thik(long long mid){
    long long jerry=(mid*num2);
    if(jerry%num3==0){
        return true;
    }
    else{
        return false;
    }
}
long long binary(long long n){
    long long high=2*n;
    long long low=0;
    long long mid;
}
int main()
{
    FastRead;
    vector<ll>vec;
    cin>>num1>>num2>>num3;
    ll mx=0;
    for(int i=1;i<=num1;i++){
        cin>>arr[i];
        mx=max(mx,arr[i]);
    }
    for(ll i=1;;i++){
        num=num3*i;
        //cout<<num<<endl;
        if(num>mx*num2){
            break;
        }
        //cout<<num<<endl;
        vec.push_back(num);
    }
    //cout<<"You"<<endl;
    for(int i=1;i<=num1;i++){
        //cin>>arr[i];
        //mx=max(mx,arr[i]);
        num=arr[i]*num2;
        int index=lower_bound(vec.begin(),vec.end(),num)-vec.begin();
        if(index==vec.size()){
            index--;
            cout<<arr[i]-vec[index]<<" ";
            continue;
        }
        if(vec[index]>num){
            //cout<<arr[i]<<" ";
            index--;
            if(index<0){
                cout<<arr[i]<<" ";
            }
            else{
                cout<<arr[i]-vec[index]<<" ";
            }
        }
        else if(vec[index]==num){
            cout<<0<<" ";
        }
        else{
            //ll ans=vec[index]/num2;
            //cout<<ans<<" ";
        }

    }

}


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

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<ld> vd;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
#define fori0(x) for(int i=0;i<x;i++)
#define forj0(x) for(int j=0;j<x;j++)
#define fork0(x) for(int k=0;k<x;k++)
#define fori1(x) for(int i=1;i<=x;i++)
#define forj1(x) for(int j=1;j<=x;j++)
#define fork1(x) for(int k=1;k<=x;k++)
#define foriv(v) for(int i=0;i<v.size();i++)
#define forjv(v) for(int j=0;j<v.size();j++)
#define forkv(v) for(int k=0;k<v.size();k++)
#define testcase(t) for(int te=1;te<=t;te++)
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)
#define FastRead ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define rsz resize
#define ins insert
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

ll MOD = 998244353; // 998244353; // = (119<<23)+1
const int MX = 1e5+5;
const ll INF = 1e18;
const ld PI = 4*atan((ld)1);

template<class T> bool ckmin(T& a, const T& b)
{
    return a > b ? a = b, 1 : 0;
}
template<class T> bool ckmax(T& a, const T& b)
{
    return a < b ? a = b, 1 : 0;
}
ll num,num1,num2,num3,num4;
int test;
ll arr[MX];
int brr[MX];

int main()
{
    FastRead;
    vector<ll>vec;
    cin>>num1>>num2>>num3;
    ll mx=0;
    for(int i=1;i<=num1;i++){
        cin>>arr[i];
    }
    for(int i=1;i<=num1;i++){
        num=(arr[i]*num2)/num3;
        ll in=(num*num3)/num2;
        ll dif=arr[i]-in;
        cout<<dif<<" ";
    }

}


#include<bits/stdc++.h>
using namespace std;
using ll=long long int ;
int main()
{
    ll n, a,b;
    cin>>n>>a>>b;
    ll arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i]*a;
    }
    for(int i=0;i<n;i++)
    cout<<arr[i]%b<<" ";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll=long long int ;
int main()
{
    ll n, a,b;
    cin>>n>>a>>b;
    ll arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        arr[i]=arr[i]*a;
    }
    for(int i=0;i<n;i++)
    cout<<arr[i]%b<<" ";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll=long long int ;
int main()
{
    ll n, a,b;
    cin>>n>>a>>b;
    ll arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        arr[i]=(arr[i])%(b/a);
    }
    for(int i=0;i<n;i++)
    cout<<arr[i]<<" ";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll=long long int ;
int main()
{
    ll n, a,b;
    cin>>n>>a>>b;
    ll arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        arr[i]=(arr[i]*a)%b;
    }
    for(int i=0;i<n;i++)
    cout<<arr[i]/a<<" ";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll=long long int ;
int main()
{
    ll n a,b;
    cin>>n>>a>>b;
    ll arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        arr[i]=(arr[i])%(b/a);
    }
    for(int i=0;i<n;i++)
    cout<<arr[i];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using ll=long long int ;
int main()
{
    ll n, a,b;
    cin>>n>>a>>b;
    ll arr[n];
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        arr[i]=(arr[i])%(b/a);
    }
    for(int i=0;i<n;i++)
    cout<<arr[i];
    return 0;
}


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

int main(int argc, char** argv) {
    ios_base::sync_with_stdio(false);
    ull n,a,b;
    cin>>n>>a>>b;
    vector<ull> w(n);
    for(int i=0;i<n;++i) {
        cin>>w[i];
    }
    for (int i=0;i<n;++i) {
        ull rem = ((a%b)*(w[i]%b))%b;
        if (i==n-1) {
            cout << rem<<endl;
        } else {
            cout<<rem<<" ";
        }
    }
    return 0;
}


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

int main(int argc, char** argv) {
    ios_base::sync_with_stdio(false);
    size_t n,a,b;
    cin>>n>>a>>b;
    vector<size_t> w(n);
    for(int i=0;i<n;++i) {
        cin>>w[i];
    }
    for (int i=0;i<n;++i) {
        size_t rem = ((a%b)*(w[i]%b))%b;
        if (i==n-1) {
            cout << rem/a<<endl;
        } else {
            cout<<rem/a<<" ";
        }
    }
    return 0;
}


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

ull gcd(ull a,ull b) {
    return b==0 ? a : gcd(b, a%b);
}

int main(int argc, char** argv) {
    ios_base::sync_with_stdio(false);
    ull n,a,b;
    cin>>n>>a>>b;
    vector<ull> w(n);
    for(int i=0;i<n;++i) {
        cin>>w[i];
    }
    for (int i=0;i<n;++i) {
        ull rem = ((a%b)*(w[i]%b))%b;
        if (i==n-1) {
            cout << rem/a<<endl;
        } else {
            cout<<rem/a <<" ";
        }
    }
    return 0;
}


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

int main(int argc, char** argv) {
    ios_base::sync_with_stdio(false);
    size_t n,a,b;
    cin>>n>>a>>b;
    vector<size_t> w(n);
    for(int i=0;i<n;++i) {
        cin>>w[i];
    }
    for (int i=0;i<n;++i) {
        size_t rem = ((a%b)*(w[i]%b))%b;
        if (i==n-1) {
            cout << rem<<endl;
        } else {
            cout<<rem<<" ";
        }
    }
    return 0;
}


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

int main(int argc, char** argv) {
    ios_base::sync_with_stdio(false);
    size_t n,a,b;
    cin>>n>>a>>b;
    vector<size_t> w(n);
    for(int i=0;i<n;++i) {
        cin>>w[i];
    }
    for (int i=0;i<n;++i) {
        size_t rem = (a*w[i])%b;
        if (i==n-1) {
            cout << rem<<endl;
        } else {
            cout<<rem<<" ";
        }
    }
    return 0;
}


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

int main(int argc, char** argv) {
    ios_base::sync_with_stdio(false);
    ull n,a,b;
    cin>>n>>a>>b;
    vector<ull> w(n);
    for(int i=0;i<n;++i) {
        cin>>w[i];
    }
    for (int i=0;i<n;++i) {
        ull rem = ((a%b)*(w[i]%b))%b;
        if ((a*w[i]/b)==0) rem=0;
        if (i==n-1) {
            cout << rem<<endl;
        } else {
            cout<<rem<<" ";
        }
    }
    return 0;
}


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

size_t gcd(size_t a, size_t b) {
    return b == 0 ? a : gcd(b, a % b);
}

int main(int argc, char** argv) {
    ios_base::sync_with_stdio(false);
    size_t n,a,b;
    cin>>n>>a>>b;
    vector<size_t> w(n);
    for(int i=0;i<n;++i) {
        cin>>w[i];
    }
    size_t gc = gcd(a,b);
    a/=gc;
    b/=gc;
    for (int i=0;i<n;++i) {
        size_t rem = ((a%b)*(w[i]%b))%b;
        if (i==n-1) {
            cout << rem<<endl;
        } else {
            cout<<rem<<" ";
        }
    }
    return 0;
}


/*****Enigma_27*****/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pll         pair<ll,ll>
#define vll          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios        	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll unsigned n,i,j,k,l,t=0,ans=0,m,q,x,y,s;
int main()
{   ios
	cin>>n>>x>>y;
	x%=y;
	for(i=0;i<n;i++)
    {
        cin>>k;
        j=k*x/y;
       if(j*y%x==0) cout<<k-(j*y/x);else cout<<k-(j*y/x+1);
       cout<<" ";
    }

	return 0;
}


/*****Enigma_27*****/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pll         pair<ll,ll>
#define vll          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios        	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,i,k,l,t=0,ans=0,m,q,x,y,s,a,b;
int main()
{   ios
	cin>>n>>a>>b;
	for(i=0;i<n;i++)
    {
        cin>>k;
         s=k*a/b;
        ans = s*b/a;
        ans+=(s*b%a);
        cout<<k-ans<<" ";

    }

	return 0;
}


/*****Enigma_27*****/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pll         pair<ll,ll>
#define vll          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios        	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
float n,i,k,l,t=0,ans=0,m,q,x,y,s;
int main()
{   ios
	cin>>n>>x>>y;
	for(i=0;i<n;i++)
    {
        cin>>k;
        ll j=(k*x)/y;
        cout<<k-ceil((j*y)/x*1.0 )<<" ";
    }

	return 0;
}


/*****Enigma_27*****/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pll         pair<ll,ll>
#define vll          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios        	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,i,k,l,t=0,ans=0,m,q,x,y,s,a,b;
int main()
{   ios
	cin>>n>>a>>b;
	for(i=0;i<n;i++)
    {
        cin>>k;
        cout<<(k*a%b)/a<<" ";
    }

	return 0;
}


/*****Enigma_27*****/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pll         pair<ll,ll>
#define vll          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios        	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,i,k,l,t=0,ans=0,m,q,x,y,s,a,b;
int main()
{   ios
	cin>>n>>a>>b;
	for(i=0;i<n;i++)
    {
        cin>>k;
         ll j=(k*x)/y;
        cout<<k-((j*b)/a+(j*b%a))<<" ";
    }

	return 0;
}


/*****Enigma_27*****/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pll         pair<ll,ll>
#define vll          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios        	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,i,j,k,l,t=0,ans=0,m,q,x,y,s;
int main()
{   ios
	cin>>n>>x>>y;
	for(i=0;i<n;i++)
    {
        cin>>k;
       cout<<(k*x)%y<<" ";
    }

	return 0;
}


// </> : towhid1zaman

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

typedef unsigned long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define endl "\n"
#define sqr(a) ((a)*(a))
#define sz(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define deb(x) cout<<#x <<"="<<x<<endl;
#define present(v,x) ((v).find(x)!=(v).end())
#define _ ios::sync_with_stdio(0);cin.tie(0);
#define sp(k) cout<<setprecision(k)<<fixed;
#define fill(a,b) memset(a,b,sizeof(a))
#define all(v) (v).begin(),(v).end()

#define rep(i,a) for(int i=0;i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)

#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),(v).end())
#define yn(k) if(k)puts("YES");else puts("NO");

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int inf = 0x3f3f3f3f;// (int)3e18;
const int maxn = 200005;

/*
 *
 */

void task(){
	ll n, a, b; cin >> n >> a >> b;

	rep(i, n){
		ll x; cin >> x;
		ll money = ((x*a)/b);
		ll ans = x - ceil( (ceil(money*b)/a) );
		cout << ans <<' ';
	}
	cout << endl;
}

int main(){
        _
        #ifdef OJ
        freopen("inputf.in", "r", stdin);
        freopen("outputf.in", "w", stdout);
        #endif

        int T = 1;// cin >> T;
        while(T--){
            task();
        }

return 0;
}


// </> : towhid1zaman

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

typedef unsigned long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define endl "\n"
#define sqr(a) ((a)*(a))
#define sz(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define deb(x) cout<<#x <<"="<<x<<endl;
#define present(v,x) ((v).find(x)!=(v).end())
#define _ ios::sync_with_stdio(0);cin.tie(0);
#define sp(k) cout<<setprecision(k)<<fixed;
#define fill(a,b) memset(a,b,sizeof(a))
#define all(v) (v).begin(),(v).end()

#define rep(i,a) for(int i=0;i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)

#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),(v).end())
#define yn(k) if(k)puts("YES");else puts("NO");

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int inf = 0x3f3f3f3f;// (int)3e18;
const int maxn = 200005;

/*
 *
 */

void task(){
	ll n, a, b; cin >> n >> a >> b;

	rep(i, n){
		ll x; cin >> x;
		ll money = ((x*a)/b);
		ll ans = x - ( (ceil(money*b)/a) );
		cout << ans <<' ';
	}
	cout << endl;
}

int main(){
        _
        #ifdef OJ
        freopen("inputf.in", "r", stdin);
        freopen("outputf.in", "w", stdout);
        #endif

        int T = 1;// cin >> T;
        while(T--){
            task();
        }

return 0;
}


// </> : towhid1zaman

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define endl "\n"
#define sqr(a) ((a)*(a))
#define sz(x) ((int)(x).size())
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define deb(x) cout<<#x <<"="<<x<<endl;
#define present(v,x) ((v).find(x)!=(v).end())
#define _ ios::sync_with_stdio(0);cin.tie(0);
#define sp(k) cout<<setprecision(k)<<fixed;
#define fill(a,b) memset(a,b,sizeof(a))
#define all(v) (v).begin(),(v).end()

#define rep(i,a) for(int i=0;i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)

#define minv(v) *min_element(all(v))
#define maxv(v) *max_element(all(v))
#define unq(v) sort(all(v)),(v).erase(unique(all(v)),(v).end())
#define yn(k) if(k)puts("YES");else puts("NO");

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int inf = 0x3f3f3f3f;// (int)3e18;
const int maxn = 200005;

/*
 *
 */

void task(){
	ll n, a, b; cin >> n >> a >> b;
	vll x(n);

	rep(i, n) cin >> x[i];

	rep(i, n){
		ll money = ((x[i]*a)/b);
		ll ans =x[i] - ( (money*b)/a );
		cout << ans <<' ';
	}
	cout << endl;
}

int main(){
        _
        #ifdef OJ
        freopen("inputf.in", "r", stdin);
        freopen("outputf.in", "w", stdout);
        #endif

        int T = 1;// cin >> T;
        while(T--){
            task();
        }

return 0;
}