#include <bits/stdc++.h>
using namespace std;
char s[1100000];
long long i, j, k, m, n, x, y, z, suma, sumb;
int main() {
  scanf("%s", s);
  int l = strlen(s);
  for (i = 0; i < l; i++)
    if (s[i] == '^') break;
  k = i;
  for (i = 0; i < k; i++)
    if (s[i] >= '1' && s[i] <= '9') suma += (k - i) * (s[i] - '0');
  for (i = k + 1; i < l; i++)
    if (s[i] >= '1' && s[i] <= '9') sumb += (i - k) * (s[i] - '0');
  if (suma == sumb) {
    printf("balance\n");
  } else if (suma > sumb)
    printf("left\n");
  else
    printf("right\n");
  return 0;
}
