//---------------------------------------------------------------
#include <bits/stdc++.h>
using namespace std;
#include <cstdlib>
#include <cmath>
#include <math.h>
#include <sstream>
#include <numeric>
#include <cassert>
//---------------------------------------------------------------
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rrep(i, n) for (long long i = 1; i <= (long long)(n); i++)
#define srep(i, s, n) for (long long i = (s); i <= (long long)(n); i++)
#define drep(i,n) for(long long i = (n)-1; i >= 0; --i)
#define SIZE 100005
#define INF 1e18
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define vec vector
using pint = pair<int,int>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
//---------------------------------------------------------------
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
//---------------------------------------------------------------

//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓


int main() {
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

    ll a,b,c;
    cin>>a>>b>>c;

    bool ok = 0;
    if(a+b == 2*c) ok = 1;
    if(a+c == 2*b) ok = 1;
    if(c+b == 2*a) ok = 1;

    if(ok){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }

    return 0;
}
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

const int INF = (int) 1e9 + 7;
int d[200 + 7][200 + 7];

int a(int x) {
  return x;
}

int b(int x) {
  return 100 + x;
}

signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);


  for (int i = 1; i <= 200; i++) {
    for (int j = 1; j <= 200; j++) {
      d[i][j] = INF;
    }
    d[i][i] = 0;
  }
  int x, y, c1, c2;
  cin >> x >> y >> c1 >> c2;
  for (int i = 1; i < 100; i++) {
    d[i][i + 1] = d[i + 1][i] = c2;
    d[b(i)][b(i + 1)] = d[b(i + 1)][b(i)] = c2;

    d[a(i + 1)][b(i)] = d[b(i)][a(i + 1)] = c1;
  }
  for (int i = 1; i <= 100; i++) {
    d[a(i)][b(i)] = d[b(i)][a(i)] = c1;
  }
  for (int k = 1; k <= 200; k++) {
    for (int i = 1; i <= 200; i++) {
      for (int j = 1; j <= 200; j++) {
        d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
      }
    }
  }
  cout << d[a(x)][b(y)] << "\n";

}
