#include <cstddef>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main() {
string str1, str2;
getline(cin, str1);
getline(cin, str2);
int len1 = str1.length();
int len2 = str2.length();
int cnt=0;
if (len1 > len2) {
swap(str1, str2); //交换两个字符串,保证str1是最短的
}
for (int i = 0 ; i < len1 ; i++) {
char ch = str1[i];
std::size_t cha = str2.find(ch);
if (cha != std::string::npos) { //元素在str2中存在
cnt++;
}
}
if (cnt == len1) {
cout << "true";
} else {
cout << "false";
}
}