#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int p = 0;
  for (int i = 0; i < s.length(); i++)
    if (s[i] == '^') p = i;
  long long m = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] >= '0' && s[i] <= '9') m += (long long)(p - i) * (s[i] - '0');
  }
  if (m == 0)
    cout << "balance" << endl;
  else if (m > 0)
    cout << "left" << endl;
  else
    cout << "right" << endl;
  return 0;
}
