[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]:
declare character array a with size 1204000
define the main function
    loop when read input to a
        create int array A with 1204 elements
        declare integer ans = 0
        declare integer r = 0
        declare integer flag = 0
        declare integer p = 0
        for i from 0 to exclusive incrementing i
            if a[i] is '?'
                if flag is false
                    change A[r] to 1
                    increment r
                    increment p
                end of the block
                if flag is true
                    assign - 1 to A[r]
                    increment r
                    decrement p
                end of the block
            end of the block
            if a[i] is '-', change flag to 1
            if a[i] is '+', change flag to 0
            if a[i] >= '0' and a[i] <= '9', change n to n * 10 + a[i] - '0'
        end of the block
        loop i from 0 to r exclusive incrementing i
            if A[i] is less than 0
                if p is greater than n
                    looping infinitely
                        if absolute value pf A[i] >= n or p = n, stop the loop
                        decrement A[i]
                        decrement p
                    end of the block
                end of the block
            else if A[i] is greater than 0
                if p is less than n
                    in the infinite loop
                        if A[i] >= n or p = n, stop the loop
                        increment A[i]
                        increment p by one
                    end of the block
                end of the block
            end of the block
        end of the block
        if p != n
            print "Impossible"
        else
            print "Possible"
            if A[0] is greater than 0
                print A[0]
            else
                print A[0]
            end of the block
            for i = 1 to r exclusive
                print " "
                if A[i] is greater than 0
                    print "+"
                else
                    print "-"
                end of the block
                print " " and absolute value of A[i]
            end of the block
            print " = " and n
        end of the block
    end of the block
    return to indicate successful execution
end of the block

[CODE]:

char a[1204000] = {};
int main() {
    while (gets(a)) {
        int A[1204] = {};
        int n = 0;
        int r = 0;
        int flag = 0;
        int p = 0;
        for (int i = 0; a[i]; i++) {
            if (a[i] == '?') {
                if (!flag) {
                    A[r] = 1;
                    r++;
                    p++;
                }
                if (flag) {
                    A[r] = -1;
                    r++;
                    p--;
                }
            }
            if (a[i] == '-') flag = 1;
            if (a[i] == '+') flag = 0;
            if (a[i] >= '0' && a[i] <= '9') { n = n * 10 + a[i] - '0'; }
        }
        for (int i = 0; i < r; i++) {
            if (A[i] < 0) {
                if (p > n) {
                    while (1) {
                        if (abs(A[i]) >= n || p == n) { break; }
                        A[i]--;
                        p--;
                    }
                }
            } else if (A[i] > 0) {
                if (p < n) {
                    while (1) {
                        if ((A[i] >= n || p == n)) { break; }
                        A[i]++;
                        p++;
                    }
                }
            }
        }
        if (p != n) {
            cout << "Impossible" << endl;
        } else {
            cout << "Possible" << endl;
            if (A[0] > 0) {
                cout << A[0];
            } else {
                cout << A[0];
            }
            for (int i = 1; i < r; i++) {
                cout << " ";
                if (A[i] > 0) {
                    cout << "+";
                } else {
                    cout << "-";
                }
                cout << " " << abs(A[i]);
            }
            cout << " = " << n << endl;
        }
    }
    return 0;
}