#include <bits/stdc++.h>
using namespace std;
int n;
string str;
long long sum;
int main() {
  cin >> str;
  for (int i = 0; i < str.size(); i++)
    if (str[i] == '^') n = i;
  for (int i = 0; i < str.size(); i++)
    if (str[i] - '0' >= 1 && str[i] - '0' <= 9) sum += (str[i] - '0') * (i - n);
  if (sum == 0)
    printf("balance\n");
  else if (sum < 0)
    printf("left\n");
  else
    printf("right\n");
  return 0;
}
