#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string str;
  cin >> str;
  long long int ind;
  long long int count1 = 0;
  for (long long int i = 0; i < str.length(); i++) {
    if (str[i] == '=') count1++;
    if (str[i] == '^') ind = i;
  }
  count1++;
  long long int left = 0, right = 0;
  if (str.length() == count1)
    cout << "balance";
  else {
    for (long long int i = 0; i < ind; i++) {
      if (str[i] != '=') left += (str[i] - 48) * (ind - i);
    }
    for (long long int i = ind + 1; i < str.length(); i++) {
      if (str[i] != '=') right += (str[i] - 48) * (i - ind);
    }
    if (left == right)
      cout << "balance";
    else if (left > right)
      cout << "left";
    else
      cout << "right";
  }
  return 0;
}
