#include <bits/stdc++.h>
using namespace std;
int d[999999];
int a[999999];
int b[999999];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  long long postP = s.find('^'), answer = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] >= '0' && s[i] <= '9') answer += (s[i] - '0') * (i - postP);
  if (answer == 0)
    cout << "balance", 0;
  else
    cout << (answer < 0 ? "left" : "right") << endl;
}
