#include <bits/stdc++.h>
using namespace std;
int main() {
  string lever;
  cin >> lever;
  int pos = lever.find('^', 0);
  long long int left = 0;
  int i = 1;
  while (pos - i >= 0) {
    if (lever[pos - i] >= '0' && lever[pos - i] <= '9')
      left += (lever[pos - i] - '0') * i;
    i++;
  }
  long long int right = 0;
  i = 1;
  while (pos + i < lever.size()) {
    if (lever[pos + i] >= '0' && lever[pos + i] <= '9')
      right += (lever[pos + i] - '0') * i;
    i++;
  }
  if (left == right)
    cout << "balance\n";
  else if (left < right)
    cout << "right\n";
  else
    cout << "left\n";
  return 0;
}
