#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  string s;
  cin >> s;
  bool b = 0;
  vector<pair<long long, long long> > A;
  vector<pair<long long, long long> > B;
  long long middle;
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '^') b = 1, middle = i;
    if (isalnum(s[i]))
      if (b)
        B.push_back(make_pair(s[i] - '0', i));
      else
        A.push_back(make_pair(s[i] - '0', i));
  }
  long long a = 0, v = 0;
  for (long long i = 0; i < A.size(); i++) {
    a += A[i].first * (middle - A[i].second);
  }
  for (long long i = 0; i < B.size(); i++) {
    v += B[i].first * (B[i].second - middle);
  }
  if (a > v)
    cout << "left";
  else if (a < v)
    cout << "right";
  else
    cout << "balance";
  return 0;
}
