#include <bits/stdc++.h>
using namespace std;
int main() {
  char str[1000005];
  cin >> str;
  long long int left = 0, right = 0;
  int flag = 0;
  int pivot = 0;
  for (int i = 0; i < strlen(str); i++)
    if (str[i] == '^') pivot = i;
  long long int l_w = pivot;
  long long int r_w = 1;
  for (int i = 0; i < strlen(str); i++) {
    if ((flag == 0) && (isdigit(str[i]))) left += (str[i] - 48) * l_w;
    if ((flag != 0) && (isdigit(str[i]))) right += (str[i] - 48) * r_w;
    if (flag == 0) l_w--;
    if (flag != 0) r_w++;
    if (str[i] == '^') flag++;
  }
  if (left == right) cout << "balance";
  if (left > right) cout << "left";
  if (right > left) cout << "right";
  return 0;
}
