#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string str;
  cin >> str;
  long long a = 0, b = 0;
  int idx = (find(((str)).begin(), ((str)).end(), ('^')) - (str).begin());
  for (int i = 0; i < idx; i++) {
    if (isdigit(str[i])) a += (idx - i) * (str[i] - '0');
  }
  for (int i = idx + 1; i <= ((int)(str).size()) - 1; i += 1) {
    if (isdigit(str[i])) b += (i - idx) * (str[i] - '0');
  }
  printf("%s", a == b ? "balance" : (a > b) ? "left" : "right");
}
