#include <bits/stdc++.h>
using namespace std;
int main() {
  string cad;
  cin >> cad;
  long long le = 0, ri = 0;
  long long pi = -1;
  for (int i = 0; i < cad.size(); i++)
    if (cad[i] == '^') pi = i;
  for (int i = 0; i < pi; i++) {
    if (isdigit(cad[i])) {
      long long num = (long long)(cad[i] - '0');
      le += num * (pi - i);
    }
  }
  for (int i = pi + 1; i < cad.size(); i++) {
    if (isdigit(cad[i])) {
      long long num = (long long)(cad[i] - '0');
      ri += num * (i - pi);
    }
  }
  if (le == ri)
    cout << "balance" << endl;
  else if (le > ri)
    cout << "left" << endl;
  else
    cout << "right" << endl;
  return 0;
}
