text: #define BZ
  #include <bits/stdc++.h>
  #include <ext/pb_ds/assoc_container.hpp>
  #include <ext/pb_ds/detail/standard_policies.hpp>
  using ll = int64_t;
  using ld = long double;
  using ull = uint64_t;
  using namespace std;
  using namespace __gnu_pbds;
  typedef vector <int> vi;
  typedef pair <int, int> ii;
  
  const int INF = 1 << 30;
  
  #define maxn 100010
  
  ll n, l, u;
  
  int main() {
  #ifdef BZ
      freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout);
  #endif
      ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cout.setf(ios::fixed); cout.precision(20);
  
      while(cin >> n >> l >> u) {
          ll ans = 0;
          for(int i = 32; i >= 0; i--) {
              if((ans | (1LL << i)) <= l) ans |= (1LL << i);
              if(!(n & (1LL << i)) && (ans | (1LL << i)) <= u) ans |= (1LL << i);
          }
          cout << ans << "\n";
      }
  
  }