Andrey received a postcard from Irina. It contained only the words "Hello, Andrey!", and a strange string consisting of lowercase Latin letters, snowflakes and candy canes. Andrey thought that this string is an encrypted message, and decided to decrypt it.

Andrey noticed that snowflakes and candy canes always stand after the letters, so he supposed that the message was encrypted as follows. Candy cane means that the letter before it can be removed, or can be left. A snowflake means that the letter before it can be removed, left, or repeated several times.

For example, consider the following string: 

<image>

This string can encode the message «happynewyear». For this, candy canes and snowflakes should be used as follows: 

  * candy cane 1: remove the letter w, 
  * snowflake 1: repeat the letter p twice, 
  * candy cane 2: leave the letter n, 
  * snowflake 2: remove the letter w, 
  * snowflake 3: leave the letter e. 

<image>

Please note that the same string can encode different messages. For example, the string above can encode «hayewyar», «happpppynewwwwwyear», and other messages.

Andrey knows that messages from Irina usually have a length of k letters. Help him to find out if a given string can encode a message of k letters, and if so, give an example of such a message.

Input

The first line contains the string received in the postcard. The string consists only of lowercase Latin letters, as well as the characters «*» and «?», meaning snowflake and candy cone, respectively. These characters can only appear immediately after the letter. The length of the string does not exceed 200.

The second line contains an integer number k (1 ≤ k ≤ 200), the required message length.

Output

Print any message of length k that the given string can encode, or «Impossible» if such a message does not exist.

Examples

Input


hw?ap*yn?eww*ye*ar
12


Output


happynewyear


Input


ab?a
2


Output


aa

Input


ab?a
3


Output


aba

Input


ababb
5


Output


ababb

Input


ab?a
1


Output


Impossible

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;

import javax.swing.text.InternationalFormatter;

import java.math.*;

import org.omg.CORBA.Any;

public class template {

	static long time = 0, mp = Integer.MAX_VALUE, k = 0, cnt = 0, edge = 0, no = 0;

	static int[] bp;
	static int[] low;
	static int[] des;
	static boolean bipar = true;
	static HashSet<Integer>[] a;
	static String sb = "";
	static ArrayList<Integer>[] p;

	public static void main(String[] args) throws IOException {
		Scanner scn = new Scanner(System.in);

		StringBuilder sb = new StringBuilder(scn.next());
		int k = scn.nextInt();
		String st = "";
		int q = 0, s = 0, w = 0;

		for (int i = 0; i < sb.length(); i++) {
			if (sb.charAt(i) == '?')
				q++;
			else if (sb.charAt(i) == '*')
				s++;
			else {
				w++;
				st += sb.charAt(i);
			}

		}

		if (k > w && s == 0)
			System.out.println("Impossible");

		else if (k < w && s + q < w - k)
			System.out.println("Impossible");

		else {
			if (w == k) {
				System.out.println(st);
			}

			else if (k > w) {
				int ew = k - w, x = 0;
				

				String p = "";

				for (int i = 0; i < sb.length(); i++) {

					if (sb.charAt(i) == '?')
						continue;

					else if (sb.charAt(i) == '*') {
						
						if( x == 0){
						x = 1;
						for (int j = 0; j < ew; j++)
							p += sb.charAt(i -1);
						}
					} 
					
					else
						p += sb.charAt(i);
				}
				
				System.out.println(p);
			}
			
			else{
				 int dw=w-k;
				 String ans="";
				 
				 for(int i=0 ;i<sb.length(); ){
					 
					   if((sb.charAt(i)=='*' || sb.charAt(i) == '?')&& dw>0){
						   sb.deleteCharAt(i-1);
						   sb.deleteCharAt(i-1);
						   dw--;
					   }
					   
					   else if(sb.charAt(i)=='*'){
						   sb.deleteCharAt(i);
					   }
					   else  if(sb.charAt(i)=='?'){
						   sb.deleteCharAt(i);
					   }
					   else i++;
					   
					   
				 }
				 
				 System.out.println(sb);
				 
			}
		}

	}

	// _________________________TEMPLATE_____________________________________________________________

	static class pair implements Comparable<pair> {
		int v = 0;
		int cnt = 0;
		// int cnt;

		pair(int b, int a) {
			v = b;
			cnt = a;
			// cnt = x;
		}

		@Override
		public int compareTo(pair o) {

			// return -this.sum + o.sum;

			return 1;
		}
	}

	// -----------PrintWriter for faster output---------------------------------
	public static PrintWriter out;

	public static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[100000 + 1]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		public int[][] nextInt2DArray(int m, int n) throws IOException {
			int[][] arr = new int[m][n];
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < n; j++)
					arr[i][j] = nextInt();
			}
			return arr;
		}

	}

	// private static void rem(HashMap<Integer, Integer> hm) {
	//
	// Iterator<Map.Entry<Integer, Integer>> itr = hm.entrySet().iterator();
	// ArrayList<Integer> p=new ArrayList<>();
	//
	//
	// while(itr.hasNext()){
	// Map.Entry<Integer, Integer> entry = itr.next();
	// p.add(entry.getKey());
	//
	// }
	//
	//
	// for(int i:p){
	//
	// if(hm.get(i)>1)
	// hm.put(i, hm.get(i)-1);
	// else
	// hm.remove(i);
	// }
	// }

}
