#include <bits/stdc++.h>
using namespace std;
int main() {
  string ch;
  cin >> ch;
  int n = ch.length();
  int test = 0;
  int pivot = 0;
  while (pivot < n) {
    if (ch[pivot] == '^') break;
    pivot++;
  }
  long long nbl = 0;
  for (int i = 0; i < pivot; i++) {
    if (ch[i] != '=') nbl += (ch[i] - '0') * (pivot - i);
  }
  long long nbr = 0;
  for (int i = pivot + 1; i < n; i++) {
    if (ch[i] != '=') nbr += (ch[i] - '0') * (i - pivot);
  }
  if (nbl > nbr)
    cout << "left";
  else if (nbl < nbr)
    cout << "right";
  else
    cout << "balance";
}
