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.util.*;



import java.io.*;

public class Main{

    public static void main(String[] args) {

        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader inp = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Solver solver = new Solver();
        solver.solve(inp, out);
        out.close();
        
          }



    static class Solver {


        class Node implements Comparable<Node>{
            int i;
            long c;
          
            Node(int i,long c)
            {
                this.i=i;
                this.c=c;
                

            }

           public int compareTo(Node n)
            {
                return Long.compare(this.c, n.c);
            }
        }

        public boolean done(int[] sp,int[] par)
        {
            int root;

            root=findSet(sp[0],par);
            
           for(int i=1;i<sp.length;i++)
           {
                if(root!=findSet(sp[i], par))
                    return false;
           }
           return true;
        }
       public int findSet(int i,int[] par)
       {
           int x =i;
            boolean flag =false;
            while(par[i]>=0)
            {
                flag = true;
                i=par[i];
            }
            if(flag)
                par[x]=i;
            return i;
       }

       public void unionSet(int i,int j,int[] par)
       {
            int x = findSet(i, par);
            int y = findSet(j, par);
            if(x<y)
            {
                par[y]=x;
            }
            else
            {
                par[x]=y;
            }
       }

       public  long pow(long a, long b, long MOD) {
            if (b == 0) {
                return 1;
            }
            if (b == 1) {
                return a;
            }
            long val = pow(a, b / 2, MOD);
            if (b % 2 == 0) {
                return val * val % MOD;
            } else {
                return val * (val * a % MOD) % MOD;

            }
           
        }


        public void minPrimeFactor(int n,int[] s)
        {
            boolean prime[] = new boolean[n+1];
            Arrays.fill(prime, true);
            s[1]=1;
            s[2]=2;
            for(int i=4;i<=n;i+=2)
            {
                prime[i]=false;
                s[i]=2;
            }

            for(int i=3;i<=n;i+=2)
            {
                if(prime[i])
                {
                    s[i]=i;
                    for(int j=2*i;j<=n;j+=i)
                    {
                        prime[j]=false;
                        s[j]=i;
                    }
                }
            }
            
        }

        
        // public void findAllPrime(int n,ArrayList<Node> al,int s[])
        // {
        //     int curr = s[n];
        //     int cnt = 1;
        //     while(n>1)
        //     {
        //         n/=s[n];
        //         if(curr==s[n])
        //         {
        //             cnt++;
        //             continue;

        //         }
        //         Node n1 = new Node(curr,cnt);
        //         al.add(n1);

        //         curr=s[n];
        //         cnt=1;
        //     }
        // }

        

        public int binarySearch(int n,int k)
        {
            int left=1;
            int right=100000000+5;
            int ans=0;
            while(left<=right)
            {
                int mid = (left+right)/2;
                if(n/mid>=k)
                {
                    left = mid+1;
                    ans=mid;
                }
                else
                {
                    right=mid-1;
                }
            }

            return ans;
        }
        public boolean checkPallindrom(String s)
        {
            char ch[] = s.toCharArray();

            for(int i=0;i<s.length()/2;i++)
            {
                if(ch[i]!=ch[s.length()-1-i])
                    return false;
            }
            return true;
        }


        public void dfs_util(ArrayList<Integer>[] al,boolean vis[],int x,int cnt[],int sts[],int fts[],ArrayList<Integer> fi)
        {
               vis[x] = true;
               fi.add(x);
                sts[cnt[0]]=x+1;
                boolean flag = false;
                for(int i=0;i<al[x].size();i++)
                {
                    if(!vis[al[x].get(i)])
                    {   flag =true;
                        cnt[0]++;
                        dfs_util(al, vis, al[x].get(i),cnt,sts,fts,fi);
                    }    
                    
                }
            
            cnt[0]++;
            fts[cnt[0]]=x+1;
            return;
        }

