#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long left_weight = 0;
  long long right_weight = 0;
  long long l_torque = 0;
  long long r_torque = 0;
  int lever;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '^') {
      lever = i;
    }
  }
  int j;
  for (int i = lever - 1, j = 1; i >= 0; i--, j++) {
    if (s[i] == '=') continue;
    int digit = s[i] - '0';
    left_weight += digit;
    l_torque += digit * j;
  }
  for (int i = lever + 1, j = 1; i < s.length(); i++, j++) {
    if (s[i] == '=') continue;
    int digit = s[i] - '0';
    right_weight += digit;
    r_torque += digit * j;
  }
  if (l_torque > r_torque) {
    cout << "left";
  } else if (l_torque < r_torque) {
    cout << "right";
  } else {
    cout << "balance";
  }
  return 0;
}
