#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define MAX 10000005
#define pf printf
#define sf scanf
typedef long long ll;
int main()
{
int L, H, sum=0;
sf("%d%d", &H, &L);
sum = (L+H-1);
pf("%d %d\n", (sum-H), (sum-L) );
}
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define MAX 10000005
#define pf printf
#define sf scanf
typedef long long ll;
int main()
{
int L, H, sum=0;
sf("%d%d", &H, &L);
sum = (L+H-1);
pf("%d %d\n", (sum-H), (sum-L) );
}