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