#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long lox = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '^') lox = i;
  }
  long long ans = 0;
  for (int i = 0; i < lox; i++) {
    if (s[i] != '=') ans += (s[i] - 48) * (lox - i);
  }
  long long an = 0;
  for (int i = lox; i < s.size(); i++) {
    if (s[i] != '=') an += (s[i] - 48) * (i - lox);
  }
  if (ans > an) {
    cout << "left";
    return 0;
  }
  if (ans < an) {
    cout << "right";
    return 0;
  } else
    cout << "balance";
}
