[TASK]:
You will be given lines of pseudocode, your task is to write the corresponding C++ code. The pseudocode will provide detailed description of the c++ code line by line. The pseudocode is garanteed to be correct and complete.

[INSTRUCTION]:
The following libraries are already included in the code.
```cpp
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <fstream>
#include <climits>
#include <cassert>
#include <iomanip>
#include <sstream>
#include <bitset>
using namespace std;
```
Do not include them in your code again. Please surround your code with ```cpp and ``` markers. Note that the code should correspond to the pseudocode line by line.

[PSEUDOCODE]:
let c be a character array of size 1000
let res be an integer array of size 1000
let l, mn, pl, n be integers with pl = 1
define the main function
    ch = character
    input ch
    while input ch
        if ch is the character =, break
        set c[l] to ch
        if c[l] is the character +
            increment pl
        else
            increment mn
        increment l
        input ch
    end of the block
    input n
    if n * pl - nm is less than n or pl - n * mn is greater than n
        print Impossible
    else
        print Possible
        for i = 0 to 1 inclusive, set res[i] to 1
        d is an integer with d = n - (pl - mn)
        for i = 0 to 1 inclusive
            if (i equals 0 or c[i - 1] equals the character +) and d is greater than 0
                if d is less than n - res[i]
                    add d to res[i]
                    set d to 0
                else
                    subtract n - res[i] from d
                    res[i] is assigned n
                end of the block
            else if i isn't 0 and c[i - 1] equals the character - and d is less than 0
                if -d is less than n - res[i]
                    add -d to res[i]
                    set d to 0
                else
                    add n - res[i] to d
                    set res[i] to n
                end of the block
            end of the block
        end of the block
        output res[0]
        for i = 0 to 1 exclusive, output the character space, c[i] the character space, and res[i + 1]
        output the string " = " and n
    end of the block
    return to indicate successful execution
end of the block

[CODE]:

char c[1000];
int res[1000];
int l, mn, pl = 1, n;
int main() {
    char ch;
    cin >> ch;
    while (cin >> ch) {
        if (ch == '=') break;
        c[l] = ch;
        if (c[l] == '+')
            pl++;
        else
            mn++;
        l++;
        cin >> ch;
    }
    cin >> n;
    if (n * pl - mn < n || pl - n * mn > n)
        cout << "Impossible" << endl;
    else {
        cout << "Possible" << endl;
        for (int i = 0; i <= l; i++) res[i] = 1;
        int d = n - (pl - mn);
        for (int i = 0; i <= l; i++) {
            if ((i == 0 || c[i - 1] == '+') && d > 0) {
                if (d < n - res[i]) {
                    res[i] += d;
                    d = 0;
                } else {
                    d -= n - res[i];
                    res[i] = n;
                }
            } else if (i != 0 && c[i - 1] == '-' && d < 0) {
                if (-d < n - res[i]) {
                    res[i] += -d;
                    d = 0;
                } else {
                    d += n - res[i];
                    res[i] = n;
                }
            }
        }
        cout << res[0];
        for (int i = 0; i < l; i++) cout << " " << c[i] << " " << res[i + 1];
        cout << " = " << n << endl;
    }
    return 0;
}