#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<long long int> left, right;
  int pivotIndex = -1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '=') {
      continue;
    } else if (s[i] == '^') {
      pivotIndex = i;
    } else {
      if (pivotIndex == -1) {
        left.push_back(i);
      } else {
        right.push_back(i);
      }
    }
  }
  long long int leftTorque = 0;
  for (int i = 0; i < left.size(); i++) {
    leftTorque += (pivotIndex - left.at(i)) * (s[left.at(i)] - '0');
  }
  long long int rightTorque = 0;
  for (int i = 0; i < right.size(); i++) {
    rightTorque += (right.at(i) - pivotIndex) * (s[right.at(i)] - '0');
  }
  if (leftTorque > rightTorque) {
    cout << "left\n";
  } else if (leftTorque < rightTorque) {
    cout << "right\n";
  } else {
    cout << "balance\n";
  }
  return 0;
}
