#include <bits/stdc++.h>
using namespace std;
int main() {
  long p, q, r, s;
  cin >> p >> q >> r >> s;
  long sum = max(p, max(q, max(r, s)));
  if (p == sum) {
    p = q;
    q = r;
    r = s;
  } else if (q == sum) {
    q = r;
    r = s;
  } else if (r == sum) {
    r = s;
  }
  cout << p + q - sum << " " << q + r - sum << " " << p + r - sum << endl;
  return 0;
}
