Language:C++
#include <iostream>
using namespace std;
int main(){
int a,b;
while(cin>>a>>b&&a&&b){
cout<<2*a-b<<endl;
}
}