#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int a[2] = {0, 0};
  long long sum = 0;
  int pivot;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '^') {
      pivot = i;
      break;
    }
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] >= '1' && s[i] <= '9') {
      sum += (pivot - i) * (s[i] - '0');
    }
  }
  if (sum > 0)
    cout << "left";
  else if (sum < 0)
    cout << "right";
  else
    cout << "balance";
  return 0;
}
