#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  long long k = 0, r = 0, l = 0, m = 0;
  vector<pair<long long, long long> > R, L;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '^') {
      m = i;
      k++;
    }
    if (k == 0 && S[i] - '0' >= 1 && S[i] - '0' <= 9)
      R.push_back(make_pair(S[i] - '0', i));
    if (k == 1 && S[i] - '0' >= 1 && S[i] - '0' <= 9)
      L.push_back(make_pair(S[i] - '0', i));
  }
  for (int i = 0; i < R.size(); i++) r += R[i].first * (m - R[i].second);
  for (int i = 0; i < L.size(); i++) l += L[i].first * (L[i].second - m);
  if (l == r)
    cout << "balance";
  else if (r > l)
    cout << "left";
  else
    cout << "right";
  return 0;
}
