include [HTML_REMOVED]
#include [HTML_REMOVED]
#include [HTML_REMOVED]
using namespace std;
string _str;
vector[HTML_REMOVED] _myList;
int _res = 0;
void ParseIn () {
ifstream inFile(“201312-2.in”);
inFile >> _str;
inFile.close();
}
void CParseIn () {
cin >> _str;
}
void Core () {
_myList.resize(10);
_myList[0] = _str[0] - ‘0’;
_myList[1] = _str[2] - ‘0’;
_myList[2] = _str[3] - ‘0’;
_myList[3] = _str[4] - ‘0’;
_myList[4] = _str[6] - ‘0’;
_myList[5] = _str[7] - ‘0’;
_myList[6] = _str[8] - ‘0’;
_myList[7] = _str[9] - ‘0’;
_myList[8] = _str[10]-‘0’;
if (_str[12] == ‘X’) {
_myList[9] = 10;
}
else {
_myList[9] = _str[12] - ‘0’;
}
for (int i = 0; i < 9; i++) {
_res += _myList[i] * (i + 1);
}
_res = _res % 11;
}
void WriteOut () {
ofstream outFile(“201312-2.out”);
if (_res == _myList[9]) {
outFile << "Right" << endl;
}
else {
if (_res == 10) {
_str[12] = 'X';
}
else {
_str[12] = _res + '0';
}
outFile << _str << endl;
}
outFile.close();
}
void CWriteOut () {
if (_res == _myList[9]) {
cout << “Right” << endl;
}
else {
if (_res == 10) {
_str[12] = ‘X’;
}
else {
_str[12] = _res + ‘0’;
}
cout << _str << endl;
}
}
int main() {
CParseIn();
Core();
CWriteOut();
return 0;
}