#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int a, b, c, d, e = 0, f = 0;
  string s2, s3;
  cin >> s2;
  for (int i = 0; i <= s2.length() - 1; i++) {
    if (s2[i] == '^') d = i + 1;
  }
  for (int i = 0; i < s2.length(); i++) {
    if (d - (i + 1) < 0 && s2[i] != '^' && s2[i] != '=')
      e += abs(d - (i + 1)) * (s2[i] - 48);
    else if (s2[i] != '^' && s2[i] != '=')
      f += abs(d - (i + 1)) * (s2[i] - 48);
  }
  if (f == e)
    cout << "balance" << endl;
  else if (f > e)
    cout << "left" << endl;
  else
    cout << "right" << endl;
  return 0;
}
