#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n-1); i >= 0; i--)
using namespace std;
typedef long long ll;
const int MOD = 1000000007;
//const int MOD =  998244353;
 
const ll INF = 1LL<<60;
const int IINF = 1000000000;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main(){

    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int A, B; cin >> A >> B;
    int X = (A+B)/2;
    int Y = A - X;

    cout << X << " " << Y << endl;
}

/*
Author: Racer5x
 ***************************************   UNAUTHORISED COPYING OF CODE PROHIBITED   **********************************
*/
 
// #pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 

#include <vector>
#include <iostream>
#include <queue>
#include <map>
#include <algorithm>
#include <functional>

#define int         long long
#define double      long double
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define endl        '\n'
#define hell        998244353 
#define PI          3.141592653589
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MAX         2000000000000000000
#define M           1000000007
using namespace std;

int dp[1 << 20];
 
signed main()
{
    tezz

    vector<int> primes;
    for(int i=2; i<72; i++){
        bool flag = true;
        for(int j=2; j<i; j++){
            if(i % j == 0) flag = false;
        }

        if(flag) primes.emplace_back(i);
    }

    int A, B;
    cin>>A>>B;

    //now convert every number into masks.. with respect to prime divisors

    vector<int> v(B - A + 1);

    for(int i=A; i<=B; i++){
        int mask = 0;
        
        for(int j=0; j<20; j++){
            if(i % primes[j] == 0){
                mask |= (1 << j);
            }
        }

        v[i - A] = mask;
    }

    //now using dp to form every possible states
    dp[0] = 1;

    for(int x: v){
        for(int mask=0; mask<(1 << 20); mask++){
            if(dp[mask]){
                int temp = mask & x;
                if(temp == 0) dp[mask | x] += dp[mask];
            }
        }
    }

    int ans = 0;
    for(int i=0; i<(1 << 20); i++) ans += dp[i];

    cout<<ans;
}