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