#include <bits/stdc++.h>
using namespace std;
string s;
int mid;
unsigned long long ans, a, b;
int main() {
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '^') {
      mid = i;
      break;
    }
  }
  for (int i = 0; i < mid; i++) {
    if (s[i] != '=') {
      a += (s[i] - '0') * (mid - i);
    }
  }
  for (int i = mid + 1; i < s.length(); i++) {
    if (s[i] != '=') {
      b += (s[i] - '0') * (i - mid);
    }
  }
  if (a > b) {
    cout << "left";
  }
  if (b > a) {
    cout << "right";
  }
  if (a == b) {
    cout << "balance";
  }
  return 0;
}
