#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, d, count = 0, count1 = 0, sum = 0, x = 0;
  string s;
  cin >> s;
  for (long long int j = 0; s[j] != '\0'; j++) {
    if (s[j] == '^') x = j;
  }
  for (i = x - 1; i >= 0; i--) {
    if (s[i] == '=')
      count++;
    else {
      count++;
      sum = sum + (s[i] - '0') * count;
    }
  }
  long long int k = x, sum1 = 0;
  for (d = k + 1; s[d] != '\0'; d++) {
    if (s[d] == '=')
      count1++;
    else {
      count1++;
      sum1 = sum1 + (s[d] - '0') * count1;
    }
  }
  if (sum < sum1)
    cout << "right";
  else if (sum > sum1)
    cout << "left";
  else
    cout << "balance";
  return 0;
}
