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