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