// Arup Guha
// 10/11/2021
// Solution to 2021 UCF Locals Problem Soccer Standing Table: soccer

import java.util.*;

public class soccer {

	public static int[] input;
	
	public static void main(String[] args) {
	
		// Get input.
		Scanner stdin = new Scanner(System.in);
		input = new int[5];
		for (int i=0; i<5; i++)
			input[i] = stdin.nextInt();
			
		// Solve recursively.
		go(new int[5], new boolean[5], 0);	
	}
	
	// Runs the problem...prints out the one unique value answer.
	public static boolean go(int[] perm, boolean[] used, int k) {
	
		// Finished a permutation. See if it works. If so, print.
		if (k == perm.length) {
			if (check(perm)) {
				print(perm);
				return true;
			}
			
			// Only get here if this one's not valid.
			return false;
		}
		
		// Try each item in slot k.
		for (int i=0; i<perm.length; i++) {
			
			// We've already tried item i.
			if (used[i]) continue;
			
			// Put i in slot k.
			perm[k] = i;
			used[i] = true;
			boolean tmp = go(perm, used, k+1);
			
			// We got it, so stop.
			if (tmp) return true;
			
			// Undo and continue trying stuff in slot k.
			used[i] = false;
		}
		
		// Never returned true, so this branch is false.
		return false;
	}
	
	// Returns true if this permutation is a valid score.
	public static boolean check(int[] perm) {
	
		// total games doesn't match.
		if (input[perm[0]] != input[perm[1]]+input[perm[2]]+input[perm[3]]) return false;
		
		// Score doesn't match.
		if (3*input[perm[1]] + input[perm[2]] != input[perm[4]]) return false;
		
		// If we get here, we are good.
		return true;
	}
	
	// Just prints the permutation.
	public static void print(int[] perm) {
		for (int i=0; i<perm.length-1; i++)
			System.out.print(input[perm[i]]+" ");
		System.out.println(input[perm[perm.length-1]]);
	}
}