#include #include using namespace std; int a,b,c; int main() { cin>>a>>b; c = abs(b - a); if(c==0) cout<<0; else cout<< c - a % c; return 0; }