#include <bits/stdc++.h>
using namespace std;
char s[1000 * 1000];
int main() {
  int i, n, k;
  long long s1 = 0, s2 = 0;
  scanf("%s", s);
  n = (int)strlen(s);
  for (i = 0; i < n; i++)
    if (s[i] == '^') k = i;
  for (i = (k - 1); i >= 0; i--)
    if (s[i] != '=') s1 += (s[i] - '0') * (k - i);
  for (i = (k + 1); i < n; i++)
    if (s[i] != '=') s2 += (s[i] - '0') * (i - k);
  if (s1 == s2) printf("balance");
  if (s1 > s2) printf("left");
  if (s2 > s1) printf("right");
  return 0;
}
