#include <bits/stdc++.h>
using namespace std;
int max(int a, int b, int c, int d) {
  if (a >= b && a >= c && a >= d) return a;
  if (b >= a && b >= c && b >= d) return b;
  if (c >= a && c >= b && c >= d) return c;
  if (d >= a && d >= c && d >= b) return d;
  return d;
}
int main() {
  int x1, x2, x3, x4;
  cin >> x1 >> x2 >> x3 >> x4;
  int mx = max(x1, x2, x3, x4);
  if (mx == x1) {
    cout << mx - x2 << " " << mx - x3 << " " << mx - x4;
  } else {
    if (mx == x2) {
      cout << mx - x1 << " " << mx - x3 << " " << mx - x4;
    } else {
      if (mx == x3) {
        cout << mx - x2 << " " << mx - x1 << " " << mx - x4;
      } else {
        if (mx == x4) {
          cout << mx - x2 << " " << mx - x3 << " " << mx - x1;
        }
      }
    }
  }
}
