import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int aNum = scanner.nextInt(); int aPrice = scanner.nextInt(); int bNum = scanner.nextInt(); int bPrice = scanner.nextInt(); int x = 0, y = 0, totalPrice = 0; for (int i = 0; i * aNum <= 500; i++) { if ((500 - i * aNum) % bNum == 0){ int total = i * aPrice + (500 - i * aNum) / bNum * bPrice; int newTotal = total - total / 200 * 50; if (totalPrice == 0){ totalPrice = newTotal; x = i; y = (500 - i * aNum) / bNum; }else if (newTotal < totalPrice){ totalPrice = newTotal; x = i; y = (500 - i * aNum) / bNum; } } } if (x == 0 && y == 0){ System.out.println(-1); }else System.out.println(x + " " + y); } }