#include <bits/stdc++.h> using namespace std; int main() { string str; while (cin >> str) { // 统计每个字母出现的次数 int cnt[26] = { 0 }; for (auto ch : str) ++cnt[ch - 'a']; // 找出出现次数最少的字符的次数 int minValue = 100000; for (int i = 0; i < 26; ++i) if (cnt[i]) minValue = min(minValue, cnt[i]); // 找出字符串中出现次数最少的所有字符的位置 vector<int> minIndexs; for (int i = 0; i < str.size(); ++i) if (cnt[str[i] - 'a'] == minValue) minIndexs.push_back(i); int newSize = str.size(); for (int i = minIndexs.size() - 1; i >= 0; --i) { for (int j = minIndexs[i]; j < newSize - 1; ++j) str[j] = str[j + 1]; --newSize; } str.resize(newSize); cout << str << endl; } return 0; }