#include <bits/stdc++.h>
using namespace std;
string a;
long long s;
int pvot;
unsigned long long l, r;
int main() {
  cin >> a;
  l = r = 0;
  s = a.size();
  for (int i = 0; i < s; i++)
    if (a[i] == '^') pvot = i;
  for (int i = 0; i < pvot; i++) {
    if (a[i] != '=') {
      l = l + (a[i] * (pvot - i)) - (48 * (pvot - i));
    }
  }
  for (int i = pvot + 1; i < s; i++) {
    int _ = a[i];
    if (a[i] != '=') {
      r = r + (a[i] * (i - pvot)) - (48 * (i - pvot));
    }
  }
  if (l == r)
    cout << "balance";
  else if (l > r)
    cout << "left";
  else
    cout << "right";
  return 0;
}
