#include <iostream> #include<map> using namespace std; int main() { string c; string b; while (getline(cin, c)) { map<char, int>m; if(c=="#")break; getline(cin, b); for (auto it : b) { ++m[it]; } for (auto it : c) { cout << it << " " << m[it] << endl; } } } // 64 位输出请用 printf("%lld")