Adding classes to the beginning of the files with another ugly bash
command:

for i in {1..20}; do sed -i tmp '1 i\
class Solution'$i' \
end\
'  problem$i/solution.rb ; done