/**
 *    author:  longvu
 *    created: 06/24/21 10:08:58
**/
#include<bits/stdc++.h>

using namespace std;

#define int long long
#define sz(x) ((int)x.size())
#define all(x) (x).begin(), (x).end()

const int INF = numeric_limits<int>::max();
const int nax = (int)(1000001);
const int mod = 1e9 + 7;

int dp[nax];
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int l, r;
    cin >> l >> r;
    for (int i = r; i >= 2; --i) {
        dp[i] = (r / i - (l - 1) / i) * (r / i - (l - 1) / i);
        for (int j = 2 * i; j <= r; j += i) {
            dp[i] -= dp[j];
        }
    }
    int ans = 0;
    for (int i = 2; i <= r; ++i) {
        if (i >= l) {
            dp[i] -= 2 * (r / i) - 1;
        }
        ans += dp[i];
    }
    cout << ans;
    return 0;
}
// Date: 2020-10-03

#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
typedef long double LD;
typedef vector<int> VI;
typedef pair<LL, LL> pll;
typedef pair<int, int> pii;
#define IO freopen("in.txt", "r", stdin);freopen("out.txt", "w", stdout)
#define FIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define rep(i, a, b) for(int i = int(a); i <= int(b); ++i)
#define per(i, b, a) for(int i = int(b); i >= int(a); --i)
#define D(x) cout << #x << " = " << x << endl;
#define mem(x, y) memset(x, y, sizeof(x))
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)x.size())
#define mk make_pair
#define pb push_back
#define fi first
#define se second
const LL INF = 1e18;
const LL mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const int N = 2e5 + 10;
template <typename T> void chkmax(T &x, T y) { x = max(x, y); }
template <typename T> void chkmin(T &x, T y) { x = min(x, y); }
LL qpow(LL x, LL y, LL MOD) {LL a=1; while(y){ if(y&1) a=a*x%MOD; x=x*x%MOD; y>>=1; } return a;}

int main() {
    int a, b;
    cin >> a >> b;
    cout << (a+b)/2 << " " << (a-b)/2;

    return 0;
}