1 #include <cstdlib>
2 #include <cstdio>
3 #include <cmath>
4 #include <cstring>
5 #include <cctype>
6
7 #include <iostream>
8 #include <string>
9 #include <vector>
10 #include <list>
11 #include <deque>
12 #include <set>
13 #include <map>
14 #include <stack>
15 #include <queue>
16 #include <algorithm>
17
18 #define MAXN 100001
19 #define MAXD 99999999
20 using namespace std;
21
22
23 map<char,int>mp;
24
25
26 int main()
27 {
28
29
30 char s1[100],s2[100];
31
32 int i,j,k;
33
34
35
36
37
38 while(gets(s1))
39 {
40 if(strcmp("#",s1)==0)
41 break;
42
43 mp.clear();
44
45
46 gets(s2);
47
48
49
50 for(i=0;s1[i];i++)
51 {
52 mp[s1[i]]=0;
53 }
54
55
56 for(i=0;s2[i];i++)
57 {
58 mp[s2[i]]++;
59 }
60
61 for(i=0;s1[i];i++)
62 {
63 cout<<s1[i]<<' '<<mp[s1[i]]<<endl;
64 }
65 }
66
67
68
69
70
71 return 0;
72 }