#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int id;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '^') id = i;
  }
  long long val = 0;
  for (int i = 0; i < s.size(); i++) {
    if (1 <= s[i] - '0' && s[i] - '0' <= 9) {
      val += ((id - i) * (s[i] - '0') * 1ll);
    }
  }
  if (val > 0ll)
    puts("left");
  else if (val < 0ll)
    puts("right");
  else
    puts("balance");
}
