#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long mid = s.find('^');
  long long size = s.size();
  long long sum_left = 0;
  long long sum_right = 0;
  for (int i = 0; i < mid; i++) {
    char t = s[i];
    if (t != '=') {
      long long temp = t - '0';
      long long distance = mid - i;
      sum_left += temp * distance;
    }
  }
  for (int i = mid + 1; i < size; i++) {
    char t = s[i];
    if (t != '=') {
      long long temp = t - '0';
      long long distance = i - mid;
      sum_right += temp * distance;
    }
  }
  if (sum_right == sum_left) cout << "balance";
  if (sum_right > sum_left) cout << "right";
  if (sum_right < sum_left) cout << "left";
}
