#include <bits/stdc++.h>
using namespace std;
class TC {
 public:
  void solve() {
    string s;
    cin >> s;
    long long level = s.find('^');
    long long left = 0, right = 0;
    for (long long i = 0; i < level; i++) {
      if (s[i] != '=') left += (level - i) * (s[i] - '0');
    }
    for (long long i = level + 1; i < s.size(); i++) {
      if (s[i] != '=') right += (i - level) * (s[i] - '0');
    }
    if (left == right)
      cout << "balance"
           << "\n";
    else if (left < right)
      cout << "right"
           << "\n";
    else
      cout << "left"
           << "\n";
  }
};
int32_t main() {
  (ios::sync_with_stdio(false), cin.tie(NULL));
  TC tc;
  double start = clock();
  tc.solve();
  cerr << "[*] Time: " << (clock() - start) * 1.0 / CLOCKS_PER_SEC
       << std::setprecision(3) << " s"
       << "\n";
  return 0;
}
