#include <bits/stdc++.h>
using namespace std;
int main() {
  string word;
  cin >> word;
  long long int k = word.find('^');
  long long int sum1 = 0, sum2 = 0;
  for (long long int i = 0; i < k; i++) {
    if (word[i] != '=') {
      sum1 += ((k - i) * (word[i] - '0'));
    }
  }
  for (long long int i = k + 1; i < word.size(); i++) {
    if (word[i] != '=') {
      sum2 += ((i - k) * (word[i] - '0'));
    }
  }
  if (sum1 == sum2)
    cout << "balance" << endl;
  else if (sum1 > sum2)
    cout << "left" << endl;
  else
    cout << "right" << endl;
}