        public void dfs(ArrayList[] al,int sts[],int fts[],ArrayList<Integer> fi)
        {
            int count[]=new int[1];
            count[0]=0;
           boolean vis[] = new boolean[al.length];
           for(int i=0;i<al.length;i++)
           {
                if(!vis[i])
                {
                    count[0]++;
                    dfs_util(al,vis,i,count,sts,fts,fi);
                }
           }
        }
   
        public void remove(ArrayList<Integer>[] al,int x)
        {
            for(int i=0;i<al.length;i++)
            {
                for(int j=0;j<al[i].size();j++)
                {

                    if(al[i].get(j)==x)
                        al[i].remove(j);

                }
            }
        }

        public int gcd(int a, int b) 
        { 
            if (a == 0) 
                return b; 
            return gcd(b % a, a); 
        }


        public void printDivisors(long n,ArrayList<Long> al) 
        { 
            // Note that this loop runs till square root 
            for (long i=1; i<=Math.sqrt(n); i++) 
            { 
                if (n%i==0) 
                { 
                    // If divisors are equal, print only one 
                    if (n/i == i) 
                        al.add(i);
           
                    else // Otherwise print both 
                        al.add(i);
                        al.add(n/i);
                } 
            } 
        } 

        private void solve(InputReader inp, PrintWriter out1) {
             
                String s = inp.next();
                int k = inp.nextInt();
                ArrayList<Integer> al1 = new ArrayList<Integer>();
                ArrayList<Integer> al2 = new ArrayList<Integer>();

                char ch[] = s.toCharArray();
                int count=0;
                for(int i=0;i<ch.length;i++)
                {
                    if(ch[i]=='?')
                    {
                        al1.add(i);
                    }
                   else if(ch[i]=='*')
                    {
                        al2.add(i);
                        al1.add(i);
                    }
                    else
                    {
                        count++;
                    }
                }

                if(k<count)
                {
                    if(count-k>al1.size()&&count!=k)
                    {
                        out1.println("Impossible");
                        return;
                    }

                    StringBuilder  str = new StringBuilder();
                    int rm = count-k;
                    for(int i=0;i<ch.length-1;i++)
                    {
                        if(rm==0)
                        {
                            if(ch[i]!='?'&&ch[i]!='*')
                            {
                                str.append(ch[i]);
                            }
                        }
                        else
                        {
                            if(ch[i]!='?'&&ch[i]!='*')
                            {
                                if(ch[i+1]=='?'||ch[i+1]=='*')
                                {
                                    rm--;

                                }
                                else
                                {
                                    str.append(ch[i]);
                                }
                            }
                            
                        }
                    }
                    if(ch[ch.length-1]!='?'&&ch[ch.length-1]!='*')
                    {
                        str.append(ch[ch.length-1]);
                    }

                    out1.println(str.toString());
                    


                }

                else
                {
                    if(al2.size()==0&&count!=k)
                    {
                        out1.println("Impossible");
                        return;
                    }
                    StringBuilder  str = new StringBuilder();
                    int rm = k-count;
                    for(int i=0;i<ch.length-1;i++)
                    {
                        if(rm<=0)
                        {
                            if(ch[i]!='?'&&ch[i]!='*')
                            {
                                str.append(ch[i]);
                            }
                        }
                        else
                        {
                            if(ch[i]!='?'&&ch[i]!='*')
                            {
                                if(ch[i+1]=='*')
                                {
                                    while(rm>=0)
                                    {
                                        str.append(ch[i]);
                                        rm--;
                                    }

                                }
                                else
                                {
                                    str.append(ch[i]);
                                }
                            }
                            
                        }
                    }
                    if(ch[ch.length-1]!='?'&&ch[ch.length-1]!='*')
                    {
                        str.append(ch[ch.length-1]);
                    }

                    out1.println(str.toString());
                    
                }



                

            }
}





    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;

        InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}
class ele{
    long value;
    long i;
    boolean flag;
    public ele(long value,long i)
    {
        this.value = value;
        this.i=i;
        this.flag = false;
    }
}
