#include #include #include #include #include #include #include #include #include #include using namespace std; const int MAX=1000005,MAXN=105,INF=1<<30; int n,b,c; int has[MAXN], pos[MAX]; int main() { bool endFlag; int u,v,p,adv,ft; while(scanf("%d %d %d",&n,&b,&c)==3){ memset(has,0,sizeof(has)); for(int i=0;i