#!/bin/bash
 
diophantine()
{
    local i
    local n=$1
    [[ ${n} -eq 0 ]] && echo "${ilist[@]}" ||
    {
        for ((i = n; i > 0; i--))
        do
            ilist[${#ilist[@]}]=${i}
            diophantine $((n-i))
        done               
    }    
    unset ilist[${#ilist[@]}-1]
}
 
read input
 
RE_POSITIVE_INTEGER="^[1-9]+$"
[[ ! ${input} =~ ${RE_POSITIVE_INTEGER} ]] && echo "usage: $(basename $0) <Z+>" ||
{
    declare -a ilist=
    diophantine ${input}
}
exit 