#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long int mid;
  for (long long int i = 0; i < s.length(); i++) {
    if (s[i] == '^') {
      mid = i;
      break;
    }
  }
  long long int sum_a = 0;
  for (long long int i = 0; i < mid; i++) {
    if (s[i] >= 48 && s[i] <= 57) sum_a += (s[i] - 48) * (i - mid);
  }
  long long int sum_b = 0;
  for (long long int i = mid + 1; i < s.length(); i++) {
    if (s[i] >= 48 && s[i] <= 57) sum_a += (s[i] - 48) * (i - mid);
  }
  if (sum_a == 0)
    cout << "balance";
  else {
    if (sum_a < 0)
      cout << "left";
    else
      cout << "right";
  }
}
