stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.219659624939668x):
#include<stdio.h>

int main()

{

	int A,B;

	scanf("%d%d", &A,&B);

	if(B%A==0)

	{

		printf("%d", A+B);

	}

	else

	printf("%d", B-A);

	return 0;	

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.213503396256332x):
#include <stdio.h>



int main()

{

    int a,b;

    scanf("%d%d", &a,&b);

    if (b%a==0){

        printf("%d\n",a+b);

    } else{

        printf("%d\n",b-a);

    }

    return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.213709847302956x):
#include <stdio.h>



int main()

{

    int a,b;

    scanf("%d%d", &a,&b);

    if (b%a==0){

        printf("%d\n",a+b);

    } else{

        printf("%d\n",b-a);

    }

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.213503396256332x):
#include <stdio.h>



int main()

{

    int a,b;

    scanf("%d%d", &a,&b);

    if (b%a==0){

        printf("%d\n",a+b);

    } else{

        printf("%d\n",b-a);

    }

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.212383757163462x):
#include<stdio.h>



int main(){

	int a, b;

	scanf("%d %d", &a, &b);

	if(b%a==0){

		printf("%d\n", b+a);

	}

	else{

		printf("%d\n", b-a);

	}

	return 0;

	

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.21259016387317x):
#include<stdio.h>



int main(){

	int a, b;

	scanf("%d %d", &a, &b);

	if(b%a==0){

		printf("%d\n", b+a);

	}

	else{

		printf("%d\n", b-a);

	}

	return 0;

	

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.212383757163462x):
#include<stdio.h>



