#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    int n, len, sum = 0;
    map < int, int > haha;
    string str;
    cin >> str;
    len = str.size();
    for(auto &a : str){
        n = (a - '0') % 3;
        haha[n]++;
        sum += n;
    }
    sum = sum - ((sum / 3) * 3);
    if(sum % 3 == 0)
        cout << 0 << "\n";
    else if(sum % 3 == 2 && len > 1 && haha[2] >= 1)
        cout << 1 << "\n";
    else if(sum % 3 == 2 && len > 2 && haha[1] >= 2)
        cout << 2 << "\n";
    else if(sum % 3 == 1 && len > 1 && haha[1] >= 1)
        cout << 1 << "\n";
    else if(sum % 3 == 1 && len > 2 && haha[2] >= 2)
        cout << 2 << "\n";
    else
        cout << "-1\n";
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
int main () {
  int N=0;
  cin >> N;
  int an;
  an=N%2;
  if (an==1){
    cout << "Black" << endl;
  }
  if (an==0){
    cout << "White" << endl;
  }
}