#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  long long int ip = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '^') ip = i;
  }
  long long int suml = 0;
  long long int sumr = 0;
  for (int i = 0; i < ip; i++)
    if (s[i] != '=') suml += ((s[i] - '0') * (ip - i));
  for (int i = ip + 1; i < n; i++)
    if (s[i] != '=') sumr += ((s[i] - '0') * (i - ip));
  if (suml > sumr)
    cout << "left" << endl;
  else if (suml < sumr)
    cout << "right" << endl;
  else
    cout << "balance" << endl;
  return 0;
}
