#include <bits/stdc++.h>
using namespace std;
long long L, R;
int main() {
  int b = -1;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '^') b = i;
  }
  long long count = 0;
  for (int i = b; i < s.size(); i++, count++)
    if (s[i] != '=') R += count * (s[i] - '0');
  count = 0;
  for (int i = b; i >= 0; i--, count++) {
    if (s[i] != '=') L += count * (s[i] - '0');
  }
  if (L > R)
    puts("left");
  else if (L == R)
    puts("balance");
  else
    puts("right");
  return 0;
}
