// Arup Guha
// 6/1/2013
// Solution to 2013 KTH Challenge Problem C: Vacuum Tubes

import java.util.*;

public class vacuum {

	public static void main(String[] args) {

		// Get input.
		Scanner stdin = new Scanner(System.in);
		int s1 = stdin.nextInt();
		int s2 = stdin.nextInt();
		int n = stdin.nextInt();
		int[] vals = new int[n];
		for (int i=0; i<n; i++)
			vals[i] = stdin.nextInt();

		// Create pair list.
		pair[] list = new pair[n*(n-1)/2];
		int idx = 0;
		for (int i=0; i<n; i++)
			for (int j=i+1; j<n; j++)
				list[idx++] = new pair(vals[i]+vals[j],i,j);

		// Sort it.
		Arrays.sort(list);

		// Solve it.
		int res = solve(list, Math.min(s1,s2), Math.max(s1,s2));

		// Output.
		if (res > 0)
			System.out.println(res);
		else
			System.out.println("Impossible");
	}

	public static int solve(pair[] list, int s1, int s2) {

		int n = list.length;

		// Find first value <= s2.
		int j = n-1;
		while (j >= 0 && list[j].sum > s2) j--;

		// Find first value <= s1 and < j.
		int i = j-1;
		while (i >= 0 && list[i].sum > s1) i--;

		// Impossible.
		if (i < 0) return -1;

		int res = 0;

		// x represents pair that matches s2.
		for (int x=j; x>0; x--) {

			int no1 = list[x].i;
			int no2 = list[x].j;

			// Just trying to save some time.
			if (2*list[x].sum <= res) break;

			// y represents pair that matches s1.
			for (int y=Math.min(i,x-1); y>=0; y--) {

				// No point in looking because we have something better.
				if (list[x].sum+list[y].sum <= res) break;

				// A match.
				if (no1 != list[y].i && no1 != list[y].j && no2 != list[y].i && no2 != list[y].j) {
					res = Math.max(res, list[x].sum+list[y].sum);
					break;
				}
			}
		}

		return res;
	}
}

class pair implements Comparable<pair> {

	public int sum;
	public int i;
	public int j;

	public pair(int s, int myi, int myj) {
		sum = s;
		i = myi;
		j = myj;
	}

	public int compareTo(pair other) {
		return this.sum - other.sum;
	}
}