#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int b;
  cin >> b;
  int c;
  cin >> c;
  int d;
  cin >> d;
  int megoldas_a;
  int megoldas_b;
  int megoldas_c;
  int largest = 0;
  if (a > largest) {
    largest = a;
  }
  if (b > largest) {
    largest = b;
  }
  if (c > largest) {
    largest = c;
  }
  if (d > largest) {
    largest = d;
  }
  if (a == largest) {
    megoldas_a = largest - b;
    megoldas_b = largest - c;
    megoldas_c = largest - d;
    cout << megoldas_a << "\n" << megoldas_b << "\n" << megoldas_c;
    return 0;
  }
  if (b == largest) {
    megoldas_a = largest - a;
    megoldas_b = largest - c;
    megoldas_c = largest - d;
    cout << megoldas_a << "\n" << megoldas_b << "\n" << megoldas_c;
    return 0;
  }
  if (c == largest) {
    megoldas_a = largest - b;
    megoldas_b = largest - a;
    megoldas_c = largest - d;
    cout << megoldas_a << "\n" << megoldas_b << "\n" << megoldas_c;
    return 0;
  }
  if (d == largest) {
    megoldas_a = largest - b;
    megoldas_b = largest - c;
    megoldas_c = largest - a;
    cout << megoldas_a << "\n" << megoldas_b << "\n" << megoldas_c;
    return 0;
  }
}
