[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]:
define the main function
    create long long a and b
    read a,b
    if a equal to 0
        print -1 * b * b
        for i=0 to b exclusive, print x
        print a newline
    else if b = 0
        print a * a
        for i=0 to a exclusive, print o
        print a newline
    else if b equal to 1
        print a*a -1
        for i=0 to a exclusive, print o
        print x
        print a newline
    else
        ser ret to LLONG_MIN
        set foo=0
        for j=1 to min of b-1 and a
            assign (a - j + 1) * (a - j + 1) + (j - 1) to pos
            set q = b / (j + 1) and r to b % (j + 1)
            set neg = r * (q + 1) * (q + 1) + (j + 1 - r) * q * q
            if pos - neg greater than ret
                ret = pos - neg
                assign j + 1 to foo
            end of the block
        end of the block
        print ret
        set q = b / foo, r = b % foo
        assign (a - (foo - 1) + 1) to g
        for j=1 to foo + 1 exclusive
            for i=0 to q exclusive, print x
            if <= r, print x
            if j different from foo
                if j equal to 1
                    for i=0 to g exclusive, print o
                else
                    print o
            end of the block
        end of the block
        print a newline
    end of the block
    return to indicate successful execution
end of the block

[CODE]:

int main() {
    long long a, b;
    cin >> a >> b;
    if (a == 0) {
        cout << -1 * b * b << endl;
        for (int(i) = (0); (i) < (b); ++(i)) cout << 'x';
        cout << endl;
    } else if (b == 0) {
        cout << a * a << endl;
        for (int(i) = (0); (i) < (a); ++(i)) cout << 'o';
        cout << endl;
    } else if (b == 1) {
        cout << a * a - 1 << endl;
        for (int(i) = (0); (i) < (a); ++(i)) cout << 'o';
        cout << 'x';
        cout << endl;
    } else {
        long long ret = LLONG_MIN;
        long long foo = 0;
        for (long long j = 1; j <= min(b - 1, a); j++) {
            long long pos = (a - j + 1) * (a - j + 1) + (j - 1);
            long long q = b / (j + 1), r = b % (j + 1);
            long long neg = r * (q + 1) * (q + 1) + (j + 1 - r) * q * q;
            if (pos - neg > ret) {
                ret = pos - neg;
                foo = j + 1;
            }
        }
        cout << ret << endl;
        long long q = b / foo, r = b % foo;
        long long g = (a - (foo - 1) + 1);
        for (int(j) = (1); (j) < (foo + 1); ++(j)) {
            for (int(i) = (0); (i) < (q); ++(i)) cout << 'x';
            if (j <= r) cout << 'x';
            if (j != foo) {
                if (j == 1)
                    for (int(i) = (0); (i) < (g); ++(i)) cout << 'o';
                else
                    cout << 'o';
            }
        }
        cout << endl;
    }
    return 0;
}