import java.io.*;
import java.math.*;
import java.util.*;

public class bender_mm {
	
	int n, k, l, r;
	
	int go(int a, int b, int c) {
		int cur = c % k;
		int ball = r;
		for (int i = 0; i < n; i++) {
			int next = (cur + 1) % k;
			if (cur == ball)
				ball = next;
			else if (next == ball)
				ball = cur;
			cur = (a * cur + b) % k;
		}
		return ball;
	}

	void solve() {
		n = nextInt();
		k = nextInt();
		r = nextInt() - 1;
		l = nextInt() - 1;
		for (int a = 0; a < k; a++)
			for (int b = 0; b < k; b++)
				for (int c = 0; c < k; c++) {
					if (go(a, b, c) == l) {
						out.print(a + " " + b + " " + c);
						return;
					}
				}
		out.print("Impossible");
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof;
	final Random rand = new Random(this.hashCode());

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	BigInteger nextBigInteger() {
		return new BigInteger(nextToken());
	}

	bender_mm() {
		try {
			br = new BufferedReader(new FileReader("bender.in"));
			out = new PrintWriter("bender.out");
			solve();
			br.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "-1";
			}
		}
		return st.nextToken();
	}

	public static void main(String[] args) {
		new bender_mm();
	}
}
