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