import json
import sys
myList = json.load(sys.stdin)
def foo(myList,key,first=True):
return [x for x in myList if key in x or not first and key in x[1]]
print("foo:")
print(foo(myList, 'abc', first=True))
print(foo(myList, 'abc', first=False))
print("if any():")
print([lst for lst in myList if any('abc' in s for s in lst)])
print([lst for lst in myList if 'abc' in lst[0]])
aW1wb3J0IGpzb24KaW1wb3J0IHN5cwoKbXlMaXN0ID0ganNvbi5sb2FkKHN5cy5zdGRpbikKCmRlZiBmb28obXlMaXN0LGtleSxmaXJzdD1UcnVlKToKICAgIHJldHVybiBbeCBmb3IgeCBpbiBteUxpc3QgaWYga2V5IGluIHggb3Igbm90IGZpcnN0IGFuZCBrZXkgaW4geFsxXV0KCgpwcmludCgiZm9vOiIpCnByaW50KGZvbyhteUxpc3QsICdhYmMnLCBmaXJzdD1UcnVlKSkKcHJpbnQoZm9vKG15TGlzdCwgJ2FiYycsIGZpcnN0PUZhbHNlKSkKCnByaW50KCJpZiBhbnkoKToiKQpwcmludChbbHN0IGZvciBsc3QgaW4gbXlMaXN0IGlmIGFueSgnYWJjJyBpbiBzIGZvciBzIGluIGxzdCldKQpwcmludChbbHN0IGZvciBsc3QgaW4gbXlMaXN0IGlmICdhYmMnIGluIGxzdFswXV0pCgoK