#include <bits/stdc++.h>
using namespace std;
const int MAX = 0x7FFFFFFF;
const int MIN = 0x80000000;
string s;
int main() {
  long long left = 0, right = 0;
  cin >> s;
  int n = s.length();
  int pivot = 0;
  for (int i = 0; i < n; i++)
    if (s[i] == '^') {
      pivot = i;
      break;
    }
  for (int i = pivot - 1; i >= 0; i--)
    if (s[i] != '=') left = left + (s[i] - '0') * (pivot - i);
  for (int i = pivot + 1; i < n; i++)
    if (s[i] != '=') right = right + (s[i] - '0') * (i - pivot);
  if (left == right)
    cout << "balance" << endl;
  else if (left > right)
    cout << "left" << endl;
  else
    cout << "right" << endl;
  return 0;
}
