#include <bits/stdc++.h>
using namespace std;
template <typename T>
string NumberToString(T Number) {
  ostringstream ss;
  ss << Number;
  return ss.str();
}
template <typename T>
T StringToNumber(const string &Text) {
  istringstream ss(Text);
  T result;
  return ss >> result ? result : 0;
}
int main() {
  string s;
  cin >> s;
  long long n = s.size();
  vector<pair<long long, long long> > v;
  long long l = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] >= '1' && s[i] <= '9')
      v.push_back(make_pair(i, s[i] - '0'));
    else if (s[i] == '^')
      l = i;
  }
  long long m = v.size(), t = 0;
  for (long long i = 0; i < m; i++) {
    t += v[i].second * (v[i].first - l);
  }
  if (t == 0) {
    cout << "balance";
  } else if (t > 0) {
    cout << "right";
  } else if (t < 0) {
    cout << "left";
  }
  return 0;
}
