#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
LPSTR xcode(LPCSTR src, UINT srcCodepage, UINT dstCodepage)
{
int wsize = MultiByteToWideChar(srcCodepage, 0, src, -1, NULL, 0);
LPWSTR wbuf = (LPWSTR)malloc(wsize*sizeof(WCHAR));
MultiByteToWideChar(srcCodepage, 0, src, -1, wbuf, wsize);
int size = WideCharToMultiByte(dstCodepage, 0, wbuf, -1, NULL, 0, NULL, NULL);
LPSTR buf = (LPSTR)malloc(size);
WideCharToMultiByte(dstCodepage, 0, wbuf, -1, buf, size, NULL, NULL);
free(wbuf);
return buf;
}
int main()
{
//std::string str;
//std::cin >> str;
LPSTR p;
using std::string;
using std::cin;
using std::cout;
string aString;
char tempChar;
while (!cin.eof())
{
cin.get(tempChar);
aString += tempChar;
}
// const char *cstr = str.c_str();
const char *cstr = aString.c_str();
p = xcode(cstr, 866, CP_UTF8);
printf("%s\n", p);
free(p);
return 0;
}