#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[4];
  cin >> a[0] >> a[1] >> a[2] >> a[3];
  if (a[0] > a[1] && a[0] > a[2] && a[0] > a[3])
    cout << a[0] - a[1] << " " << a[0] - a[2] << " " << a[0] - a[3];
  else if (a[1] > a[0] && a[1] > a[2] && a[1] > a[3])
    cout << a[1] - a[0] << " " << a[1] - a[2] << " " << a[1] - a[3];
  else if (a[2] > a[0] && a[2] - a[1] && a[2] > a[3])
    cout << a[2] - a[0] << " " << a[2] - a[1] << " " << a[2] - a[3];
  else
    cout << a[3] - a[0] << " " << a[3] - a[1] << " " << a[3] - a[2];
  return 0;
}
