//****************************Bismillahir Rahmanir Rahim***************************//

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define PB push_back
#define F first
#define S second
#define MP make_pair
#define endl '\n'
#define rt return

const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const ll infLL = 9000000000000000000;
#define MOD 1000000007
//#define harmonic(n) 0.57721566490153286l+log(n)

#define mem(a,b) memset(a, b, sizeof(a) )
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))
#define sqr(a) ((a) * (a))

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

typedef vector<int>::iterator vit;
typedef set<int>::iterator sit;

inline bool checkBit(ll n, int i) { return n&(1LL<<i); }
inline ll setBit(ll n, int i) { return n|(1LL<<i);; }
inline ll resetBit(ll n, int i) { return n&(~(1LL<<i)); }

int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
//int dx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
//int dy[] = {0, +1, 0, -1, +1, -1, +1, -1};

inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
inline bool isLeapYear(ll year) { return (year%400==0) || (year%4==0 && year%100!=0); }
inline void normal(ll &a) { a %= MOD; (a < 0) && (a += MOD); }
inline ll modMul(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a*b)%MOD; }
inline ll modAdd(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); return (a+b)%MOD; }
inline ll modSub(ll a, ll b) { a %= MOD, b %= MOD; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while(p) { if(p&1) r = modMul(r, b); b = modMul(b, b); p >>= 1; } return r; }
inline ll modInverse(ll a) { return modPow(a, MOD-2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

/*
bool seive[1010000];
vi prime;

void seiveGen(int limit) {
    limit += 100;
    int sqrtn = sqrt(limit);
    for(int i = 3; i <= sqrtn; i += 2) {
            if(!seive[i>>1]) {
                    for(int j = i * i; j < limit; j += i + i) {
                            seive[j>>1] = 1;
                    }
            }
    }
    prime.PB(2);
    for(int i = 3; i < limit; i += 2) {
            if(!seive[i>>1]) prime.PB(i);
    }
}
*/
/*
*******************************USE of STL***************************
v.erase(unique(v.begin(),v.end()),v.end());
    int a[]={..........};
    sort(a,a+n,greater<int>()); ///sort in descending order
    int z=sizeof(a)/sizeof(a[0]); ///size of array
    string s,x;
    transform(s.begin(),s.end(),s.begin(),::tolower);///change of uppercase to lowercase of any string
    int i;
    i=s.compare(x); ///compare two string like strcmp
    int n,m;
    i=log10(n)+1; ///how many digits in integer n
    i=abs(n-m); ///take absolute value
     copy(v.begin(),v.end(),back_inserter(q)); ///copying v vector to q
     s.find("AB"); ///search index Number of AB(substring) in string s
     remove(a,a+n,3); ///delete 3rd element from array
     ceil(2.3) /// Returns the smallest integer that is greater than or equal to x (i.e : rounds up the nearest integer) দশমিক যদি <=.৫ হয় তাহলে একযোগ করে প্রিন্ট করবে
     round(2.3)///return round value...like 2.3=2,,,2.5=3,,2.6=3;

     {
         ///int to string transfer///
         ostringstream temp; ///need a temp;
         int x;
         temp<<x;
         string s;
         s=temp.str(x); ///transfer
     }
     count(s.begin(), s.end(), 'a')///Count the number of occurrences of 'a' in a string s
*/

//
//debug
#ifdef ahasun
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
            return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
            os << "{";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename T >
ostream &operator << ( ostream & os, const multiset< T > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << *it;
                                            }
                    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
            os << "[";
                for(auto it = v.begin(); it != v.end(); ++it) {
                                if( it != v.begin() ) os << ", ";
                                        os << it -> first << " = " << it -> second ;
                                            }
                    return os << "]";
}

#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

clock_t tStart = clock();
#define timeStamp dbg("Execution Time: ", (double)(clock() - tStart)/CLOCKS_PER_SEC)

void faltu () {
            cerr << endl;
}

template <typename T>
void faltu( T a[], int n ) {
            for(int i = 0; i < n; ++i) cerr << a[i] << ' ';
                cerr << endl;
}

template <typename T, typename ... hello>
void faltu( T arg, const hello &... rest) {
            cerr << arg << ' ';
                faltu(rest...);
}
#else
#define dbg(args...)
#endif
//****************Source Code starting From here**************//

int main()
{
	string s,t;
	t="ABC";
	int n,k,ans=0,l=t.length();
	cin>>n>>k>>s;
	if(k==2)
		l--;
	if(k==2)
	{
		string p,q;
		for(int i=0;i<=n/2;i++)
		{
			p+="AB";
			q+="BA";
		}
		int x=0,y=0;
		for(int i=0;i<n;i++)
		{
			if(s[i]!=p[i])
				x++;
			if(s[i]!=q[i])
				y++;
		}
		if(x<y)
		{
			ans=x;
			s=p;
		}
		else
		{
			ans=y;
			s=q;
		}
	}
	if(k!=2){
	for(int i=0;i<n-1;i++)
	{
		int z=0,x=0;
		if(s[i]==s[i+1])
		{
			char ch;
			for(int j=0;j<l;j++)
			{
				if(s[i]!=t[j] && s[i+2]!=t[j] && x==0)
				{
					ch=t[j];
					x=1;
				}
			}
			if(x==1)
			{
				s[i+1]=ch;
				ans++;
			}
		}
	}}
	cout<<ans<<endl;
	for(int i=0;i<n;i++)
		cout<<s[i];
	//rt main();
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define EPS 1e-16
#define OO (long long)1e18
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
const int MOD = (long long) (1e9 + 7);

const long long N = 1e6 + 7;
char in[N];
int n, k;

int dp[N][100];

int solve(int idx, int lst) {
	if (idx == n)
		return 0;
	int &ret = dp[idx][lst];
	if (~ret)
		return ret;
	ret = 1e9;
	for (char i = 'A'; i <= 'Z'; i++) {
		if (i == lst)
			continue;
		ret = min(ret, solve(idx + 1, i) + (i != in[idx]));
	}
	return ret;
}

void print(int idx, int lst) {
	if (idx == n)
		return;
	int ret = dp[idx][lst];
	for (char i = 'A'; i <= 'Z'; i++) {
		if (i == lst)
			continue;
		if (ret == solve(idx + 1, i) + (i != in[idx])) {
			printf("%c", i);
			print(idx + 1, i);
			break;
		}
	}
	return;
}

int main() {
	scanf("%d %d %s", &n, &k, in);
	memset(dp, -1, sizeof dp);
	printf("%d\n", solve(0, 0));
	print(0, 0);
	puts("");
}


#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <sstream>
#include <map>
#include <ctime>
#include <cstdlib>
#include <list>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include<unordered_map>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
int dx8[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
int dy8[] = { -1, 1, 0, 0, -1, -1, 1, 1 };
int dy[] = { 1, -1, 0, 0 };
int dx[] = { 0, 0, 1, -1 };
int X[6] = { 0, 0, 0, -1, 0, 1 };
int Y[6] = { 0, 0, -1, 0, 1, 0 };
int Z[6] = { 1, -1, 0, 0, 0, 0 };

// start + (end - start) / 2;

#define OO ll(1e15)
#define MOD ll(1e9+7)
#define BASE 128LL
#define BASEINV (ll)570312504
using namespace std;
int n, k, dp[500005][30];
string str;
int solve(int idx, int last) {
	if (idx == n)return 0;
	int &ret = dp[idx][last];
	if (ret != -1)return ret;
	ret = 1e9;
	for (int i = 1; i <= k; i++) {
		if (i == last)continue;
		ret = min(ret, solve(idx + 1, i) +
			(str[idx] - 'A' + 1 != i));
	}
	return ret;
}

void print(int idx, int last) {
	if (idx == n)return;
	int ret = dp[idx][last];
	for (int i = 1; i <= k; i++) {
		if (i == last)continue;
		if (ret == solve(idx + 1, i) + (str[idx] - 'A' + 1 != i)) {
			cout << char(i - 1 + 'A');
			print(idx + 1, i);
			break;
		}
	}
}
char ar[500005];
int main() {
	scanf("%d %d %s", &n, &k, ar);
	str = ar;
	memset(dp, -1, sizeof dp);
	cout << solve(0, 0) << "\n";
	print(0, 0);
	puts("");
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define EPS 1e-16
#define OO (long long)1e18
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
const int MOD = (long long) (1e9 + 7);

const long long N = 5e5 + 7;

char in[N];

int n, k;

int dp[N][100];

int solve(int idx, int lst) {
	if (idx == n)
		return 0;
	int &ret = dp[idx][lst];
	if (~ret)
		return ret;
	ret = 1e9;
	for (int i = -2; i <= 2; i++) {
		char x = in[idx] + i;
		if (x == lst || !isalpha(x) || x >= 'A' + k)
			continue;
		ret = min(ret, solve(idx + 1, x) + (x != in[idx]));
	}
	return ret;
}

void print(int idx, int lst) {
	if (idx == n)
		return;
	int ret = dp[idx][lst];
	for (int i = -2; i <= 2; i++) {
		char x = in[idx] + i;
		if (x == lst || !isalpha(x) || x >= 'A' + k)
			continue;
		if (ret == solve(idx + 1, x) + (x != in[idx])) {
			printf("%c", x);
			print(idx + 1, x);
			break;
		}
	}
	return;
}

int main() {
	scanf("%d %d %s", &n, &k, in);
	memset(dp, -1, sizeof dp);
	printf("%d\n", solve(0, 0));
	print(0, 0);
	puts("");
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define EPS 1e-16
#define OO (long long)1e18
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
const int MOD = (long long) (1e9 + 7);

const long long N = 5e5 + 7;

char in[N];

int n, k;

int dp[N][100];

int solve(int idx, int lst) {
	if (idx == n)
		return 0;
	int &ret = dp[idx][lst];
	if (~ret)
		return ret;
	ret = 1e9;
	for (char i = 'A'; i < (k + 'A'); i++) {
		if (i == lst)
			continue;
		ret = min(ret, solve(idx + 1, i) + (i != in[idx]));
	}
	return ret;
}

void print(int idx, int lst) {
	if (idx == n)
		return;
	int ret = dp[idx][lst];
	for (char i = 'A'; i < ('A' + k); i++) {
		if (i == lst)
			continue;
		if (ret == solve(idx + 1, i) + (i != in[idx])) {
			printf("%c", i);
			print(idx + 1, i);
			break;
		}
	}
	return;
}

int main() {
	scanf("%d %d %s", &n, &k, in);
	memset(dp, -1, sizeof dp);
	printf("%d\n", solve(0, 0));
	print(0, 0);
	puts("");
}


#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <sstream>
#include <map>
#include <ctime>
#include <cstdlib>
#include <list>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include<unordered_map>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
int dx8[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
int dy8[] = { -1, 1, 0, 0, -1, -1, 1, 1 };
int dy[] = { 1, -1, 0, 0 };
int dx[] = { 0, 0, 1, -1 };
int X[6] = { 0, 0, 0, -1, 0, 1 };
int Y[6] = { 0, 0, -1, 0, 1, 0 };
int Z[6] = { 1, -1, 0, 0, 0, 0 };

// start + (end - start) / 2;

#define OO ll(1e15)
#define MOD ll(1e9+7)
#define BASE 128LL
#define BASEINV (ll)570312504
using namespace std;
int n, k, dp[500005][30];
string str;
int solve(int idx, int last) {
	if (idx == n)return 0;
	int &ret = dp[idx][last];
	if (ret != -1)return ret;
	ret = 1e9;
	for (int i = -2; str[idx] + i - 'A' + 1 <= k && i <= 2; i++) {
		if (str[idx] + i - 'A' + 1 == last || str[idx] + i - 'A' + 1 <= 0)continue;
		ret = min(ret, solve(idx + 1, str[idx] + i - 'A' + 1) + (i != 0));
	}
	return ret;
}

void print(int idx, int last) {
	if (idx == n)return;
	int ret = dp[idx][last];
	for (int i = -2; i + str[idx] - 'A' + 1 <= k && i <= 2; i++) {
		if (str[idx] + i - 'A' + 1 == last || str[idx] + i - 'A' + 1 <= 0)continue;
		if (ret == solve(idx + 1, str[idx] + i - 'A' + 1) + (i != 0)) {
			cout << (char)(str[idx] + i);
			print(idx + 1, str[idx] + i - 'A' + 1);
			break;
		}
	}
}
char ar[500005];
int main() {
	scanf("%d %d %s", &n, &k, ar);
	str = ar;
	memset(dp, -1, sizeof dp);
	cout << solve(0, 0) << "\n";
	print(0, 0);
	puts("");
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define EPS 1e-16
#define OO (long long)1e18
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
const int MOD = (long long) (1e9 + 7);

const long long N = 5e5 + 7;

char in[N];

int n, k;

int dp[N][100];

int solve(int idx, int lst) {
	if (idx == n)
		return 0;
	int &ret = dp[idx][lst];
	if (~ret)
		return ret;
	ret = 1e9;
	for (char i = 'A'; i <= 'Z'; i++) {
		if (i == lst)
			continue;
		ret = min(ret, solve(idx + 1, i) + (i != in[idx]));
	}
	return ret;
}

void print(int idx, int lst) {
	if (idx == n)
		return;
	int ret = dp[idx][lst];
	for (char i = 'A'; i <= 'Z'; i++) {
		if (i == lst)
			continue;
		if (ret == solve(idx + 1, i) + (i != in[idx])) {
			printf("%c", i);
			print(idx + 1, i);
			break;
		}
	}
	return;
}

int main() {
	scanf("%d %d %s", &n, &k, in);
	memset(dp, -1, sizeof dp);
	printf("%d\n", solve(0, 0));
	print(0, 0);
	puts("");
}


#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <stdio.h>
#include <climits>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <sstream>
#include <map>
#include <ctime>
#include <cstdlib>
#include <list>
#include <bitset>
#include <functional>
#include <numeric>
#include <utility>
#include<unordered_map>
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
int dx8[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
int dy8[] = { -1, 1, 0, 0, -1, -1, 1, 1 };
int dy[] = { 1, -1, 0, 0 };
int dx[] = { 0, 0, 1, -1 };
int X[6] = { 0, 0, 0, -1, 0, 1 };
int Y[6] = { 0, 0, -1, 0, 1, 0 };
int Z[6] = { 1, -1, 0, 0, 0, 0 };

// start + (end - start) / 2;

#define OO ll(1e15)
#define MOD ll(1e9+7)
#define BASE 128LL
#define BASEINV (ll)570312504
using namespace std;
int n, k, dp[500005][30];
string str;
int solve(int idx, int last) {
	if (idx == n)return 0;
	int &ret = dp[idx][last];
	if (ret != -1)return ret;
	ret = 1e9;
	for (int i = 1; i <= k; i++) {
		if (i == last)continue;
		ret = min(ret, solve(idx + 1, i) +
			(str[idx] - 'A' + 1 != i));
	}
	return ret;
}

void print(int idx, int last) {
	if (idx == n)return;
	int ret = dp[idx][last];
	for (int i = 1; i <= k; i++) {
		if (i == last)continue;
		if (ret == solve(idx + 1, i) + (str[idx] - 'A' + 1 != i)) {
			cout << char(i - 1 + 'A');
			print(idx + 1, i);
			break;
		}
	}
}

int main() {
	cin >> n >> k >> str;
	memset(dp, -1, sizeof dp);
	cout << solve(0, 0) << "\n";
	print(0, 0);
	puts("");
}


#include <bits/stdc++.h>

using namespace std;

#define debug(s) cout<< #s <<" = "<< s <<endl
#define all(v) (v).begin(), (v).end()
#define mem(a,val) memset(a,val,sizeof a)

#define ll long long
#define ff first
#define ss second
#define pb push_back
#define endl '\n'

int n,k;
int ans;
string s;

void check(int start, int end)
{
  //cout << start << " " << end << endl;
  int d = end-start+1;
  if((d&1) or (end == n-1)){
    char A = s[start];
    char B;
    for(char c = 'A'; c <= 'Z'; ++c){
      if(c != A){
        B = c;
        break;
      }
    }
    for(int i = start; i <= end; ++i){
      if((i-start)&1){
        ++ans;
        s[i] = B;
      }
    }
  }
  else{
    char B = s[end+1];
    char A = s[start];
    //debug(A);
    //debug(B);
    char C;
    for(char c = 'A'; c <= 'Z'; ++c){
      if(c != A and c != B){
        C = c;
        //debug(C);
        break;
      }
    }
    for(int i = start; i <= end+1; ++i){
      if((i-start)&1){
        ++ans;
        s[i] = C;
      }
    }
  }
  return;
}

int main()
{
  ios_base::sync_with_stdio(false);cin.tie(NULL);
  cin >> n >> k;
  cin >> s;
  if(k == 2){
    int cnt = 0;
    string ss = "";
    if(s[0] == 'A'){
      for(int i = 0; i < n; ++i){
        if(i & 1) ss += "B";
        else ss += "A";
      }
    }
    else{
      for(int i = 0; i < n; ++i){
        if(i & 1) ss += "A";
        else ss += "B";
      }
    }
    for(int i = 0; i < n; ++i){
      if(s[i] != ss[i]) ++cnt;
    }
    cout << cnt << endl;
    cout << ss << endl;
    return 0;
  }
  else{
    int st = 0,en = 0;
    bool f = 0;
    for(int i = 1; i < n; ++i){
      if(s[i] == s[i-1]){
        en++;
        f = 1;
      }
      else{
        if(!f) st++,en++;
        else{
          check(st,en);
          st++,en++;
          f = 0;
        }
      }
    }
    if(f) check(st,en);
    cout << ans << endl;
    cout << s << endl;
  }
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cassert>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) static_cast<void>(0)
#endif
#define endl '\n'
#define sz(c) ((int) (c).size())
#define pb push_back
#define mp make_pair
typedef long long int64;

using namespace std;

int64 sq(int64 x) {
  return x * x;
}

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  if (a == 0) {
    cout << -(int64)b * b << endl;
    puts(string(b, 'x').c_str());
    exit(0);
  }
  if (b == 0) {
    cout << (int64)a * a << endl;
    puts(string(a, 'o').c_str());
    exit(0);
  }
  int64 res = (int64)a * a - (int64)b * b;
  int resP = 1, resQ = 1;
  for (int p = 1; p <= a; ++p) {
    for (int q = max(1, p - 1); q <= min(b, p + 1); ++q) {
      int64 score = p - 1 + sq(a - p + 1);
      score -= sq(b / q + 1) * (b % q) + sq(b / q) * (q - b % q);
      if (score > res) {
        res = score;
        resP = p;
        resQ = q;
      }
    }
  }
  cout << res << endl;
  vector<int> x, o;
  for (int i = 0; i < resP - 1; ++i)
    o.pb(1);
  o.pb(a - resP + 1);
  for (int i = 0; i < resQ; ++i) {
    if (i < b % resQ)
      x.pb(b / resQ + 1);
    else
      x.pb(b / resQ);
  }
  assert(accumulate(o.begin(), o.end(), 0) == a);
  assert(accumulate(x.begin(), x.end(), 0) == b);
  if (sz(x) > sz(o)) {
    for (int i = 0; i < sz(x); ++i) {
      printf("%s", string(x[i], 'x').c_str());
      if (i < sz(o))
        printf("%s", string(o[i], 'o').c_str());
    }
    printf("\n");
  } else {
    for (int i = 0; i < sz(o); ++i) {
      printf("%s", string(o[i], 'o').c_str());
      if (i < sz(x))
        printf("%s", string(x[i], 'x').c_str());
    }
    printf("\n");
  }
  return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cassert>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) static_cast<void>(0)
#endif
#define endl '\n'
#define sz(c) ((int) (c).size())
#define pb push_back
#define mp make_pair
typedef long long int64;

using namespace std;

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int64 res = 0;
  string out;
  if (a >= b) {
    for (int i = 0; i < b - 2; ++i) {
      out += "xo";
      a--;
    }
    if (b - 1 > 0) {
      out += "x";
      res -= 1;
    }
    out += string(a, 'o');
    res += (int64)a * a;
    if (b > 0) {
      out += "x";
      res -= 1;
    }
  } else {
    int len = b / (a + 1);
    int add = b % (a + 1);
    for (int i = 1; i <= a + 1; ++i) {
      if (add > 0) {
        --add;
        out += string(len + 1, 'x');
        res -= (int64)(len + 1) * (len + 1);
      } else {
        out += string(len, 'x');
        res -= (int64)len * len;
      }
      if (i < a + 1) {
        out += "o";
        res += 1;
      }
    }
  }
  cout << res << endl;
  puts(out.c_str());
  return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cassert>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) static_cast<void>(0)
#endif
#define endl '\n'
#define sz(c) ((int) (c).size())
#define pb push_back
#define mp make_pair
typedef long long int64;

using namespace std;

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int64 res = 0;
  string out;
  if (a >= b) {
    int left = b / 2;
    int right = b - left;
    res -= (int64)left * left;
    out += string(left, 'x');
    res += (int64)a * a;
    out += string(a, 'o');
    res -= (int64)right * right;
    out += string(right, 'x');
    /*
    for (int i = 0; i < b - 2; ++i) {
      out += "xo";
      a--;
    }
    if (b - 1 > 0) {
      out += "x";
      res -= 1;
    }
    out += string(a, 'o');
    res += (int64)a * a;
    if (b > 0) {
      out += "x";
      res -= 1;
    }
    */
  } else {
    int len = b / (a + 1);
    int add = b % (a + 1);
    for (int i = 1; i <= a + 1; ++i) {
      if (add > 0) {
        --add;
        out += string(len + 1, 'x');
        res -= (int64)(len + 1) * (len + 1);
      } else {
        out += string(len, 'x');
        res -= (int64)len * len;
      }
      if (i < a + 1) {
        out += "o";
        res += 1;
      }
    }
  }
  cout << res << endl;
  puts(out.c_str());
  return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cassert>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) static_cast<void>(0)
#endif
#define endl '\n'
#define sz(c) ((int) (c).size())
#define pb push_back
#define mp make_pair
typedef long long int64;

using namespace std;

int64 calc(int a, int b) {
  int len = b / (a + 1);
  int add = b % (a + 1);
  int64 res = 0;
  for (int i = 1; i <= a + 1; ++i) {
    if (add > 0) {
      --add;
      res -= (int64)(len + 1) * (len + 1);
    } else {
      res -= (int64)len * len;
    }
    if (i < a + 1) {
      res += 1;
    }
  }
  return res;
}

string get(int a, int b) {
  int len = b / (a + 1);
  int add = b % (a + 1);
  string out;
  for (int i = 1; i <= a + 1; ++i) {
    if (add > 0) {
      --add;
      out += string(len + 1, 'x');
    } else {
      out += string(len, 'x');
    }
    if (i < a + 1) {
      out += "o";
    }
  }
  return out;
}

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int64 res = 0;
  string out;
  if (a >= b) {
    int left = b / 2;
    int right = b - left;
    res -= (int64)left * left;
    out += string(left, 'x');
    res += (int64)a * a;
    out += string(a, 'o');
    res -= (int64)right * right;
    out += string(right, 'x');

    int64 res2 = res;
    int k = -1;
    for (int i = 0; i < b; ++i) {
      int64 t = calc(i, b) + (int64)(a - i) * (a - i);
      if (t > res2) {
        res2 = t;
        k = i;
      }
    }

    if (res2 > res) {
      res = res2;
      out = get(k, b) + string(a - k, 'o');
    }

    /*
    for (int i = 0; i < b - 2; ++i) {
      out += "xo";
      a--;
    }
    if (b - 1 > 0) {
      out += "x";
      res -= 1;
    }
    out += string(a, 'o');
    res += (int64)a * a;
    if (b > 0) {
      out += "x";
      res -= 1;
    }
    */
  } else {
    res = calc(a, b);
    out = get(a, b);
    int left = b / 2;
    int right = b - left;
    int64 res2 = 0;
    res2 -= (int64)left * left;
    res2 += (int64)a * a;
    res2 -= (int64)right * right;
    if (res2 > res) {
      res = res2;
      out = string();
      out += string(left, 'x');
      out += string(a, 'o');
      out += string(right, 'x');
    }
  }
  cout << res << endl;
  puts(out.c_str());
  return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cassert>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) static_cast<void>(0)
#endif
#define endl '\n'
#define sz(c) ((int) (c).size())
#define pb push_back
#define mp make_pair
typedef long long int64;

using namespace std;

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int64 res = 0;
  string out;
  if (a >= b) {
    for (int i = 0; i < b - 1; ++i) {
      out += "xo";
      a--;
    }
    if (b > 0) {
      out += "x";
      res -= 1;
    }
    out += string(a, 'o');
    res += (int64)a * a;
  } else {
    int len = b / (a + 1);
    int add = b % (a + 1);
    for (int i = 1; i <= a + 1; ++i) {
      if (add > 0) {
        out += string(len + 1, 'x');
        --add;
        res -= (int64)(len + 1) * (len + 1);
      } else {
        out += string(len, 'x');
        res -= (int64)len * len;
      }
      if (i < a + 1) {
        out += "o";
        res += 1;
      }
    }
  }
  cout << res << endl;
  puts(out.c_str());
  return 0;
}


#include <cmath>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
#include <cstring>
#include <cassert>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define eprintf(...) static_cast<void>(0)
#endif
#define endl '\n'
#define sz(c) ((int) (c).size())
#define pb push_back
#define mp make_pair
typedef long long int64;

using namespace std;

int64 calc(int a, int b) {
  int len = b / (a + 1);
  int add = b % (a + 1);
  int64 res = 0;
  for (int i = 1; i <= a + 1; ++i) {
    if (add > 0) {
      --add;
      res -= (int64)(len + 1) * (len + 1);
    } else {
      res -= (int64)len * len;
    }
    if (i < a + 1) {
      res += 1;
    }
  }
  return res;
}

string get(int a, int b) {
  int len = b / (a + 1);
  int add = b % (a + 1);
  string out;
  for (int i = 1; i <= a + 1; ++i) {
    if (add > 0) {
      --add;
      out += string(len + 1, 'x');
    } else {
      out += string(len, 'x');
    }
    if (i < a + 1) {
      out += "o";
    }
  }
  return out;
}

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int64 res = 0;
  string out;
  if (a >= b) {
    int left = b / 2;
    int right = b - left;
    res -= (int64)left * left;
    out += string(left, 'x');
    res += (int64)a * a;
    out += string(a, 'o');
    res -= (int64)right * right;
    out += string(right, 'x');

    int64 res2 = res;
    int k = -1;
    for (int i = 0; i < b; ++i) {
      int64 t = calc(i, b) + (int64)(a - i) * (a - i);
      if (t > res2) {
        res2 = t;
        k = i;
      }
    }

    if (res2 > res) {
      res = res2;
      out = get(k, b) + string(a - k, 'o');
    }

    /*
    for (int i = 0; i < b - 2; ++i) {
      out += "xo";
      a--;
    }
    if (b - 1 > 0) {
      out += "x";
      res -= 1;
    }
    out += string(a, 'o');
    res += (int64)a * a;
    if (b > 0) {
      out += "x";
      res -= 1;
    }
    */
  } else {
    res = calc(a, b);
    out = get(a, b);
    int left = b / 2;
    int right = b - left;
    if (a > 0) {
      int64 res2 = 0;
      res2 -= (int64)left * left;
      res2 += (int64)a * a;
      res2 -= (int64)right * right;
      if (res2 > res) {
        res = res2;
        out = string();
        out += string(left, 'x');
        out += string(a, 'o');
        out += string(right, 'x');
      }
    }
  }
  cout << res << endl;
  puts(out.c_str());
  return 0;
}


#include<bits/stdc++.h>
#define in freopen("input.txt","r",stdin)
#define out freopen("output.txt","w",stdout)

#define inp freopen(".in","r",stdin)
#define outp freopen(".out","w",stdout)

using namespace std;

#define pb push_back
#define pf push_front
#define p_f pop_front
#define p_b pop_back
#define LL long long int
#define LD long double
#define MP make_pair
#define sqr(x) (x*x)
#define fi first
#define dist(x,y,xx,yy) sqrt( (x-xx)*(x-xx)+(y-yy)*(y-yy) )
#define lenint int intsi(int x){ int cnt=0; while(x>0){cnt++;x/=10;} return (cnt); }
#define se second
#define all(v) v.begin(),v.end()
#define sc scanf
#define DEBUG(a) cout<<#a<<" -> "<<a<<endl;
#define pr printf
#define si size()
#define str strlen
#define time clock()/(double)CLOCKS_PER_SEC
#define gcd LL GCD(LL a,LL b){ if(b==0)return a;else return GCD(b,a%b); }
const int INF=(-1u)/2;
const long long int INF2=(-1ull)/2;
long long int a,b,i,d[1011000],j,k,n,m,timer=0,l,r,x,y;
long long int c[1011000],cnt=0,fl=0,a2,a3=-1000000,ans=0;
main()
{
    #ifndef ONLINE_JUDGE
        in;out;
    #endif
    ios_base::sync_with_stdio(0);
    cin>>a>>b;
    if( a!=0 )
    cout<<sqr(a)-sqr(b/2)-sqr((b-b/2))<<endl;
    else
    cout<<-1*sqr(b)<<endl;
    for( i=0;i<b/2;i++ )cout<<"x";
    for( i=0;i<a;i++ )cout<<"o";
    for( i=0;i<b-b/2;i++ )cout<<"x";
    return 0;
}


#include<bits/stdc++.h>
#define in freopen("input.txt","r",stdin)
#define out freopen("output.txt","w",stdout)

#define inp freopen(".in","r",stdin)
#define outp freopen(".out","w",stdout)

using namespace std;

#define pb push_back
#define pf push_front
#define p_f pop_front
#define p_b pop_back
#define LL long long int
#define LD long double
#define MP make_pair
#define sqr(x) (x*x)
#define fi first
#define dist(x,y,xx,yy) sqrt( (x-xx)*(x-xx)+(y-yy)*(y-yy) )
#define lenint int intsi(int x){ int cnt=0; while(x>0){cnt++;x/=10;} return (cnt); }
#define se second
#define all(v) v.begin(),v.end()
#define sc scanf
#define DEBUG(a) cout<<#a<<" -> "<<a<<endl;
#define pr printf
#define si size()
#define str strlen
#define time clock()/(double)CLOCKS_PER_SEC
#define gcd LL GCD(LL a,LL b){ if(b==0)return a;else return GCD(b,a%b); }
const int INF=(-1u)/2;
const long long int INF2=(-1ull)/2;
long long int a,b,i,d[1011000],j,k,n,m,timer=0,l,r,x,y,p,q;
long long int c[1011000],cnt=0,fl=0,a2,a3=-1000000,ans=0,mx;
main()
{
    #ifndef ONLINE_JUDGE
        in;out;
    #endif
    ios_base::sync_with_stdio(0);
    cin>>a>>b;
    n=min(a,b);
    if( a==0 )
    {
        cout<<-sqr(b)<<endl;
        for( i=0;i<b;i++ )cout<<"x";
        return 0;
    }
    else if( b==0 )
    {
        cout<<sqr(a)<<endl;
        for( i=0;i<a;i++ )cout<<"o";
        return 0;
    }
    mx=-(sqr(a)+sqr(b));
    for( p=1;p<=n;p++ )
    {
        for( q=p-1;q<=p+1;q++ )
        {
            if( !(q>0 && q<=b) )continue;
            x=sqr((a-p+1))+(p-1);
            y=(b%q)*sqr((b/q+1))+(q-(b%q))*sqr((b/q));
            if( mx<x-y )
            {
                mx=x-y;
                l=p;
                r=q;
            }
        }
    }
    cout<<mx<<endl;
    if( l<r )
    {
        for( i=0;i<(b/r);i++ )
        {
            cout<<"x";
        }
        b-=(b/r);
        r--;
    }
    for( i=0;i<l+r;i++ )
    {
        if( i%2==0 )
        {
            if(i==0)
            for( j=0;j<a-l+1;j++ )cout<<"o";
            else cout<<"o";
        }
        else
        {
            for( j=0;j<b/r;j++ )cout<<"x";
            if( i/2+1<=b%r )cout<<"x";
        }
    }
    return 0;
}


#include<bits/stdc++.h>
#define in freopen("input.txt","r",stdin)
#define out freopen("output.txt","w",stdout)

#define inp freopen(".in","r",stdin)
#define outp freopen(".out","w",stdout)

using namespace std;

#define pb push_back
#define pf push_front
#define p_f pop_front
#define p_b pop_back
#define LL long long int
#define LD long double
#define MP make_pair
#define sqr(x) (x*x)
#define fi first
#define dist(x,y,xx,yy) sqrt( (x-xx)*(x-xx)+(y-yy)*(y-yy) )
#define lenint int intsi(int x){ int cnt=0; while(x>0){cnt++;x/=10;} return (cnt); }
#define se second
#define all(v) v.begin(),v.end()
#define sc scanf
#define DEBUG(a) cout<<#a<<" -> "<<a<<endl;
#define pr printf
#define si size()
#define str strlen
#define time clock()/(double)CLOCKS_PER_SEC
#define gcd LL GCD(LL a,LL b){ if(b==0)return a;else return GCD(b,a%b); }
const int INF=(-1u)/2;
const long long int INF2=(-1ull)/2;
long long int a,b,i,d[1011000],j,k,n,m,timer=0,l,r,x,y,p,q;
long long int c[1011000],cnt=0,fl=0,a2,a3=-1000000,ans=0,mx;
main()
{
    #ifndef ONLINE_JUDGE
        in;out;
    #endif
    ios_base::sync_with_stdio(0);
    cin>>a>>b;
    n=min(a,b);
    if( a==0 )
    {
        cout<<-sqr(b)<<endl;
        for( i=0;i<b;i++ )cout<<"x";
        return 0;
    }
    else if( b==0 )
    {
        cout<<sqr(a)<<endl;
        for( i=0;i<a;i++ )cout<<"o";
        return 0;
    }
    mx=-(sqr(a)+sqr(b));
    for( p=1;p<=n;p++ )
    {
        for( q=p-1;q<=p+1;q++ )
        {
            if( !(q>0 && q<=b) )continue;
            x=sqr((a-p+1))+(p-1);
            y=(b%q)*sqr((b/q+1))+(q-(b%q))*sqr((b/q));
            if( mx<x-y )
            {
                mx=x-y;
                l=p;
                r=q;
            }
        }
    }
    cout<<mx<<endl;
    if( l<r )
    {
        for( i=0;i<(b/q);i++ )
        {
            cout<<"x";
        }
        b-=(b/q);
        l--;
    }
    for( i=0;i<l+r;i++ )
    {
        if( i%2==0 )
        {
            if(i==0)
            for( j=0;j<a-l+1;j++ )cout<<"o";
            else cout<<"o";
        }
        else
        {
            for( j=0;j<b/r;j++ )cout<<"x";
            if( i/2+1<=b%r )cout<<"x";
        }
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <set>
#include <map>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#define FOR(x, y, z) for (int x = y; x < z; ++x)
#define FORR(x, y, z) for (int x = y; x > z; --x)
#define SORT(a) sort(a.begin(), a.end())
#define SORTR(a) sort(a.rbegin(), a.rend())
#define GET(a, n) for (int i = 0; i < n; ++i) cin >> a[i];
#define GETM(a, n, m) for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) cin >> a[i][j];
#define PRINT(a, n) for (int i = 0; i < n; ++i) cout << a[i] << " ";
#define LL long long
#define ULL unsigned long long
#define VI vector <int>
#define VVI vector <vector<int>>
#define GETSUM(sum, n) sum = 0; for (int i = 0; i < n; ++i) { int tmp; cin >> tmp; sum += tmp; }
#define SUM(a, n, sum) sum = 0; for (int i = 0; i < n; ++i) { sum += a[i]; }
template <class T> typename T::value_type arr_sum(const T& v, int n) { typename T::value_type sum = 0; FOR(i, 0, n) sum += v[i]; return sum; }
template <class T> typename T::value_type arr_count(const T& v, int n, int t) { typename T::value_type count = 0; FOR(i, 0, n) count += v[i] == t; return count; }
template <class T> typename T::value_type arr_maxi(const T& v, int n) { typename T::value_type maxi = 0; FOR(i, 1, n) if (v[maxi] < v[i]) maxi = i; return maxi; }
template <class T> typename T::value_type arr_mini(const T& v, int n) { typename T::value_type mini = 0; FOR(i, 1, n) if (v[mini] > v[i]) mini = i; return mini; }
template <class T> typename T::value_type arr_max(const T& v, int n) { typename T::value_type max = v[0]; FOR(i, 1, n) if (max < v[i]) max = v[i]; return max; }
template <class T> typename T::value_type arr_min(const T& v, int n) { typename T::value_type min = v[0]; FOR(i, 1, n) if (min > v[i]) min = v[i]; return min; }

using namespace std;

int main()
{
    int a, b;
    string s;
    cin >> a >> b;
    if (a == 0) {
        cout << - b * b << endl;
        FOR(i, 0, b) {
            s += 'x';
        }
        cout << s << endl;
        return 0;
    }
    LL maxi = -1, max = -1000000000001;
    FOR(i, 0, a) {
        LL q = i + 2;
        LL sum = (b / q) * (b / q) * (q - b % q) + (b / q + 1) * (b / q + 1) * (b % q);
        if ((LL)(a - i) * (a - i) + i - sum > max) {
            max = (LL)(a - i) * (a - i) + i - sum;
            maxi = i;
        }
    }
    cout << max << endl;
    int q = maxi + 2;
    FOR(i, 0, q) {
        if (i < b % q) {
            FOR(k, 0, b / q + 1)
                cout << 'x';
        } else {
            FOR(k, 0, b / q)
                cout << 'x';
        }
        if (i < q - 2) {
            cout << 'o';
        } else if (i == q - 2) {
            FOR(i, 0, a - maxi) {
                cout << 'o';
            }
        }
    }
}


#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <set>
#include <map>
#include <cstdio>
#include <string>
#include <cstring>
#include <cstdlib>
#include <cmath>
#define FOR(x, y, z) for (int x = y; x < z; ++x)
#define FORR(x, y, z) for (int x = y; x > z; --x)
#define SORT(a) sort(a.begin(), a.end())
#define SORTR(a) sort(a.rbegin(), a.rend())
#define GET(a, n) for (int i = 0; i < n; ++i) cin >> a[i];
#define GETM(a, n, m) for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) cin >> a[i][j];
#define PRINT(a, n) for (int i = 0; i < n; ++i) cout << a[i] << " ";
#define LL long long
#define ULL unsigned long long
#define VI vector <int>
#define VVI vector <vector<int>>
#define GETSUM(sum, n) sum = 0; for (int i = 0; i < n; ++i) { int tmp; cin >> tmp; sum += tmp; }
#define SUM(a, n, sum) sum = 0; for (int i = 0; i < n; ++i) { sum += a[i]; }
template <class T> typename T::value_type arr_sum(const T& v, int n) { typename T::value_type sum = 0; FOR(i, 0, n) sum += v[i]; return sum; }
template <class T> typename T::value_type arr_count(const T& v, int n, int t) { typename T::value_type count = 0; FOR(i, 0, n) count += v[i] == t; return count; }
template <class T> typename T::value_type arr_maxi(const T& v, int n) { typename T::value_type maxi = 0; FOR(i, 1, n) if (v[maxi] < v[i]) maxi = i; return maxi; }
template <class T> typename T::value_type arr_mini(const T& v, int n) { typename T::value_type mini = 0; FOR(i, 1, n) if (v[mini] > v[i]) mini = i; return mini; }
template <class T> typename T::value_type arr_max(const T& v, int n) { typename T::value_type max = v[0]; FOR(i, 1, n) if (max < v[i]) max = v[i]; return max; }
template <class T> typename T::value_type arr_min(const T& v, int n) { typename T::value_type min = v[0]; FOR(i, 1, n) if (min > v[i]) min = v[i]; return min; }

using namespace std;

int main()
{
    int a, b;
    string s;
    long long res = 0;
    cin >> a >> b;
    if (a == 0) {
        cout << - b * b << endl;
        FOR(i, 0, b) {
            s += 'x';
        }
        cout << s << endl;
        return 0;
    }
    FOR (i, 0, b / 2) {
        s += 'x';
    }
    res -= (b / 2) * (b / 2);
    FOR (i, 0, a) {
        s += 'o';
    }
    res += a * a;
    FOR (i, b / 2, b) {
        s += 'x';
    }
    res -= (b - b / 2) * (b - b / 2);
    cout << res << endl << s << endl;
}


#include <iostream>

using namespace std;

#define FOR(i,b,e) for(int i=(b); i<=(e); ++i)
#define REP(n) FOR(itt,1,n)

#define MIN(x,y) ( (x<=y)? x : y )
#define sqr(x) ( (x) * (x) )

typedef long double ld;

int main()
{
    ios_base::sync_with_stdio(0);

    int a, b;
    cin >> a >> b;

    if (!a)
    {
        cout << -sqr(b) << '\n';
        REP(b) cout << 'x';
    }
    else if (!b)
    {
        cout << sqr(a) << '\n';
        REP(a) cout << 'o';
    }
    else if (b == 1)
    {
        cout << sqr(a)-1 << '\n';
        cout << 'x';
        REP(a) cout << 'o';
    }
    else
    {
        int best_n, best_val = -sqr(b);

        FOR(n,2,MIN(b,a+1))
        {
            int val_a, k, r, val_b, val;

            val_a = n - 2 + sqr(a - n + 2);

            k = b / n;
            r = b - n * k;
            val_b = r * sqr(k+1) + (n-r) * sqr(k);

            val = val_a - val_b;

            if (val > best_val)
            {
                best_val = val;
                best_n = n;
            }
        }

        cout << best_val << '\n';

        int k = b / best_n, r = b - best_n * k;
        FOR(i,1,best_n-1)
        {
            REP(k + (r > 0)) cout << 'x';
            if (r) --r;

            if (i < best_n-1) cout << 'o';
            else REP(a-best_n+2) cout << 'o';
        }
        REP(k + (r > 0)) cout << 'x';
    }

    return 0;
}


#include <iostream>

using namespace std;

#define FOR(i,b,e) for(int i=(b); i<=(e); ++i)
#define REP(n) FOR(itt,1,n)

#define MIN(x,y) ( (x<=y)? x : y )
#define sqr(x) ( (x) * (x) )

typedef long long int lli;

int main()
{
    ios_base::sync_with_stdio(0);

    lli a, b;
    cin >> a >> b;

    if (!a)
    {
        cout << -sqr(b) << '\n';
        REP(b) cout << 'x';
    }
    else if (!b)
    {
        cout << sqr(a) << '\n';
        REP(a) cout << 'o';
    }
    else if (b == 1)
    {
        cout << sqr(a)-1 << '\n';
        cout << 'x';
        REP(a) cout << 'o';
    }
    else
    {
        lli best_n, best_val = -sqr(b);

        FOR(n,2,MIN(b,a+1))
        {
            lli val_a, k, r, val_b, val;

            val_a = n - 2 + sqr(a - n + 2);

            k = b / n;
            r = b - n * k;
            val_b = r * sqr(k+1) + (n-r) * sqr(k);

            val = val_a - val_b;

            if (val > best_val)
            {
                best_val = val;
                best_n = n;
            }
        }

        cout << best_val << '\n';

        lli k = b / best_n, r = b - best_n * k;
        FOR(i,1,best_n-1)
        {
            REP(k + (r > 0)) cout << 'x';
            if (r) --r;

            if (i < best_n-1) cout << 'o';
            else REP(a-best_n+2) cout << 'o';
        }
        REP(k + (r > 0)) cout << 'x';
    }

    return 0;
}


#include <stdio.h>

#define INF	((long long) 1e18)

int main() {
	long long v;
	int a, b, i;

	scanf("%d%d", &a, &b);
	if (a == 0 || b == 0) {
		v = (long long) a * a - (long long) b * b;
		printf("%lld\n", v);
		for (i = 0; i < a; i++)
			printf("o");
		for (i = 0; i < b; i++)
			printf("x");
		printf("\n");
	} else {
		int c, k, qb, rb, r;
		long long va, vb;
		int k_;

		c = a < b ? a : b;
		v = -INF, k_ = -1;
		for (k = 1; k <= c; k++) {
			qb = b / (k + 1);
			rb = b % (k + 1);
			va = (a - k + 1) * (a - k + 1) + k - 1;
			vb = (long long) rb * (qb + 1) * (qb + 1) + (long long) (k + 1 - rb) * qb * qb;
			if (v < va - vb) {
				v = va - vb;
				k_ = k;
			}
		}
		qb = b / (k_ + 1);
		rb = b % (k_ + 1);
		printf("%lld\n", v);
		for (r = 0; r <= k_; r++) {
			if (r < rb)
				printf("x");
			for (i = 0; i < qb; i++)
				printf("x");
			if (r < k_) {
				if (r == 0)
					for (i = 0; i < a - k_ + 1; i++)
						printf("o");
				else
					printf("o");
			}
		}
		printf("\n");
	}
	return 0;
}


#include <stdio.h>

#define INF	((long long) 1e18)

long long max, xmax, ymax;

long long sqr(int x) {
	return (long long) x * x;
}

void print(int a, int b, int x, int y) {
	int k1, k2, i, b_;

	b_ = y == 0 ? 0 : b % y;
	k1 = a - x + 1;
	k2 = y == 0 ? 0 : b / y + 1;
	while (x + y > 0) {
		if (x >= y) {
			for (i = 0; i < k1; i++)
				printf("o");
			k1 = 1;
			x--;
		} else {
			if (b_ == 0)
				k2--;
			for (i = 0; i < k2; i++)
				printf("x");
			b_--;
			y--;
		}
	}
	printf("\n");
}

void solve(int a, int b, int x, int y) {
	long long p1, p2, q1, q2, sum;

	if ((x == 0 && a > 0) || (y == 0 && b > 0) || x > a || y > b)
		return;
	p1 = p2 = q1 = q2 = 0;
	if (a > 0) {
		p1 = sqr(a - x + 1);
		p2 = x - 1;
	}
	if (b > 0) {
		q1 = b % y * sqr(b / y + 1);
		q2 = (y - b % y) * sqr(b / y);
	}
	sum = p1 + p2 - q1 - q2;
	if (max < sum) {
		max = sum;
		xmax = x;
		ymax = y;
	}
}

int main() {
	int a, b, x;

	scanf("%d%d", &a, &b);
	max = -INF;
	xmax = ymax = -1;
	for (x = 0; x <= a && x <= b; x++) {
		solve(a, b, x, x);
		solve(a, b, x + 1, x);
		solve(a, b, x, x + 1);
	}
	printf("%lld\n", max);
	print(a, b, xmax, ymax);
	return 0;
}


#include <stdio.h>

#define INF	((long long) 1e18)

int main() {
	long long v;
	int a, b, i;

	scanf("%d%d", &a, &b);
	if (a == 0 || b == 0) {
		v = (long long) a * a - (long long) b * b;
		printf("%lld\n", v);
		for (i = 0; i < a; i++)
			printf("o");
		for (i = 0; i < b; i++)
			printf("x");
		printf("\n");
	} else {
		int c, k, qb, rb, r;
		long long va, vb;
		int k_;

		c = a < b ? a : b;
		v = -INF, k_ = -1;
		for (k = 1; k <= c; k++) {
			qb = b / (k + 1);
			rb = b % (k + 1);
			va = (long long) (a - k + 1) * (a - k + 1) + k - 1;
			vb = (long long) rb * (qb + 1) * (qb + 1) + (long long) (k + 1 - rb) * qb * qb;
			if (v < va - vb) {
				v = va - vb;
				k_ = k;
			}
		}
		qb = b / (k_ + 1);
		rb = b % (k_ + 1);
		printf("%lld\n", v);
		for (r = 0; r <= k_; r++) {
			if (r < rb)
				printf("x");
			for (i = 0; i < qb; i++)
				printf("x");
			if (r < k_) {
				if (r == 0)
					for (i = 0; i < a - k_ + 1; i++)
						printf("o");
				else
					printf("o");
			}
		}
		printf("\n");
	}
	return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
    long long a,b,n,i,j,k=0,rec=1,fro;
    long long P,N=0,score,temp;
    scanf("%I64d%I64d",&a,&b);
    score=a*a-b*b;
    for(n=1; n<=a; n++)
    {
        P=(n-1)+(a-n+1)*(a-n+1);
        temp=b/(n+1);
        N=((n+1)*(temp+1)-b)*temp*temp+(temp+1)*(temp+1)*(b-temp*(n+1));
        temp=P-N;
        if(temp>score)
        {
            score=temp;
            rec=n;
        }
    }
    printf("%I64d\n",score);
    k=b/(rec+1);
    fro=(rec+1)*(b/(rec+1)+1)-b;
    for(i=1; i<=k; i++)
        printf("x");
    for(i=1; i<rec; i++)
    {
        printf("o");
        for(j=1; j<=k; j++)
            printf("x");
        if(i>=fro)
            printf("x");
    }
    for(i=1; i<=a-rec+1; i++)
        printf("o");
    for(i=1; i<=k; i++)
        printf("x");
    if(rec+1>fro)
        printf("x");
    return 0;
}


#include<stdio.h>
#include<math.h>
int main()
{
    int a,b,n,i,j,k=0,rec=1,fro;
    long long P,N=0,score,temp;
    scanf("%d%d",&a,&b);
    score=a*a-b*b;
    for(n=1; n<=a; n++)
    {
        P=(n-1)+(a-n+1)*(a-n+1);
        temp=b/(n+1);
        N=((n+1)*(temp+1)-b)*temp*temp+(temp+1)*(temp+1)*(b-temp*(n+1));
        temp=P-N;
        if(temp>score)
        {
            score=temp;
            rec=n;
        }
    }
    printf("%I64d\n",score);
    k=b/(rec+1);
    fro=(rec+1)*(b/(rec+1)+1)-b;
    for(i=1; i<=k; i++)
        printf("x");
    for(i=1; i<rec; i++)
    {
        printf("o");
        for(j=1; j<=k; j++)
            printf("x");
        if(i>=fro)
            printf("x");
    }
    for(i=1; i<=a-rec+1; i++)
        printf("o");
    for(i=1; i<=k; i++)
        printf("x");
    if(rec+1>fro)
        printf("x");
    return 0;
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int a = sc.nextInt(), b = sc.nextInt();
		String s;
		StringBuilder sb = new StringBuilder();
		long max = 1l * a * a - b * b;
		int in = 0;
		for(int i = 1; i <= a; ++i)
		{
			int d = (b + i) / (i + 1);
			long cur = sq(a - i + 1) + i - 1 - (i * sq(d) + sq(b - d * i));
			if(cur > max)
			{
				in = i;
				max = cur;
			}
		}
		boolean done = false;
		if(in == 0)
			for(int i = 0; i < b; ++i)
				sb.append("x");
		else
		{
			int d = (b + in) / (in + 1);
			for(int i = 0; i < in; ++i)
			{
				for(int j = 0; j < d; ++j)
					sb.append("x");
				sb.append("o");
				if(!done)
				{
					for(int j = in; j < a; ++j)
						sb.append("o");
					done = true;
				}
			}
			d = b - d * in;
			for(int i = 0; i < d; ++i)
				sb.append("x");
		}
		if(!done)
			for(int i = in; i < a; ++i)
				sb.append("o");
		s = sb.toString();
		out.println(max);
		out.println(s);
		out.flush();
		out.close();
	}

	static long sq(long x) { return x * x; }

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int a = sc.nextInt(), b = sc.nextInt();
		String s;
		StringBuilder sb = new StringBuilder();
		long max = sq(a) - sq(b);
		int in = 0;
		for(int i = 1; i <= a; ++i)
		{
			int d = (b + i) / (i + 1);
			long cur = sq(a - i + 1) + i - 1 - (i * sq(d) + sq(b - d * i));
			if(cur > max)
			{
				in = i;
				max = cur;
			}
		}
		boolean done = false;
		if(in == 0)
			for(int i = 0; i < b; ++i)
				sb.append("x");
		else
		{
			int d = (b + in) / (in + 1);
			for(int i = 0; i < in; ++i)
			{
				for(int j = 0; j < d; ++j)
					sb.append("x");
				sb.append("o");
				if(!done)
				{
					for(int j = in; j < a; ++j)
						sb.append("o");
					done = true;
				}
			}
			d = b - d * in;
			for(int i = 0; i < d; ++i)
				sb.append("x");
		}
		if(!done)
			for(int i = in; i < a; ++i)
				sb.append("o");
		s = sb.toString();
		out.println(max);
		out.println(s);
		out.flush();
		out.close();
	}

	static long sq(long x) { return x * x; }

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int a = sc.nextInt(), b = sc.nextInt();
		StringBuilder sb = new StringBuilder();
		long max = sq(a) - sq(b);
		int in = 0;
		for(int i = 1; i <= Math.min(a, b - 1); ++i)
		{
			int d = b / (i + 1), m = b % (i + 1);
			long cur = sq(a - i + 1) + i - 1 - (m * sq(d + 1) + (i + 1 - m) * sq(d));
			if(cur > max)
			{
				in = i;
				max = cur;
			}
		}
		boolean done = false;
		if(in == 0)
			for(int i = 0; i < b; ++i)
				sb.append("x");
		else
		{
			int d = b / (in + 1), m = b % (in + 1);
			for(int i = 0; i < in; ++i)
			{
				for(int j = 0, end = m-->0 ? d + 1 : d; j < end; ++j)
					sb.append("x");
				sb.append("o");
				if(!done)
				{
					for(int j = in; j < a; ++j)
						sb.append("o");
					done = true;
				}
			}
			for(int i = 0; i < d; ++i)
				sb.append("x");
		}
		if(!done)
			for(int i = in; i < a; ++i)
				sb.append("o");
		out.println(max);
		out.println(sb);
		out.flush();
		out.close();
	}

	static long sq(long x) { return x * x; }

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class B {

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int a = sc.nextInt(), b = sc.nextInt();
		String s;
		if(a >= b)
		{
			StringBuilder sb = new StringBuilder();
			for(int i = 0; i < b; ++i)
				sb.append("x");
			for(int i = 0; i < a; ++i)
				sb.append("o");
			s = sb.toString();
		}
		else
		{
			StringBuilder sb = new StringBuilder();
			if(a == 0)
				for(int i = 0; i < b; ++i)
					sb.append("x");
			else
			{
				int d = (b + a) / (a + 1);
				for(int i = 0; i < a; ++i)
				{
					for(int j = 0; j < d; ++j)
						sb.append("x");
					sb.append("o");
				}
				d = b - d * a;
				for(int i = 0; i < d; ++i)
					sb.append("x");
			}
			s = sb.toString();
		}
		out.println(calc(s));
		out.println(s);
		out.flush();
		out.close();
	}

	static long calc(String s)
	{
		long x = 0, o = 0, ans = 0;
		for(int i = 0; i < s.length(); ++i)
		{
			if(s.charAt(i) == 'x')
			{
				++x;
				ans += o * o;
				o = 0;
			}
			else
			{
				++o;
				ans -= x * x;
				x = 0;
			}
		}
		ans += o * o - x * x;
		return ans;
	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int a = sc.nextInt(), b = sc.nextInt();
		StringBuilder sb = new StringBuilder();
		long max = sq(a) - sq(b);
		int in = 0;
		for(int i = 1; i <= Math.min(a, b - 1); ++i)
		{
			int d = (b + i) / (i + 1);
			long cur = sq(a - i + 1) + i - 1 - (i * sq(d) + sq(b - d * i));
			if(cur > max)
			{
				in = i;
				max = cur;
			}
		}
		boolean done = false;
		if(in == 0)
			for(int i = 0; i < b; ++i)
				sb.append("x");
		else
		{
			int d = (b + in) / (in + 1);
			for(int i = 0; i < in; ++i)
			{
				for(int j = 0; j < d; ++j)
					sb.append("x");
				sb.append("o");
				if(!done)
				{
					for(int j = in; j < a; ++j)
						sb.append("o");
					done = true;
				}
			}
			d = b - d * in;
			for(int i = 0; i < d; ++i)
				sb.append("x");
		}
		if(!done)
			for(int i = in; i < a; ++i)
				sb.append("o");
		out.println(max);
		out.println(sb);
		out.flush();
		out.close();
	}

	static long sq(long x) { return x * x; }

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int a = sc.nextInt(), b = sc.nextInt();
		String s;
		StringBuilder sb = new StringBuilder();
		long max = 1l * a * a - b * b;
		int in = 0;
		for(int i = 1; i <= a; ++i)
		{
			int d = (b + i) / (i + 1);
			long cur = sq(a - i) + i - (i * sq(d) + sq(b - d * i));
			if(cur > max)
			{
				in = i;
				max = cur;
			}
		}
		if(in == 0)
			for(int i = 0; i < b; ++i)
				sb.append("x");
		else
		{
			int d = (b + in) / (in + 1);
			for(int i = 0; i < in; ++i)
			{
				for(int j = 0; j < d; ++j)
					sb.append("x");
				sb.append("o");
			}
			d = b - d * in;
			for(int i = 0; i < d; ++i)
				sb.append("x");
		}
		for(int i = in; i < a; ++i)
			sb.append("o");
		s = sb.toString();
		out.println(max);
		out.println(s);
		out.flush();
		out.close();
	}

	static long sq(long x) { return x * x; }

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int a = sc.nextInt(), b = sc.nextInt();
		String s;
		if(a >= b)
		{
			StringBuilder sb = new StringBuilder();
			for(int i = 0; i < b; ++i)
				sb.append("x");
			for(int i = 0; i < a; ++i)
				sb.append("o");
			s = sb.toString();
		}
		else
		{
			StringBuilder sb = new StringBuilder();
			if(a == 0)
				for(int i = 0; i < b; ++i)
					sb.append("x");
			else
			{
				int d = (b + a) / (a + 1);
				for(int i = 0; i < a; ++i)
				{
					for(int j = 0; j < d; ++j)
						sb.append("x");
					sb.append("o");
				}
				d = b - d * a;
				for(int i = 0; i < d; ++i)
					sb.append("x");
			}
			s = sb.toString();
		}
		out.println(calc(s));
		out.println(s);
		out.flush();
		out.close();
	}

	static long calc(String s)
	{
		long x = 0, o = 0, ans = 0;
		for(int i = 0; i < s.length(); ++i)
		{
			if(s.charAt(i) == 'x')
			{
				++x;
				ans += o * o;
				o = 0;
			}
			else
			{
				++o;
				ans -= x * x;
				x = 0;
			}
		}
		ans += o * o - x * x;
		return ans;
	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class A {

	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int a = sc.nextInt(), b = sc.nextInt();
		StringBuilder sb = new StringBuilder();
		long max = sq(a) - sq(b);
		int in = 0;
		for(int i = 1; i <= Math.min(a, b - 1); ++i)
		{
			int d = b / (i + 1), m = b % (i + 1);
			long cur = sq(a - i + 1) + i - 1 - (m * sq(d + 1) + (i + 1 - m) * sq(d));
			if(cur > max)
			{
				in = i;
				max = cur;
			}
		}
		boolean done = false;
		if(in == 0)
			for(int i = 0; i < b; ++i)
				sb.append("x");
		else
		{
			int d = (b + in) / (in + 1);
			for(int i = 0; i < in; ++i)
			{
				for(int j = 0; j < d; ++j)
					sb.append("x");
				sb.append("o");
				if(!done)
				{
					for(int j = in; j < a; ++j)
						sb.append("o");
					done = true;
				}
			}
			d = b - d * in;
			for(int i = 0; i < d; ++i)
				sb.append("x");
		}
		if(!done)
			for(int i = in; i < a; ++i)
				sb.append("o");
		out.println(max);
		out.println(sb);
		out.flush();
		out.close();
	}

	static long sq(long x) { return x * x; }

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(FileReader r){	br = new BufferedReader(r);}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;
/*

 */
public class b
{
	public static void main(String[] arg) throws Exception
	{
		new b();
	}
	public b() throws Exception
	{
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		long a = in.nextLong();
		long b = in.nextLong();
		if(a == 0)
		{
			System.out.println("-"+(b*b));
			for(int i = 0; i < b; i++) System.out.print('x');
		}
		else if(b == 0)
		{
			System.out.println((a*a));
			for(int i = 0; i < a; i++) System.out.print('o');
		}
		else
		{
			long[] p = new long[(int)a+1];
			for(int i = 1; i < p.length; i++)
			{
				p[i] = (a-i+1)*(a-i+1)+(i-1);
			}
			long[] q = new long[(int)b+1];
			for(int i = 1; i < q.length; i++)
			{
				//int min = (int)Math.min(i-b%i, b%i);
				//int max = i-min;
				q[i] = (b/i)*(b/i)*(i-b%i)+(b/i+1)*(b/i+1)*(b%i);
			}
			long ret = Long.MIN_VALUE;
			int op1 = -1;
			int op2 = -1;
			for(int i = 1; i < p.length; i++)
			{
				if(p[i]-q[i] > ret)
				{
					ret = p[i]-q[i];
					op1 = i;
					op2 = i;
				}
				if(i-1 > 0 && p[i]-q[i-1] > ret)
				{
					ret = p[i]-q[i-1];
					op1 = i;
					op2 = i-1;
				}
				if(i+1 < q.length && p[i]-q[i+1] > ret)
				{
					ret = p[i]-q[i+1];
					op1 = i;
					op2 = i+1;
				}
			}
			System.out.println(ret);
//			System.out.println(op1 + " " + op2);
//			System.out.println(p[op1] + " " + q[op2]);
			ArrayList<String> red = new ArrayList<String>();
			StringBuilder temp = new StringBuilder();
			for(int i = 0; i < a-op1+1; i++) temp.append('o');
			red.add(temp.toString());
			for(int i = 1; i < op1; i++)
			{
				StringBuilder sb = new StringBuilder();
				sb.append('o');
				red.add(sb.toString());
			}
			ArrayList<String> blue = new ArrayList<String>();
			for(int i = 0; i < b%op2; i++)
			{
				StringBuilder sb = new StringBuilder();
				for(int j = 0; j < b/op2+1; j++) sb.append('x');
				blue.add(sb.toString());
			}
			for(int i = 0; i < op2-b%op2; i++)
			{
				StringBuilder sb = new StringBuilder();
				for(int j = 0; j < b/op2; j++) sb.append('x');
				blue.add(sb.toString());
			}
			for(int i = 0; i < op1+op2; i++)
			{
				//System.out.println(i);
				if(op1 > op2)
				{
					if(i%2 == 0) System.out.print(red.get(i/2));
					else System.out.print(blue.get(i/2));
				}
				else
				{
					if(i%2 == 1)
						System.out.print(red.get(i/2));
					else System.out.print(blue.get(i/2));
				}
			}
		}
		in.close(); out.close();
	}
	class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in)
		{
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}
		public String next() throws IOException
		{
			while(!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}
		public void close() throws IOException
		{
			br.close();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
	}
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;
/*

 */
public class b
{
	public static void main(String[] arg) throws Exception
	{
		new b();
	}
	public b() throws Exception
	{
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		long a = in.nextLong();
		long b = in.nextLong();
		if(a == 0)
		{
			System.out.println("-"+(b*b));
			for(int i = 0; i < b; i++) System.out.print('x');
		}
		else if(b == 0)
		{
			System.out.println((a*a));
			for(int i = 0; i < a; i++) System.out.print('o');
		}
		else
		{
			long[] p = new long[(int)a+1];
			for(int i = 1; i < p.length; i++)
			{
				p[i] = (a-i+1)*(a-i+1)+(i-1);
			}
			long[] q = new long[(int)b+1];
			for(int i = 1; i < q.length; i++)
			{
				long min = Math.min(b%i, b-b%i);
				long max = b-min;
				q[i] = (b/i)*(b/i)*(max)+(b/i+1)*(b/i+1)*(min);
			}
			long ret = Long.MIN_VALUE;
			int op1 = -1;
			int op2 = -1;
			for(int i = 1; i < p.length; i++)
			{
				if(p[i]-q[i] > ret)
				{
					ret = p[i]-q[i];
					op1 = i;
					op2 = i;
				}
				if(i-1 > 0 && p[i]-q[i-1] > ret)
				{
					ret = p[i]-q[i-1];
					op1 = i;
					op2 = i-1;
				}
				if(i+1 < q.length && p[i]-q[i+1] > ret)
				{
					ret = p[i]-q[i+1];
					op1 = i;
					op2 = i+1;
				}
			}
			System.out.println(ret);
			ArrayList<String> red = new ArrayList<String>();
			StringBuilder temp = new StringBuilder();
			for(int i = 0; i < a-op1+1; i++) temp.append('o');
			red.add(temp.toString());
			for(int i = 1; i < op1; i++)
			{
				StringBuilder sb = new StringBuilder();
				sb.append('o');
				red.add(sb.toString());
			}
			ArrayList<String> blue = new ArrayList<String>();
			int min = (int)Math.max(b%op2, b-b%op2);
			int max = (int)b-min;
			System.out.println(min + " " + max);
			for(int i = 0; i < op2; i++)
			{
				StringBuilder sb = new StringBuilder();
				for(int j = 0; j < b/op2; j++) sb.append('x');
				if(i >= min) sb.append('x');
				blue.add(sb.toString());
			}
			//System.out.println(blue.size());
			for(int i = 0; i < op1+op2; i++)
			{
				//System.out.println(i);
				if(op1 > op2)
				{
					if(i%2 == 0) System.out.print(red.get(i/2));
					else System.out.print(blue.get(i/2));
				}
				else
				{
					if(i%2 == 1)
						System.out.print(red.get(i/2));
					else System.out.print(blue.get(i/2));
				}
			}
		}
		in.close(); out.close();
	}
	class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in)
		{
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}
		public String next() throws IOException
		{
			while(!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}
		public void close() throws IOException
		{
			br.close();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
	}
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;
/*

 */
public class b
{
	public static void main(String[] arg) throws Exception
	{
		new b();
	}
	public b() throws Exception
	{
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		long a = in.nextLong();
		long b = in.nextLong();
		if(a == 0)
		{
			System.out.println("-"+(b*b));
			for(int i = 0; i < b; i++) System.out.print('x');
		}
		else if(b == 0)
		{
			System.out.println((a*a));
			for(int i = 0; i < a; i++) System.out.print('o');
		}
		else
		{
			long[] p = new long[(int)a+1];
			for(int i = 1; i < p.length; i++)
			{
				p[i] = (a-i+1)*(a-i+1)+(i-1);
			}
			long[] q = new long[(int)b+1];
			for(int i = 1; i < q.length; i++)
			{
				long min = Math.min(b%i, b-b%i);
				long max = b-min;
				q[i] = (b/i)*(b/i)*(max)+(b/i+1)*(b/i+1)*(min);
			}
			long ret = Long.MIN_VALUE;
			int op1 = -1;
			int op2 = -1;
			for(int i = 1; i < p.length; i++)
			{
				if(p[i]-q[i] > ret)
				{
					ret = p[i]-q[i];
					op1 = i;
					op2 = i;
				}
				if(i-1 > 0 && p[i]-q[i-1] > ret)
				{
					ret = p[i]-q[i-1];
					op1 = i;
					op2 = i-1;
				}
				if(i+1 < q.length && p[i]-q[i+1] > ret)
				{
					ret = p[i]-q[i+1];
					op1 = i;
					op2 = i+1;
				}
			}
			System.out.println(ret);
			ArrayList<String> red = new ArrayList<String>();
			StringBuilder temp = new StringBuilder();
			for(int i = 0; i < a-op1+1; i++) temp.append('o');
			red.add(temp.toString());
			for(int i = 1; i < op1; i++)
			{
				StringBuilder sb = new StringBuilder();
				sb.append('o');
				red.add(sb.toString());
			}
			ArrayList<String> blue = new ArrayList<String>();
			int min = (int)Math.max(b%op2, b-b%op2);
			int max = (int)b-min;
			//System.out.println(min + " " + max);
			for(int i = 0; i < op2; i++)
			{
				StringBuilder sb = new StringBuilder();
				for(int j = 0; j < b/op2; j++) sb.append('x');
				if(i >= min) sb.append('x');
				blue.add(sb.toString());
			}
			//System.out.println(blue.size());
			for(int i = 0; i < op1+op2; i++)
			{
				//System.out.println(i);
				if(op1 > op2)
				{
					if(i%2 == 0) System.out.print(red.get(i/2));
					else System.out.print(blue.get(i/2));
				}
				else
				{
					if(i%2 == 1)
						System.out.print(red.get(i/2));
					else System.out.print(blue.get(i/2));
				}
			}
		}
		in.close(); out.close();
	}
	class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in)
		{
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}
		public String next() throws IOException
		{
			while(!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}
		public void close() throws IOException
		{
			br.close();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
	}
}


import java.util.*;
import java.io.*;
import java.math.BigInteger;
/*
8 6

46
 */
public class b
{
	public static void main(String[] arg) throws Exception
	{
		new b();
	}
	public b() throws Exception
	{
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		long a = in.nextLong();
		long b = in.nextLong();
		if(a == 0)
		{
			System.out.println("-"+(b*b));
			for(int i = 0; i < b; i++) System.out.print('x');
		}
		else if(b == 0)
		{
			System.out.println((a*a));
			for(int i = 0; i < a; i++) System.out.print('o');
		}
		else
		{
			long[] p = new long[(int)a+1];
			for(int i = 1; i < p.length; i++)
			{
				p[i] = (a-i+1)*(a-i+1)+(i-1);
			}
			long[] q = new long[(int)b+1];
			for(int i = 1; i < q.length; i++)
			{
				//int min = (int)Math.min(i-b%i, b%i);
				//int max = i-min;
				q[i] = (b/i)*(b/i)*(i-b%i)+(b/i+1)*(b/i+1)*(b%i);
			}
			long ret = Long.MIN_VALUE;
			int op1 = -1;
			int op2 = -1;
			for(int i = 1; i < p.length; i++)
			{
				if(i < q.length && p[i]-q[i] > ret)
				{
					ret = p[i]-q[i];
					op1 = i;
					op2 = i;
				}
				if(i-1 > 0 && i-1 < q.length && p[i]-q[i-1] > ret)
				{
					ret = p[i]-q[i-1];
					op1 = i;
					op2 = i-1;
				}
				if(i+1 < q.length && i+1 > 0 && p[i]-q[i+1] > ret)
				{
					ret = p[i]-q[i+1];
					op1 = i;
					op2 = i+1;
				}
			}
			System.out.println(ret);
//			System.out.println(op1 + " " + op2);
//			System.out.println(p[op1] + " " + q[op2]);
			ArrayList<String> red = new ArrayList<String>();
			StringBuilder temp = new StringBuilder();
			for(int i = 0; i < a-op1+1; i++) temp.append('o');
			red.add(temp.toString());
			for(int i = 1; i < op1; i++)
			{
				StringBuilder sb = new StringBuilder();
				sb.append('o');
				red.add(sb.toString());
			}
			ArrayList<String> blue = new ArrayList<String>();
			for(int i = 0; i < b%op2; i++)
			{
				StringBuilder sb = new StringBuilder();
				for(int j = 0; j < b/op2+1; j++) sb.append('x');
				blue.add(sb.toString());
			}
			for(int i = 0; i < op2-b%op2; i++)
			{
				StringBuilder sb = new StringBuilder();
				for(int j = 0; j < b/op2; j++) sb.append('x');
				blue.add(sb.toString());
			}
			for(int i = 0; i < op1+op2; i++)
			{
				//System.out.println(i);
				if(op1 > op2)
				{
					if(i%2 == 0) System.out.print(red.get(i/2));
					else System.out.print(blue.get(i/2));
				}
				else
				{
					if(i%2 == 1)
						System.out.print(red.get(i/2));
					else System.out.print(blue.get(i/2));
				}
			}
		}
		in.close(); out.close();
	}
	class FastScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in)
		{
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}
		public String next() throws IOException
		{
			while(!st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
		}
		public void close() throws IOException
		{
			br.close();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class Cards {
    void solve() {
        int a = in.nextInt(), b = in.nextInt();

        if (a >= b) {
            long ans = (long) a * a;
            int x = 0, y = 0;
            if (b > 0) {
                x = b / 2;
                y = b - x;
                ans -= (long) x * x + (long) y * y;
            }

            out.println(ans);
            for (int i = 0; i < x; i++) out.print('x');
            for (int i = 0; i < a; i++) out.print('o');
            for (int i = 0; i < y; i++) out.print('x');
        } else {
            int d = b - a - 1;
            int up = d / (a + 1);
            int x = d % (a + 1), y = a + 1 - x;
            long ans = a - (long) (up + 2) * (up + 2) * x - (long) (up + 1) * (up + 1) * y;

            out.println(ans);
            for (int i = 0; i < x; i++) {
                for (int j = 0; j < up + 2; j++) out.print('x');
                out.print('o');
            }
            for (int i = 0; i < y; i++) {
                for (int j = 0; j < up + 1; j++) out.print('x');
                if (i < y - 1) out.print('o');
            }
        }
    }

    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new Cards().solve();
        out.close();
    }

    static FastScanner in;
    static PrintWriter out;

    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;

        public FastScanner(BufferedReader in) {
            this.in = in;
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class Cards {
    void solve() {
        int a = in.nextInt(), b = in.nextInt();

        if (a >= b) {
            long ans = (long) a * a;
            if (b > 0) {
                ans -= (long) (b - 1) * (b - 1) + 1;
            }

            out.println(ans);
            if (b > 0) out.print('x');
            for (int i = 0; i < a; i++) out.print('o');
            for (int i = 0; i < b - 1; i++) out.print('x');
        } else {
            int d = b - a - 1;
            int up = d / (a + 1);
            int x = d % (a + 1), y = a + 1 - x;
            long ans = a - (long) (up + 2) * (up + 2) * x - (long) (up + 1) * (up + 1) * y;

            out.println(ans);
            for (int i = 0; i < x; i++) {
                for (int j = 0; j < up + 2; j++) out.print('x');
                out.print('o');
            }
            for (int i = 0; i < y; i++) {
                for (int j = 0; j < up + 1; j++) out.print('x');
                if (i < y - 1) out.print('o');
            }
        }
    }

    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new Cards().solve();
        out.close();
    }

    static FastScanner in;
    static PrintWriter out;

    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;

        public FastScanner(BufferedReader in) {
            this.in = in;
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class Cards {
    void solve() {
        int a = in.nextInt(), b = in.nextInt();

        long[] A = new long[a + 1];
        for (int i = 1; i <= a; i++) {
            A[i] = i - 1 + sqr(a - i + 1);
        }

        long[] B = new long[b + 1];
        for (int i = 1; i <= b; i++) {
            B[i] = (b % i) * sqr(b / i + 1) + (i - b % i) * sqr(b / i);
        }

        if (a == 0) {
            out.println(-B[1]);
            for (int i = 0; i < b; i++) out.print('x');
            return;
        }

        if (b == 0) {
            out.println(A[1]);
            for (int i = 0; i < a; i++) out.print('o');
            return;
        }

        long ans = -(long) 1e18, x = -1, y = -1;
        for (int i = 1; i <= a; i++) {
            for (int j = -1; j <= 1; j++) {
                int k = i + j;
                if (k >= 1 && k <= b && ans < A[i] - B[k]) {
                    ans = A[i] - B[k];
                    x = i;
                    y = k;
                }
            }
        }

        out.println(ans);
        int rem = b;
        for (int i = 0; i < x; i++) {
            if (i < b % y) {
                for (int j = 0; j < b / y + 1; j++) out.print('x');
                rem -= b / y + 1;
            } else {
                for (int j = 0; j < b / y; j++) out.print('x');
                rem -= b / y;
            }
            if (i == 0) for (int j = 0; j < a - x + 1; j++) out.print('o');
            else out.print('o');
        }
        for (int i = 0; i < rem; i++) out.print('x');
    }

    long sqr(long x) {
        return x * x;
    }

    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new Cards().solve();
        out.close();
    }

    static FastScanner in;
    static PrintWriter out;

    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;

        public FastScanner(BufferedReader in) {
            this.in = in;
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}


import java.io.*;
import java.util.*;

public class CF399C {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int a = Integer.parseInt(st.nextToken());
		int b = Integer.parseInt(st.nextToken());
		long v = 0;
		StringBuilder sb = new StringBuilder();
		if (a >= b || a == 0) {
			for (int i = 0; i < a; i++)
				sb.append("o");
			for (int i = 0; i < b; i++)
				sb.append("x");
			v = (long) a * a - (long) b * b;
		} else {
			int q = b / (a + 1);
			int r = b % (a + 1);
			v = a;
			for (int k = 0; k < a + 1; k++) {
				if (k > 0)
					sb.append("o");
				if (k < r)
					sb.append("x");
				for (int i = 0; i < q; i++)
					sb.append("x");
				v -= k < r ? (long) (q + 1) * (q + 1) : (long) q * q;
			}
		}
		System.out.println(v);
		System.out.println(sb);
	}
}


import java.io.*;
import java.util.*;

public class CF399C {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int a = Integer.parseInt(st.nextToken());
		int b = Integer.parseInt(st.nextToken());
		long v;
		StringBuilder sb = new StringBuilder();
		if (a == 0 || b == 0) {
			for (int i = 0; i < a; i++)
				sb.append("o");
			for (int i = 0; i < b; i++)
				sb.append("x");
			v = (long) a * a - (long) b * b;
		} else {
			int c = Math.min(a, b), k_, qb, rb;
			v = Long.MIN_VALUE;
			k_ = -1;
			for (int k = 1; k <= c; k++) {
				qb = b / (k + 1);
				rb = b % (k + 1);
				long va = (long) (a - k + 1) * (a - k + 1) + k - 1;
				long vb = (long) rb * (qb + 1) * (qb + 1) + (long) (k + 1 - rb) * qb * qb;
				if (v < va - vb) {
					v = va - vb;
					k_ = k;
				}
			}
			qb = b / (k_ + 1);
			rb = b % (k_ + 1);
			for (int r = 0; r <= k_; r++) {
				if (r < rb)
					sb.append("x");
				for (int i = 0; i < qb; i++)
					sb.append("x");
				if (r < k_) {
					if (r == 0)
						for (int i = 0; i < a - k_ + 1; i++)
							sb.append("o");
					else
						sb.append("o");
				}
			}
		}
		System.out.println(v);
		System.out.println(sb);
	}
}


import java.io.*;
import java.util.*;

public class CF399C {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int a = Integer.parseInt(st.nextToken());
		int b = Integer.parseInt(st.nextToken());
		long v;
		StringBuilder sb = new StringBuilder();
		if (a == 0 || b == 0) {
			for (int i = 0; i < a; i++)
				sb.append("o");
			for (int i = 0; i < b; i++)
				sb.append("x");
			v = (long) a * a - (long) b * b;
		} else {
			int c = Math.min(a, b), k_ = -1, qa, ra, qb, rb;
			v = Long.MIN_VALUE;
			for (int k = 1; k <= c; k++) {
				qa = a / k;
				ra = a % k;
				qb = b / (k + 1);
				rb = b % (k + 1);
				long va = (long) ra * (qa + 1) * (qa + 1) + (long) (k - ra) * qa * qa;
				long vb = (long) rb * (qb + 1) * (qb + 1) + (long) (k + 1 - rb) * qb * qb;
				if (v < va - vb) {
					v = va - vb;
					k_ = k;
				}
			}
			qa = a / k_;
			ra = a % k_;
			qb = b / (k_ + 1);
			rb = b % (k_ + 1);
			for (int r = 0; r <= k_; r++) {
				if (r < rb)
					sb.append("x");
				for (int i = 0; i < qb; i++)
					sb.append("x");
				if (r < k_) {
					if (r < ra)
						sb.append("o");
					for (int i = 0; i < qa; i++)
						sb.append("o");
				}
			}
		}
		System.out.println(v);
		System.out.println(sb);
	}
}


import java.util.*;
/*
1 5
 */
public class C {

	public static void main(String[] args) {

		Scanner qwe = new Scanner(System.in);

		int o = qwe.nextInt();
		int x = qwe.nextInt();

		StringBuilder ret = new StringBuilder("");
		if(o == 0){
			System.out.println(-((long)(x)*x));
			for (int i = 0; i < x; i++) {
				ret.append("x");
			}
		}
		else if(x == 0){
			System.out.println(((long)(o)*o));
			for (int i = 0; i < o; i++) {
				ret.append("o");
			}
		}
		else if(x == 1){
			System.out.println(((long)(o)*o)-1);
			for (int i = 0; i < o; i++) {
				ret.append("o");
			}
			ret.append("x");
		}
		else{
			long best = Long.MIN_VALUE;
			int bgo = 0;

			for(int ngo = 1; ngo <= o; ngo++){

				int ngx = ngo+1;
				if(ngx > x) continue;

				long sum = 0;
				long sizel = o-(ngo-1);
				sum += sizel*sizel + ngo-1;
				long smallsize = x/ngx;
				long numlarge = x-smallsize*ngx;
				long numsmall = ngx-numlarge;

				sum -= smallsize*smallsize*numsmall + (smallsize+1)*(smallsize+1)*numlarge;
				//System.out.println("sum: " + sum + " ngo: " + ngo);
				//System.out.println("ngo: " + ngo + " sizel: " + sizel + " numlarge: " + numlarge + " numsmall: " + numsmall +" smallsize: " + smallsize);

				if(sum > best){
					best =sum;
					bgo = ngo;
				}

			}

			System.out.println(best);

			int ngo= bgo;
			int ngx = ngo+1;

			long sizel = o-(ngo-1);
			long smallsize = x/ngx;
			long numlarge = x-smallsize*ngx;
			long numsmall = ngx-numlarge;

			//System.out.println("bgo: " + bgo + " sizel: " + sizel + " numlarge: " + numlarge + " numsmall: " + numsmall);

			StringBuilder xsm= new StringBuilder("");

			for(int i =0; i < smallsize; i++){
				xsm.append("x");
			}

			ret.append(xsm);
			numsmall--;
			for(int i =0; i< sizel; i++){
				ret.append("o");
			}

			while(numsmall-->0){
				ret.append(xsm);
				if(numsmall > 0 || numlarge > 0)
					ret.append("o");
			}

			//System.out.println("before l " + ret + " numl: " + numlarge);

			while(numlarge-->0){
				ret.append(xsm);
				ret.append("x");
				if(numlarge > 0)
					ret.append("o");
			}

		}

		System.out.println(ret);

		qwe.close();

	}

}


import java.util.*;
/*
5 5
 */
public class C {

	public static void main(String[] args) {

		Scanner qwe = new Scanner(System.in);

		int o = qwe.nextInt();
		int x = qwe.nextInt();

		StringBuilder ret = new StringBuilder("");
		if(o == 0){
			System.out.println(-((long)(x)*x));
			for (int i = 0; i < x; i++) {
				ret.append("x");
			}
		}
		else if(x == 0){
			System.out.println(((long)(o)*o));
			for (int i = 0; i < o; i++) {
				ret.append("o");
			}
		}
		else{
			long best = Long.MIN_VALUE;
			int bgo = 0;

			for(int ngo = 1; ngo <= o; ngo++){

				int ngx = ngo+1;
				if(ngx > x) continue;

				long sum = 0;
				long sizel = o-(ngo-1);
				sum += sizel*sizel + ngo-1;
				long smallsize = x/ngx;
				long numlarge = x-smallsize*ngx;
				long numsmall = ngx-numlarge;

				sum -= smallsize*smallsize*numsmall + (smallsize+1)*(smallsize+1)*numlarge;
				//System.out.println("sum: " + sum + " ngo: " + ngo);
				if(sum > best){
					best =sum;
					bgo = ngo;
				}

			}

			System.out.println(best);

			int ngo= bgo;
			int ngx = ngo+1;

			long sizel = o-(ngo-1);
			long smallsize = x/ngx;
			long numlarge = x-smallsize*ngx;
			long numsmall = ngx-numlarge;

			//System.out.println("bgo: " + bgo + " sizel: " + sizel + " numlarge: " + numlarge + " numsmall: " + numsmall);

			StringBuilder xsm= new StringBuilder("");

			for(int i =0; i < smallsize; i++){
				xsm.append("x");
			}

			ret.append(xsm);
			numsmall--;
			for(int i =0; i< sizel; i++){
				ret.append("o");
			}

			while(numsmall-->0){
				ret.append(xsm);
				if(numsmall > 0 || numlarge > 0)
					ret.append("o");
			}

			//System.out.println("before l " + ret + " numl: " + numlarge);

			while(numlarge-->0){
				ret.append(xsm);
				ret.append("x");
				if(numlarge > 0)
					ret.append("o");
			}

		}

		System.out.println(ret);

		qwe.close();

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class problem_0399c {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader
				(new InputStreamReader(System.in));
		String[] line;

		line = br.readLine().split(" ");
		long A = (long)Integer.parseInt(line[0]);
		long B = (long)Integer.parseInt(line[1]);

		if(A == 0){
			System.out.println(-B*B);
			StringBuilder sb = new StringBuilder();
			while(B > 0){
				sb.append('x');
				B--;
			}
			System.out.println(sb);
			return;
		}
		if(B == 0){
			System.out.println(A*A);
			StringBuilder sb = new StringBuilder();
			while(A > 0){
				sb.append('o');
				A--;
			}
			System.out.println(sb);
			return;
		}

		long[] adp = new long[(int)A+1];
		long[] bdp = new long[(int)B+1];

		Arrays.fill(adp, -1_000_000_000_001L);
		Arrays.fill(bdp, -1_000_000_000_001L);

		for(int a = 1; a <= A; a++){
			adp[a] = squareSumMax(A, a);
		}
		for(int b = 1; b <= B; b++){
			bdp[b] = -squareSumMin(B, b);
		}

		int bestA = -1;
		int bestB = -1;
		long best = -1_000_000_000_001L;

		for(int a = 1; a <= A; a++){
			if(a-1 > 0 && a-1 <= B){
				if(best < adp[a] + bdp[a-1]){
					best = adp[a] + bdp[a-1];
					bestA = a;
					bestB = a-1;
				}
			}
			if(a <= B){
				if(best < adp[a] + bdp[a]){
					best = adp[a] + bdp[a];
					bestA = a;
					bestB = a;
				}
			}
			if(a+1 <= B){
				if(best < adp[a] + bdp[a+1]){
					best = adp[a] + bdp[a+1];
					bestA = a;
					bestB = a+1;
				}
			}
		}

		System.out.println(best);
		String[] astrs = new String[(int)bestA];
		String[] bstrs = new String[(int)bestB];

		astrs[0] = manyChars((int)A - bestA + 1, 'o');
		for(int a = 1; a < bestA; a++){
			astrs[a] = "o";
		}
		for(int b = 0; b < (int)B % bestB; b++){
			bstrs[b] = manyChars((int)B/bestB + 1, 'x');
		}
		for(int b = (int)B % bestB; b < bestB; b++){
			bstrs[b] = manyChars((int)B/bestB, 'x');
		}

		StringBuilder sb = new StringBuilder();
		int a = 0, b = 0;
		if(bestA < bestB) sb.append(bstrs[b++]);
		while(a < bestA && b < bestB){
			sb.append(astrs[a++]);
			if(a >= bestA && b >= bestB) break;
			sb.append(bstrs[b++]);
		}
		System.out.println(sb);
	}

	static String manyChars(int howMany, char ch){
		StringBuilder sb = new StringBuilder();
		while(howMany > 0){
			sb.append(ch);
			howMany--;
		}
		return sb.toString();
	}

	static long squareSumMax(long amt, long parts){
		return (amt-parts+1)*(amt-parts+1) + parts-1;
	}

	static long squareSumMin(long amt, long parts){
		long div = amt / parts;
		long mod = amt % parts;
		return (div*div*(parts - mod) + (div+1)*(div+1)*(mod));
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class problem_0399c {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader
				(new InputStreamReader(System.in));
		String[] line;

		line = br.readLine().split(" ");
		long A = (long)Integer.parseInt(line[0]);
		long B = (long)Integer.parseInt(line[1]);

		if(A == 0){
			System.out.println(-B*B);
			StringBuilder sb = new StringBuilder();
			while(B > 0){
				sb.append('x');
				B--;
			}
			System.out.println(sb);
			return;
		}
		if(B == 0){
			System.out.println(A*A);
			StringBuilder sb = new StringBuilder();
			while(A > 0){
				sb.append('o');
				A--;
			}
			System.out.println(sb);
			return;
		}

		long[] adp = new long[(int)A+1];
		long[] bdp = new long[(int)B+1];

		Arrays.fill(adp, -1_000_000_000_001L);
		Arrays.fill(bdp, -1_000_000_000_001L);

		for(int a = 1; a <= A; a++){
			adp[a] = squareSumMax(A, a);
		}
		for(int b = 1; b <= B; b++){
			bdp[b] = -squareSumMin(B, b);
		}

		int bestA = -1;
		int bestB = -1;
		long best = -1_000_000_000_001L;

		for(int a = 1; a <= A; a++){
			if(a-1 > 0 && a-1 <= B){
				if(best < adp[a] + bdp[a-1]){
					best = adp[a] + bdp[a-1];
					bestA = a;
					bestB = a-1;
				}
			}
			if(a <= B){
				if(best < adp[a] + bdp[a]){
					best = adp[a] + bdp[a];
					bestA = a;
					bestB = a;
				}
			}
			if(a+1 <= B){
				if(best < adp[a] + bdp[a+1]){
					best = adp[a] + bdp[a+1];
					bestA = a;
					bestB = a+1;
				}
			}
		}

		System.out.println(best);
		String[] astrs = new String[(int)bestA];
		String[] bstrs = new String[(int)bestB];

		astrs[0] = manyChars((int)A - bestA + 1, 'o');
		for(int a = 1; a < bestA; a++){
			astrs[a] = "o";
		}
		for(int b = 0; b < (int)B % bestB; b++){
			bstrs[b] = manyChars((int)B/bestB + 1, 'x');
		}
		for(int b = (int)B % bestB; b < bestB; b++){
			bstrs[b] = manyChars((int)B/bestB, 'x');
		}

		StringBuilder sb = new StringBuilder();
		int a = 0, b = 0;
		if(bestA < bestB) sb.append(bstrs[b++]);
		while(a < bestA && b < bestB){
			sb.append(astrs[a++]);
			if(a >= bestA && b >= bestB) break;
			sb.append(bstrs[b++]);
		}
		System.out.println(sb);
	}

	static String manyChars(int howMany, char ch){
		StringBuilder sb = new StringBuilder();
		while(howMany > 0){
			sb.append(ch);
			howMany--;
		}
		return sb.toString();
	}

	static long squareSumMax(long amt, long parts){
		return (amt-parts+1)*(amt-parts+1) + parts-1;
	}

	static long squareSumMin(long amt, long parts){
		long div = amt / parts;
		long mod = amt % parts;
		return (div*div*(amt - mod) + (div+1)*(div+1)*(mod));
	}
}