#include <bits/stdc++.h>
using namespace std;
#include "Alice.h"
vector<pair<int,int> > Alice() {
vector<pair<int, int> > edges;
long long x = setN(5000);
for(int i = 2; i <= 5000; i++) {
edges.push_back({x%(i-1)+1, i});
}
return edges;
}
#include <bits/stdc++.h>
using namespace std;
#include "Bob.h"
long long Bob(vector<pair<int,int> > edges){
long long ans = 0;
__int128_t now = 1;
for(auto &[a, b] : edges) {
a--;
b--;
while(ans%b != a) {
ans += now;
}
// cerr << a << ' ' << b << '\n';
now = lcm(now, b);
if(now > 1e18) return ans;
}
return ans;
}