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