text: #include<iostream>
  #include<algorithm>
  #include<vector>
  #include<cmath>
  #include<string>
  #include<stack>
  #include<map>
  #include<stdlib.h>
  #include<stdio.h>
  #include<cmath>
  #include<time.h>
  using namespace std;
  
  void init(){
  	
  }
  void solve(){
  	int a,b;
  	cin>>a>>b;
  	if(b>a||(b+a)%2!=0)cout<<-1;
  	else cout<<a/2+b/2+b%2<<" "<<a-a/2-b/2-b%2;
  }
  
  int main(){
  	int t;
  
  	t=1;
  //	cin>>t;
  //	for(int i=0;i<t;i++){
  //		cout<<"Case #"<<i+1<<"\n";
  		solve();
  		//cout<<"\n";
  //	}
  }
   
   
   
  