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