import
java.util.HashMap;
import
java.util.Map;
public
class
ChangeGender {
public
static
String changeGender(String str)
{
Map<String, String> dictionary =
new
HashMap<>();
dictionary.put(
"batman"
,
"batwoman"
);
dictionary.put(
"batwoman"
,
"batman"
);
dictionary.put(
"boy"
,
"girl"
);
dictionary.put(
"girl"
,
"boy"
);
dictionary.put(
"boyfriend"
,
"girlfriend"
);
dictionary.put(
"girlfriend"
,
"boyfriend"
);
dictionary.put(
"father"
,
"mother"
);
dictionary.put(
"mother"
,
"father"
);
dictionary.put(
"husband"
,
"wife"
);
dictionary.put(
"wife"
,
"husband"
);
dictionary.put(
"he"
,
"she"
);
dictionary.put(
"she"
,
"he"
);
dictionary.put(
"his"
,
"her"
);
dictionary.put(
"her"
,
"his"
);
dictionary.put(
"male"
,
"female"
);
dictionary.put(
"female"
,
"male"
);
dictionary.put(
"man"
,
"woman"
);
dictionary.put(
"woman"
,
"man"
);
dictionary.put(
"Mr"
,
"Ms"
);
dictionary.put(
"Ms"
,
"Mr"
);
dictionary.put(
"sir"
,
"madam"
);
dictionary.put(
"madam"
,
"sir"
);
dictionary.put(
"son"
,
"daughter"
);
dictionary.put(
"daughter"
,
"son"
);
dictionary.put(
"uncle"
,
"aunt"
);
dictionary.put(
"aunt"
,
"uncle"
);
str = str +
" "
;
int
n = str.length();
String temp =
""
, ans =
""
;
for
(
int
i =
0
; i <= n -
1
; i++) {
if
(str.charAt(i) !=
' '
)
temp += str.charAt(i);
else
{
if
(dictionary.containsKey(temp))
temp = dictionary.get(temp);
ans = ans + temp +
" "
;
temp =
""
;
}
}
return
ans;
}
public
static
void
main(String[] args) {
String str =
"she is going to watch movie with her boyfriend"
;
System.out.println(changeGender(str));
}
}