import re import sys for line in sys.stdin: A = len(re.findall(r'[a-ząćęłńóśźż]', line)) B = len(re.findall(r'[A-ZĄĆĘŁŃÓŚŹŻ]', line)) C = len(re.findall(r'\d', line)) line = line.rstrip('\n') D = len(line) - A - B - C sys.stdout.write(f"{A} {B} {C} {D}\n")