#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  int n = s.size();
  int pivot = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '^') {
      pivot = i;
    }
  }
  long long int lforce = 0;
  long long int rforce = 0;
  int r = pivot + 1;
  int l = pivot - 1;
  long long int len = 1;
  while (r < n) {
    if (s[r] != '=') rforce += (s[r] - '0') * len;
    r++;
    len++;
  }
  len = 1;
  while (l >= 0) {
    if (s[l] != '=') lforce += (s[l] - '0') * len;
    l--;
    len++;
  }
  if (rforce == lforce)
    cout << "balance";
  else if (rforce > lforce)
    cout << "right";
  else
    cout << "left";
  return;
}
int main() {
  int test;
  test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
