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

public class Main {


    static int MOD = 1000000007;

    static long[][] ip = new long[64][10001];

    static long modInverse(long a, long m)
    {
        long m0 = m;
        long y = 0, x = 1;

        if (m == 1)
            return 0;

        while (a > 1)
        {
            long q = a / m;

            long t = m;

            m = a % m;
            a = t;
            t = y;

            y = x - q * y;
            x = t;
        }

        if (x < 0)
            x += m0;

        return x;
    }

    static long dp[][] = new long[20001][101];
    static long nCr(int n, int r) {
        if (n > 20000 || r > 100) {
            return nCr(n - 1, r) + nCr(n - 1, r - 1);
        }
        if (r == 0)
            return dp[n][r] = 1;
        if (r == 1)
            return dp[n][r] = (long)n;
        if (n == r)
            return dp[n][r] = 1;
        if (dp[n][r] > 0)
            return dp[n][r];
        return dp[n][r] = (nCr(n - 1, r) + nCr(n - 1, r - 1)) % MOD;
    }

    public static void main(String[] args)  {

        Reader reader = new Reader(System.in);
        String s = reader.nextLine();
        int k = reader.nextInt();
        int mi = 0;
        int l = s.length();
        int ma = 0;
        boolean inf = false;
        for (int i = 0;i < l; ++i) {
            char c = s.charAt(i);
            if (c == '*' || c == '?') {
                mi -= 1;
                if (c == '*') {
                    inf = true;
                }
            } else {
                mi += 1;
                ma += 1;
            }
        }
        if (k >= mi && (k <= ma || inf)) {
                StringBuilder sb = new StringBuilder();
                for (int j = 0;j < l; ++j) {
                    char c = s.charAt(j);
                    if (c == '*') {
                        int rem = 0;
                        for (int jj = j + 1;jj < l; ++jj) {
                            char cc = s.charAt(jj);
                            if (cc == '*' || cc == '?') {
                                rem -= 1;
                            } else {
                                rem += 1;
                            }
                        }
                        int ex = k - sb.length() - rem;
                        if (ex < 0) {
                            while (ex < 0 && sb.charAt(sb.length() - 1) == s.charAt(j - 1)) {
                                sb.deleteCharAt(sb.length() - 1);
                                ++ex;
                            }
                        } else {
                            while (ex > 0) {
                                sb.append(s.charAt(j - 1));
                                --ex;
                            }
                        }
                        int remMax = 0;
                        for (int jj = j + 1;jj < l; ++jj) {
                            char cc = s.charAt(jj);
                            if (cc == '*') {
                                remMax = k + 1;
                                break;
                            } else {
                                remMax += 1;
                            }
                        }
                        int le = k - sb.length() - remMax;
                        while (le > 0) {
                            sb.append(s.charAt(j - 1));
                            --le;
                        }
                    } else if (c == '?') {
                        int rem = 0;
                        for (int jj = j + 1;jj < l; ++jj) {
                            char cc = s.charAt(jj);
                            if (cc == '*' || cc == '?') {
                                rem -= 1;
                            } else {
                                rem += 1;
                            }
                        }
                        int ex = k - sb.length() - rem;
                        if (ex < 0) {
                            while (ex < 0 && sb.charAt(sb.length() - 1) == s.charAt(j - 1)) {
                                sb.deleteCharAt(sb.length() - 1);
                                ++ex;
                            }
                        }
                    } else {
                        sb.append(s.charAt(j));
                    }
                }
            System.out.println(sb.toString());
            //System.out.println(sb.length());

        } else {
            System.out.println("Impossible");
        }
    }

    static long gcd(long a, long b)
    {
        if (b == 0)
            return a;
        return gcd(b, a % b);

    }

    private static HashMap<Long, Integer> primeDivs(long l) {
        HashMap<Long, Integer> r = new HashMap<>();
        for (long i = 2;i * i < l && l > 1; ++i) {
            if (l % i == 0) {
                int ct = 0;
                while (l % i == 0 && l > 0) {
                    l /= i;
                    ++ct;
                }
                r.put(i, ct);
            }
        }
        if (l > 1) {
            r.put(l, 1);
        }
        return r;
    }

    private static Set<Long> generateDivisors(final long n) {
        Set<Long> divisors = new HashSet<>();
        for (long i = 1;i * i < n; ++i) {
            if (n % i == 0) {
                divisors.add(i);
                divisors.add(n / i);
            }
        }
        return divisors;
    }

    private static char getRank(final String s) {
        return s.charAt(0);
    }

    private static char getSuite(final String a) {
        return a.charAt(1);
    }

    private static void merge(final int[] rank, final int[] parent, final int pu, final int pv) {
        if (pu != pv) {
            if (rank[pu] > rank[pv]) {
                parent[pv] = pu;
                rank[pu] += rank[pv];
             } else {
                parent[pu] = pv;
                rank[pv] += rank[pu];
            }
        }
    }

    private static int parent(final int[] parent, int u) {
        while (parent[u] != u) {
            parent[u] = parent[parent[u]];
            u = parent[u];
        }
        return parent[u];
    }

    static class Edge {
        final int u;
        final int v;
        final int weight;

        Edge(final int u, final int v, final int weight) {
            this.u = u;
            this.v = v;
            this.weight = weight;
        }
    }

    static class Pair implements Comparable<Pair>{

        final int a, b;

        Pair(int a, int b) {

            this.a = a;
            this.b = b;
        }

        public int compareTo(Pair p) {
            if (a == p.a) {
                return Integer.compare(b, p.b);
            } else {
                return Integer.compare(a, p.a);
            }
        }

        @Override
        public boolean equals(final Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            final Pair pair = (Pair) o;
            return a == pair.a &&
                    b == pair.b;
        }

        @Override
        public int hashCode() {
            return Objects.hash(a, b);
        }
    }

    static class Reader {
        private final BufferedReader br;
        private StringTokenizer tokenizer;

        Reader(InputStream in) {
            this.tokenizer = new StringTokenizer("");
            this.br = new BufferedReader(new InputStreamReader(in));
        }

        String next() {
            while (!tokenizer.hasMoreTokens()) {
                String st = nextLine();
                if (st != null) tokenizer = new StringTokenizer(st);
            }
            return tokenizer.nextToken();
        }

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

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

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

        String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }
    }
}