[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]:
create long longs A, B, ans with ans = -0x7fffffff
create long longs bxb, bex, bob, bpb
define the main function
    read A read B
    if B is 0
        print A * A print newline
        for i = 0 to A exclusive print "o"
        print newline
        return to indicate successful execution
    end of the block
    if B is 1
        print A * A - 1 print newline
        for i = 0 to A exclusive, print "o"
        print "x" print newline
        return to indicate successful execution
    end of the block
    if A is 0
        print -B * B print newline
        for i = 0 to B exclusive, print "x'
        print newline
        return to indicate successful execution
    end of the block
    for xb = 2 to minimum of (B and A + 1) inclusive
        create integer ob with ob = xb - 1
        create long long score with score = ob - 1
        increment score by (A - (ob - 1)) * (A - (ob - 1))
        end statement
        create long long pb with pb = B / xb
        create long long ex with ex = B % xb
        decrement score by ( xb - ex ) * pb * pb
        decrement score by ex * ( pb + 1 ) * ( pb + 1 )
        if score is greater than ans
            set ans to score
            set bxb to xb
            set bex to ex
            set bob to ob
            set bpb to pb
        end of the block
    end of the block
    print ans print newline
    for i = 0 to bxb exclusive
        for j = 0 to bpb exclusive, print "x"
        if i is less than bex, print "x"
        if i is 0
            for j = 0 to A - ( bob - 1 ) exclusive, print "o"
        else if i + 1 is less than bxb
            print "o"
    end of the block
    print newline
    return to indicate successful execution
end of the block

[CODE]:

long long A, B, ans = -0x7fffffff;
long long bxb, bex, bob, bpb;
int main() {
    cin >> A >> B;
    if (B == 0) {
        cout << A * A << endl;
        for (int i = 0; i < A; i++) cout << "o";
        cout << endl;
        return 0;
    }
    if (B == 1) {
        cout << A * A - 1 << endl;
        for (int i = 0; i < A; i++) cout << "o";
        cout << "x" << endl;
        return 0;
    }
    if (A == 0) {
        cout << -B * B << endl;
        for (int i = 0; i < B; i++) cout << "x";
        cout << endl;
        return 0;
    }
    for (int xb = 2; xb <= min(B, A + 1); xb++) {
        int ob = xb - 1;
        long long score = ob - 1;
        score += (A - (ob - 1)) * (A - (ob - 1));
        ;
        long long pb = B / xb;
        long long ex = B % xb;
        score -= (xb - ex) * pb * pb;
        score -= ex * (pb + 1) * (pb + 1);
        if (score > ans) {
            ans = score;
            bxb = xb;
            bex = ex;
            bob = ob;
            bpb = pb;
        }
    }
    cout << ans << endl;
    for (int i = 0; i < bxb; i++) {
        for (int j = 0; j < bpb; j++) cout << "x";
        if (i < bex) cout << "x";
        if (i == 0)
            for (int j = 0; j < A - (bob - 1); j++) cout << "o";
        else if (i + 1 < bxb)
            cout << "o";
    }
    cout << endl;
    return 0;
}