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