#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  long long flag = 0;
  long long n = s.length();
  for (long long i = 0; i < n; i++) {
    if (s[i] == '^') {
      flag = i;
      break;
    }
  }
  long long cnt = 0, left = 0, right = 0;
  for (long long i = flag - 1; i >= 0; i--)
    if (s[i] == '=')
      cnt++;
    else
      cnt++, left = left + ((s[i] - '0') * cnt);
  cnt = 0;
  for (long long i = flag + 1; i < n; i++)
    if (s[i] == '=')
      cnt++;
    else
      cnt++, right = right + ((s[i] - '0') * cnt);
  if (left == right)
    cout << "balance"
         << "\n";
  else if (left > right)
    cout << "left"
         << "\n";
  else
    cout << "right"
         << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