int main(){

	int a, b;

	scanf("%d %d", &a, &b);

	if(b%a==0){

		printf("%d\n", b+a);

	}

	else{

		printf("%d\n", b-a);

	}

	return 0;

	

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>

 

int main (){

	int a, b;

	scanf("%d %d", &a, &b);

	if(b%a==0) {

		printf("%d", a+b);

	} else {

		printf("%d", b-a);

	}

	return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.218904029796207x):
#include <stdio.h>

 

int main (){

	int a, b;

	scanf("%d %d", &a, &b);

	if(b%a==0) {

		printf("%d", a+b);

	} else {

		printf("%d", b-a);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>

 

int main (){

	int a, b;

	scanf("%d %d", &a, &b);

	if(b%a==0) {

		printf("%d", a+b);

	} else {

		printf("%d", b-a);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.216327689221654x):
#include <stdio.h>



int main()

{

	int a,b,ans;

	scanf ("%d %d", &a, &b);

	

	if (b%a==0)

	{

		ans= a+b;

	}

	else

	{

		ans= b-a;

	}

	printf("%d", ans);

	

	



return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.216534252108282x):
#include <stdio.h>



int main()

{

	int a,b,ans;

	scanf ("%d %d", &a, &b);

	

	if (b%a==0)

	{

		ans= a+b;

	}

	else

	{

		ans= b-a;

	}

	printf("%d", ans);

	

	



return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.216327689221654x):
#include <stdio.h>



int main()

{

	int a,b,ans;

	scanf ("%d %d", &a, &b);

	

	if (b%a==0)

	{

		ans= a+b;

	}

	else

	{

		ans= b-a;

	}

	printf("%d", ans);

	

	



return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.219659624939668x):
#include<stdio.h>

#include<string.h>

int main(){

    

    int A, B;

    scanf("%d%d", &A, &B);

    

    if(B%A == 0){

    	printf("%d", B+A);

	} else {

		printf("%d", B-A);

	}

    

    return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.2198663197685935x):
#include<stdio.h>

#include<string.h>

int main(){

    

    int A, B;

    scanf("%d%d", &A, &B);

    

    if(B%A == 0){

    	printf("%d", B+A);

	} else {

		printf("%d", B-A);

	}

    

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.219659624939668x):
#include<stdio.h>

#include<string.h>

int main(){

    

    int A, B;

    scanf("%d%d", &A, &B);

    

    if(B%A == 0){

    	printf("%d", B+A);

	} else {

		printf("%d", B-A);

	}

    

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>



int main() {

    int a, b;

    scanf("%d %d", &a, &b);



    if (b % a == 0) {

        printf("%d", a + b);

    } else {

        printf("%d", b - a);

    }



    return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.218904029796207x):
#include <stdio.h>



int main() {

    int a, b;

    scanf("%d %d", &a, &b);



    if (b % a == 0) {

        printf("%d", a + b);

    } else {

        printf("%d", b - a);

    }



    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>



int main() {

    int a, b;

    scanf("%d %d", &a, &b);



    if (b % a == 0) {

        printf("%d", a + b);

    } else {

        printf("%d", b - a);

    }



    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>





int main()

{



int a, b;



scanf("%d %d", &a, &b);

		

		

		if(b%a==0){

			printf("%d", a+b);

		}

		else {

			printf("%d", b-a);

		}









return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.218904029796207x):
#include <stdio.h>





int main()

{



int a, b;



scanf("%d %d", &a, &b);

		

		

		if(b%a==0){

			printf("%d", a+b);

		}

		else {

			printf("%d", b-a);

		}









return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>





int main()

{



int a, b;



scanf("%d %d", &a, &b);

		

		

		if(b%a==0){

			printf("%d", a+b);

		}

		else {

			printf("%d", b-a);

		}









return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.212383757163462x):
#include <stdio.h>



int main() {

	int a,b;

	scanf ("%d %d", &a, &b);

	

	if ( b % a == 0) {

		printf ("%d\n", a + b);

	}

	else {

		printf ("%d\n", b - a);

	}

	return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.21259016387317x):
#include <stdio.h>



int main() {

	int a,b;

	scanf ("%d %d", &a, &b);

	

	if ( b % a == 0) {

		printf ("%d\n", a + b);

	}

	else {

		printf ("%d\n", b - a);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.212383757163462x):
#include <stdio.h>



int main() {

	int a,b;

	scanf ("%d %d", &a, &b);

	

	if ( b % a == 0) {

		printf ("%d\n", a + b);

	}

	else {

		printf ("%d\n", b - a);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>



int main(){

	int a, b;

	scanf("%d %d", &a, &b);

	

	if (b % a == 0){

		printf("%d", a + b);

	}

	else{

		printf("%d", b - a);

	}

	return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.218904029796207x):
#include <stdio.h>



int main(){

	int a, b;

	scanf("%d %d", &a, &b);

	

	if (b % a == 0){

		printf("%d", a + b);

	}

	else{

		printf("%d", b - a);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>



int main(){

	int a, b;

	scanf("%d %d", &a, &b);

	

	if (b % a == 0){

		printf("%d", a + b);

	}

	else{

		printf("%d", b - a);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>



int main() {

	int A, B;

	scanf("%d %d", &A, &B);

	

	

	if(B%A == 0)

		printf("%d", A + B);

	else

		printf("%d", B - A);

		

	return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.218904029796207x):
#include <stdio.h>



int main() {

	int A, B;

	scanf("%d %d", &A, &B);

	

	

	if(B%A == 0)

		printf("%d", A + B);

	else

		printf("%d", B - A);

		

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>



int main() {

	int A, B;

	scanf("%d %d", &A, &B);

	

	

	if(B%A == 0)

		printf("%d", A + B);

	else

		printf("%d", B - A);

		

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.212383757163462x):
#include <stdio.h>

int main (){

int x,y;

scanf("%d %d",&x ,&y);



if(y%x==0){

	printf("%d\n",x+y);

	

}	else{

	printf("%d\n",y-x);

}

	

	

	return 0;

	

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.21259016387317x):
#include <stdio.h>

int main (){

int x,y;

scanf("%d %d",&x ,&y);



if(y%x==0){

	printf("%d\n",x+y);

	

}	else{

	printf("%d\n",y-x);

}

	

	

	return 0;

	

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.212383757163462x):
#include <stdio.h>

int main (){

int x,y;

scanf("%d %d",&x ,&y);



if(y%x==0){

	printf("%d\n",x+y);

	

}	else{

	printf("%d\n",y-x);

}

	

	

	return 0;

	

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main(){

 int a,b;

 cin>>a>>b;

 if(b%a==0){

    cout<<a+b;

 }

 else{

    cout<<b-a;

 }

 return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>

int main() {

	int a,b;

	scanf("%d %d",&a,&b);

	if (b % a == 0)

	{

		printf("%d",a+b);

	}

	else

	{

		printf("%d",b-a);

	}

	return 0;

}
// Slower C++ solution:
//Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>

using namespace std;



int main(){







                    int n,m;

                    cin>>n>>m;

                    if(m%n==0){

                        cout<<n+m;

                    }

                    else{

                        cout<<m-n;

                    }





}

//Pavel


// Faster C++ solution for the same problem (measured speedup: 5.218904029796207x):
#include <stdio.h>

int main() {

	int a,b;

	scanf("%d %d",&a,&b);

	if (b % a == 0)

	{

		printf("%d",a+b);

	}

	else

	{

		printf("%d",b-a);

	}

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int a, b;

    cin >> a >> b;

    if(b % a == 0){

        cout << a + b;

    }

    else{

        cout << b - a;

    }





}


// Faster C++ solution for the same problem (measured speedup: 5.218697373071774x):
#include <stdio.h>

int main() {

	int a,b;

	scanf("%d %d",&a,&b);

	if (b % a == 0)

	{

		printf("%d",a+b);

	}

	else

	{

		printf("%d",b-a);

	}

	return 0;

}
// Slower C++ solution:
/// --- In the name of ALLAH --- ///





#include <cmath>

#include<bits/stdc++.h>

using namespace std;





typedef long long              ll;

typedef vector<int>            vi;

typedef vector<ll>             vl;

typedef vector<vi>             vvi;

typedef vector<vl>             vvl;

typedef pair<int,int>          pii;

typedef pair<double, double>   pdd;

typedef pair<ll, ll>           pll;

typedef vector<pii>            vii;

typedef vector<pll>            vll;

typedef double                 dl;



#define endl                   '\n'

#define PB                     push_back

#define F                      first

#define S                      second

#define all(a)                 (a).begin(),(a).end()

#define rall(a)                (a).rbegin(),(a).rend()

#define sz(x)                  (ll)x.size()

#define wt                     ll t; cin>>t; while(t--)

#define input(a,n)             for(int i=0;i<n;i++) cin>>a[i];



const double PI = acos(-1);

const double eps = 1e-9;

const int inf = 2000000000;

const ll infLL = 9000000000000000000;





#define mem(a,b) memset(a, b, sizeof(a) )

#define sqr(a) ((a) * (a))

#define mod 10000007

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);



#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {            cerr << endl;}

template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}



ll gcd ( ll a, ll b ) { return __gcd ( a, b ); }

ll lcm ( ll a, ll b ) { return a * ( b / gcd ( a, b ) ); }





const ll mx=1e9;



















int main()

{

    optimize();



   int n,m,i,j,p=0;

   cin>>n>>m;

   if(m%n==0)

   cout<<m+n<<endl;

   else

    cout<<m-n<<endl;









    return 0;

}
















































































// Faster C++ solution for the same problem (measured speedup: 5.335777923336718x):
#include<stdio.h>



int main()

{

	int a, b;

	scanf("%d %d", &a, &b);

	

	if (b % a == 0)

	{

		printf("%d", a + b);

	}

	

	else

	{

		printf("%d", b - a);

	}

	

	return 0;

}
// Slower C++ solution:
/// --- In the name of ALLAH --- ///





#include <cmath>

#include<bits/stdc++.h>

using namespace std;





typedef long long              ll;

typedef vector<int>            vi;

typedef vector<ll>             vl;

typedef vector<vi>             vvi;

typedef vector<vl>             vvl;

typedef pair<int,int>          pii;

typedef pair<double, double>   pdd;

typedef pair<ll, ll>           pll;

typedef vector<pii>            vii;

typedef vector<pll>            vll;

typedef double                 dl;



#define endl                   '\n'

#define PB                     push_back

#define F                      first

#define S                      second

#define all(a)                 (a).begin(),(a).end()

#define rall(a)                (a).rbegin(),(a).rend()

#define sz(x)                  (ll)x.size()

#define wt                     ll t; cin>>t; while(t--)

#define input(a,n)             for(int i=0;i<n;i++) cin>>a[i];



const double PI = acos(-1);

const double eps = 1e-9;

const int inf = 2000000000;

const ll infLL = 9000000000000000000;





#define mem(a,b) memset(a, b, sizeof(a) )

#define sqr(a) ((a) * (a))

#define mod 10000007

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);



#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {            cerr << endl;}

template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}



ll gcd ( ll a, ll b ) { return __gcd ( a, b ); }

ll lcm ( ll a, ll b ) { return a * ( b / gcd ( a, b ) ); }





const ll mx=1e9;



















int main()

{

    optimize();



   int n,m,i,j,p=0;

   cin>>n>>m;

   if(m%n==0)

   cout<<m+n<<endl;

   else

    cout<<m-n<<endl;









    return 0;

}
















































































// Faster C++ solution for the same problem (measured speedup: 5.3354584746382x):
#include <stdio.h>

int main(){

int a,b;

scanf("%d %d",&a,&b);

if(b%a!=0){

	printf("%d",b-a);

}

else{

	printf("%d",b+a);

}

return 0;

}