#include <bits/stdc++.h>
using namespace std;
string s;
int main() {
  string s;
  cin >> s;
  int64_t mid = s.find('^'), sum = 0;
  ;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] - '0' >= 0 && s[i] - '0' <= 9) {
      sum = sum + ((i - mid) * (s[i] - '0'));
    }
  }
  if (sum > 0)
    cout << "right" << endl;
  else if (sum < 0)
    cout << "left" << endl;
  else
    cout << "balance" << endl;
}
