# your code goes here
import sys
input = sys.stdin.readline
T = int(input().rstrip())
for _ in range(T):
dollar = int(input().rstrip()) / 100
print(dollar)
print(int(dollar // 0.25), end = ' ')
dollar %= 0.25
print(dollar)
print(int(dollar // 0.10), end = ' ')
dollar %= 0.10
print(dollar)
print(int(dollar // 0.05), end = ' ')
dollar %= 0.05
print(dollar)
print(int(dollar // 0.01), end = ' ')
print()
IyB5b3VyIGNvZGUgZ29lcyBoZXJlCmltcG9ydCBzeXMKCmlucHV0ID0gc3lzLnN0ZGluLnJlYWRsaW5lCgpUID0gaW50KGlucHV0KCkucnN0cmlwKCkpCgpmb3IgXyBpbiByYW5nZShUKToKICBkb2xsYXIgPSBpbnQoaW5wdXQoKS5yc3RyaXAoKSkgLyAxMDAKICBwcmludChkb2xsYXIpCiAgcHJpbnQoaW50KGRvbGxhciAvLyAwLjI1KSwgZW5kID0gJyAnKQogIGRvbGxhciAlPSAwLjI1CiAgcHJpbnQoZG9sbGFyKQogIHByaW50KGludChkb2xsYXIgLy8gMC4xMCksIGVuZCA9ICcgJykKICBkb2xsYXIgJT0gMC4xMAogIHByaW50KGRvbGxhcikKICBwcmludChpbnQoZG9sbGFyIC8vIDAuMDUpLCBlbmQgPSAnICcpCiAgZG9sbGFyICU9IDAuMDUKICBwcmludChkb2xsYXIpCiAgcHJpbnQoaW50KGRvbGxhciAvLyAwLjAxKSwgZW5kID0gJyAnKQogIHByaW50KCk=