// Arup Guha
// 2/18/2024
// Solution to Kattis Problem: Math Homework
// https://open.kattis.com/problems/mathhomework

import java.util.*;

public class mathhomework {

	public static void main(String[] args) {
	
		// Read in data.
		Scanner stdin = new Scanner(System.in);
		int a = stdin.nextInt();
		int b = stdin.nextInt();
		int c = stdin.nextInt();
		int tot = stdin.nextInt();
		boolean printed = false;
		
		// Brute force all solutions for number of animals.
		for (int i=0; i<=tot; i++)
			for (int j=0; j<=tot; j++)
				for (int k=0; k<=tot; k++)
					if (a*i+b*j+c*k == tot) {
						System.out.println((i)+" "+(j)+" "+(k));
						printed = true;
					}
				
		// Got to have this covered.
		if (!printed) System.out.println("impossible");
	}
}