#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  string s;
  cin >> s;
  long long i = 0;
  float l = 0, r = 0;
  long long pivot = 0;
  while (pivot < s.size() && s[pivot] != '^') pivot++;
  while (i < s.size() && s[i] != '^') {
    if (s[i] >= '1' && s[i] <= '9') l += (s[i] - '0') * abs(i - pivot);
    i++;
  }
  while (i < s.size()) {
    if (s[i] >= '1' && s[i] <= '9') r += (s[i] - '0') * abs(i - pivot);
    i++;
  }
  if (l == r)
    cout << "balance" << endl;
  else if (l > r)
    cout << "left" << endl;
  else
    cout << "right" << endl;
}
