#include<bits/stdc++.h>
using namespace std;
int w[] = {7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
int trans[] = {1,0,'X'-'0',9,8,7,6,5,4,3,2};
int main(){
string line = "";
while(getline(cin, line)) {
if(line.length() == 18) {
int res = 0;
for(int i = 0; i < 17; i...