#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long sum = 0;
  long long mid = s.find('^');
  mid++;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != '=' && s[i] != '^') {
      int n = (int)(s[i] - '0');
      sum += ((n) * ((i + 1) - mid));
    }
  }
  if (sum == 0)
    cout << "balance";
  else if (sum > 0)
    cout << "right";
  else
    cout << "left";
  return 0;
}
