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 \leq k \leq 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

Difficulty: interview

Starter code:

Solutions:
s = input()
k = int(input())
c = 0
p = 0
has_star = False
for i in range(len(s)):
    if s[i] in ['*', '?']:
        if s[i] == '*':
            has_star = True
        c -= 1
    else:
        p += 1
        c += 1
if k < c:
    print("Impossible")
elif (not has_star) and (k > p):
    print("Impossible")
else:
    signs_to_add = k - c
    ans = ""
    for i in s:
        if signs_to_add == 0:
            if i not in ['*', '?']:
                ans += i
            else:
                ans = ans[:-1]
            continue
        if i == '?':
            signs_to_add -= 1
        elif i == '*':
            signs_to_add -= 1
            while signs_to_add > 0:
                ans += ans[-1]
                signs_to_add -= 1
        else:
            ans += i
    print(ans)



s = input()
k = int(input())

min_l = max_l = 0
for c in s:
    if c=='?' or c=='*':
        min_l -= 1
    else:
        min_l += 1
        max_l += 1

if k < min_l or (k > max_l and '*' not in s):
    print('Impossible')
else:
    r = ''
    d = k - min_l
    l = len(s)
    for i in range(l):
        if i+1 < l and s[i+1] == '?':
            if d > 0:
                r += s[i]
                d -= 1
        elif i+1 < l and s[i+1] == '*':
            while d > 0:
                r += s[i]
                d -= 1
        elif s[i]!='?' and s[i]!='*':
            r += s[i]
    print(r)


a = input()
k = int(input())

ml = 0
for i in a:
    if i == '?' or i == '*':
        ml -= 1
    else:
        ml += 1

if k < ml:
    print('Impossible')
    import sys
    return

dl = k - ml
t = ''
n = len(a)
for i in range(n):
    if i + 1 < n and a[i + 1] == '?':
        if dl <= 0: continue
        t += a[i]
        dl -= 1
        continue
    if i + 1 < n and a[i + 1] == '*':
        if dl <= 0: continue
        while dl > 0:
            t += a[i]
            dl -= 1
        continue
    if a[i] not in '?*':
        t += a[i]

if len(t) == k:
    print(t)
else:
    print('Impossible')


def read_nums():
    return [int(x) for x in input().split()]


def parse_input(text, symbols='?*'):
    res = []
    prev_index = 0
    for index, char in enumerate(text):
        if char in symbols:
            res.append(('', text[prev_index: index - 1]))
            res.append((char, text[index - 1]))
            prev_index = index + 1
    last_chunk = text[prev_index:]
    if len(last_chunk) != 0:
        res.append(('', last_chunk))
    return res


def calc_length(parsed_input):
    res = 0
    for part in parsed_input:
        if part[0] == '':
            res += len(part[1])
    return res


def main():
    msg = input()
    n, = read_nums()
    parsed_input = parse_input(msg)
    length = calc_length(parsed_input)

    out = []
    for part in parsed_input:
        if part[0] == '':
            out.append(part[1])
        elif length < n:
            if part[0] == '?':
                out.append(part[1])
                length += 1
            else:
                out.append(part[1] * (n - length))
                length = n

    res = ''.join(out)
    if len(res) == n:
        print(res)
    else:
        print('Impossible')


def __starting_point():
    main()

__starting_point()