#include <bits/stdc++.h>
using namespace std;
ifstream f("cf.in");
long long n, pin;
long long lft, rght;
string s;
int main() {
  cin >> s;
  n = s.size();
  for (int i = 0; i < n; ++i)
    if (s[i] == '^') pin = i;
  for (int i = pin + 1; i < n; ++i)
    if (s[i] >= '0' && s[i] <= '9') rght += (i - pin) * (s[i] - '0');
  for (int i = pin - 1; i >= 0; --i)
    if (s[i] >= '0' && s[i] <= '9') lft += (pin - i) * (s[i] - '0');
  if (lft == rght)
    cout << "balance";
  else if (lft < rght)
    cout << "right";
  else
    cout << "left";
  return 0;
}
