#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define repx(i, x, n) for (ll i = (ll)(x); i < (ll)(n); i++)

const double PI = 3.1415926535897932;


#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using P = pair<int,int>;
int main(){

 int a,b;
 cin >> a >> b ;
 if(a+b >=15 && b >= 8){
     
     cout << '1'  << endl;
     
 }else if (a+b>=10 && b>=3) {
cout << '2' << endl;
 }else if(a+b>=3) {
     cout << '3' << endl;
 }else {
     cout << '4' << endl;
 } 
 
  
return 0;
}
/*
	Auth: Loxilante
	Time: 2020/10/03
	Prog: ARC104-A
	Lang: cpp
*/
#include <bits/extc++.h>
#define rep(i, l, r) for(int i = l; i < r; i++)
#define hrp(i, l, r) for(int i = l; i <= r; i++)
#define rev(i, r, l) for(int i = r; i >= l; i--)
#define ms(n, t) memset(n, t, sizeof(n))
#define pb push_back
#define int ll
#ifndef JOEON
#define D(...) 97
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
template<typename tn = int> inline tn next(void) { tn k; cin>>k; return k; }
signed main(void)
{
	clock_t Begin = clock();

	#ifdef JOEON
//		freopen("C:\\Users\\Joeon\\Desktop\\IN.txt", "r", stdin);
//		freopen("C:\\Users\\Joeon\\Desktop\\OUT.txt", "w", stdout);
	#endif
	
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int a, b;
	cin>>a>>b;
	cout<<(a+b)/2<<' '<<(a-b)/2<<endl;
	
	clock_t InputFinished = clock();
	
	
	
	clock_t End = clock();
	
	D((double)(End-Begin)/CLOCKS_PER_SEC);
	D((double)(End-InputFinished)/CLOCKS_PER_SEC);

#ifdef JOEON
	system("pause");
#endif
	return 0;
}
/*

 */