import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
// your code goes here
for(int i=0;i<str.length();i++){
char c=str.charAt(i);
hmap.put(c,hmap.getOrDefault(c,0)+1);
}
for(int i=1;i<words.length;i++){
Map
<Character,Integer
>freqmap
=new HashMap
<>(); for(int j=0;j<newstr.length();j++){
char c=newstr.charAt(j);
freqmap.put(c,freqmap.getOrDefault(c,0)+1);
}
if(freqmap.containsKey(key)){
hmap.
put(key,
Math.
min(hmap.
get(key
),freqmap.
get(key
))); }
else{
hmap.put(key,0);
}
}
}
List<String> list=new ArrayList<>();
if(hmap.get(key)>0){
for(int i=0;i<hmap.get(key);i++){
list.add(key+"");
}
}
}
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CiAKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCgkJU3RyaW5nW10gd29yZHM9bmV3IFN0cmluZ1tdeyJiZWxsYSIsImxhYmVsIiwicm9sbGVyIn07CgkJU3RyaW5nIHN0cj13b3Jkc1swXTsKICAgICAgICBNYXA8Q2hhcmFjdGVyLEludGVnZXI+aG1hcD1uZXcgSGFzaE1hcDw+KCk7CiAgICAgICAgZm9yKGludCBpPTA7aTxzdHIubGVuZ3RoKCk7aSsrKXsKICAgICAgICAgICAgY2hhciBjPXN0ci5jaGFyQXQoaSk7CiAgICAgICAgICAgIGhtYXAucHV0KGMsaG1hcC5nZXRPckRlZmF1bHQoYywwKSsxKTsgICAgCiAgICAgICAgfQogICAgICAgIGZvcihpbnQgaT0xO2k8d29yZHMubGVuZ3RoO2krKyl7CiAgICAgICAgICAgIFN0cmluZyBuZXdzdHI9d29yZHNbaV07CiAgICAgICAgICAgIE1hcDxDaGFyYWN0ZXIsSW50ZWdlcj5mcmVxbWFwPW5ldyBIYXNoTWFwPD4oKTsKICAgICAgICAgICAgZm9yKGludCBqPTA7ajxuZXdzdHIubGVuZ3RoKCk7aisrKXsKICAgICAgICAgICAgICAgIGNoYXIgYz1uZXdzdHIuY2hhckF0KGopOwogICAgICAgICAgICAgICAgZnJlcW1hcC5wdXQoYyxmcmVxbWFwLmdldE9yRGVmYXVsdChjLDApKzEpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGZvcihDaGFyYWN0ZXIga2V5OmhtYXAua2V5U2V0KCkpewogICAgICAgICAgICAgICAgaWYoZnJlcW1hcC5jb250YWluc0tleShrZXkpKXsKICAgICAgICAgICAgICAgICAgICBobWFwLnB1dChrZXksTWF0aC5taW4oaG1hcC5nZXQoa2V5KSxmcmVxbWFwLmdldChrZXkpKSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlewogICAgICAgICAgICAgICAgICAgIGhtYXAucHV0KGtleSwwKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBMaXN0PFN0cmluZz4gbGlzdD1uZXcgQXJyYXlMaXN0PD4oKTsKICAgICAgICBmb3IoQ2hhcmFjdGVyIGtleTpobWFwLmtleVNldCgpKXsKICAgICAgICAgICAgaWYoaG1hcC5nZXQoa2V5KT4wKXsKICAgICAgICAgICAgICAgIGZvcihpbnQgaT0wO2k8aG1hcC5nZXQoa2V5KTtpKyspewogICAgICAgICAgICAgICAgICAgIGxpc3QuYWRkKGtleSsiIik7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgU3lzdGVtLm91dC5wcmludGxuKGxpc3QpOwoJfQp9