#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

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

const ll mod=1000000007;

const string yesno(bool ans){
  return (ans?"Yes":"No");
}

int main() {
  int a,b;cin>>a>>b;
  int x,y;
  x=(a+b)/2;
  y=(a-b)/2;
  cout<<x<<" "<<y<<endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define pb push_back
 
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(NULL); cout.tie(NULL);
 
    int a, b, suma = 0, sumb = 0;
    cin >> a >> b;
 
    while(a){
        suma += a % 10;
        a /= 10;
    }
 
    while(b){
        sumb += b % 10;
        b /= 10;
    }
 
    cout << max(suma, sumb);
 
    return 0;
}