[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 integer variables co and cx
create const long long inf = -1e16
inlined long long function gox with int argument num
    return inf if num is greater than cx
    declare int ex = cx % num
    declare int variable anch = cx / num
    declare long long variable ans = 1LL * (anch + 1) * (anch + 1) * ex
    increase ans by 1LL * anch * anch * (num - ex)
    return -ans
end of the block
inlined long long function goo with int argument num
    if num is greater than co
    declare int variable juntos = co - num + 1
    create long long ans = 1LL * juntos * juntos
    increase ans by num - 1
    return ans
end of the block
inlined void function build with int arguments x and o
    create string s
    declare integer xx = cx / x
    create bool flag = true if x > o, else false
    declare bool variable fst = true
    create integer ex = cx % x
    declare integer prim = co - o + 1
    while either x or o is true
        if flag is true
            push 'x' into s xx times
            if ex is greater than 0, push 'x' into s and decrement ex
            decrement x
        else
            if fst is true
                push 'o' into s prim times
                set fst to false
            else
                push 'o' into s
            decrement o
        end of the block
        invert the value of flag
    end of the block
    print s
end of the block
define the main function
    read co and cx
    if co is 0 or cx is 0
        if co is greater than 0
            print 1LL * co * co
            print 'o' co times
            print a new line
        end of the block
        if cx is greater than 0
            print - 1LL * cx * cx
            print 'x' cx times
            print
        end of the block
        return to indicate successful execution
    end of the block
    declare int lim = min of co and cx
    create long long ans = LLONG_MIN
    pos is a pair of integers
    for integer i = 1 to lim + 1 exclusive
        if ans is less than gox(i) + goo(i)
            assign gox(i) + goo(i) to ans
            pos = {i, i}
        end of the block
    end of the block
    for i = 2 to cx + 1 exclusive
        if ans is less than gox(i) + goo(i - 1)
            change ans to gox(i) + goo(i - 1)
            pos = {i, i - 1}
        end of the block
    end of the block
    for i = 2 to co + 1 exclusive
        if ans is less than gox(i - 1) + goo(i)
            set ans to gox(i - 1) + goo(i)
            pos = {i - 1, i}
        end of the block
    end of the block
    print ans
    call build with arguments pos.first and pos.second
    return to indicate successful execution
end of the block

[CODE]:

int co, cx;
const long long inf = -1e16;
inline long long gox(int num) {
    if (num > cx) return inf;
    int ex = cx % num;
    int anch = cx / num;
    long long ans = 1LL * (anch + 1) * (anch + 1) * ex;
    ans += 1LL * anch * anch * (num - ex);
    return -ans;
}
inline long long goo(int num) {
    if (num > co) return inf;
    int juntos = co - num + 1;
    long long ans = 1LL * juntos * juntos;
    ans += num - 1;
    return ans;
}
inline void build(int x, int o) {
    string s;
    int xx = cx / x;
    bool flag = (x > o);
    bool fst = true;
    int ex = cx % x;
    int prim = co - o + 1;
    while (x || o) {
        if (flag) {
            for (int i = int(0); i < int(xx); ++i) s.push_back('x');
            if (ex > 0) s.push_back('x'), ex--;
            x--;
        } else {
            if (fst) {
                for (int i = int(0); i < int(prim); ++i) s.push_back('o');
                fst = false;
            } else
                s.push_back('o');
            o--;
        }
        flag = (!flag);
    }
    cout << s << endl;
}
int main() {
    cin >> co >> cx;
    if (co == 0 || cx == 0) {
        if (co > 0) {
            cout << 1LL * co * co << endl;
            for (int i = int(0); i < int(co); ++i) cout << 'o';
            cout << endl;
        }
        if (cx > 0) {
            cout << -1LL * cx * cx << endl;
            for (int i = int(0); i < int(cx); ++i) cout << 'x';
            cout << endl;
        }
        return 0;
    }
    int lim = min(co, cx);
    long long ans = LLONG_MIN;
    pair<int, int> pos;
    for (int i = int(1); i < int(lim + 1); ++i) {
        if (ans < gox(i) + goo(i)) {
            ans = gox(i) + goo(i);
            pos = {i, i};
        }
    }
    for (int i = int(2); i < int(cx + 1); ++i) {
        if (ans < gox(i) + goo(i - 1)) {
            ans = gox(i) + goo(i - 1);
            pos = {i, i - 1};
        }
    }
    for (int i = int(2); i < int(co + 1); ++i) {
        if (ans < gox(i - 1) + goo(i)) {
            ans = gox(i - 1) + goo(i);
            pos = {i - 1, i};
        }
    }
    cout << ans << endl;
    build(pos.first, pos.second);
    return 0;
}