#include <iostream>
using namespace std;
int main()
{
// 请在此输入您的代码
string a;
int f = 1, count;
cin >> a;
for (int i = 0; a[i]; i++) {
if (a[i] == a[i + 1]) {
f = 0; count = 1;
for (i; a[i] == a[i + 1]; i++)
count += 1;
cout << a[i] << count;
}
if (count == 1)
cout << a[i];
}
if (f)
cout << "NO" << endl;
return 0;
}
?