#include <bits/stdc++.h>
using namespace std;
int main() {
  char c;
  vector<int> before;
  vector<int> after;
  while ((c = getchar()) != '^') {
    if (c == '=')
      before.push_back(0);
    else
      before.push_back(c - 48);
  }
  while ((c = getchar()) != '\n') {
    if (c == '=')
      after.push_back(0);
    else
      after.push_back(c - 48);
  }
  uint64_t bsum = 0;
  for (size_t i = 0; i != before.size(); ++i) {
    bsum += before[i] * (before.size() - i);
  }
  uint64_t asum = 0;
  for (size_t i = 0; i != after.size(); ++i) {
    asum += after[i] * (i + 1);
  }
  if (bsum == asum)
    cout << "balance" << endl;
  else if (bsum > asum)
    cout << "left" << endl;
  else
    cout << "right" << endl;
}
