The coin catastrophe In Golfenhagen, The people are allowed, and encouraged, to melt down old coins for scrap metal, if the smelter can make a profit off of it. There are 5 coins that make the Golfenhagen mint. The half-penny(0.5)(H), the penny(1)(P), the tea (5)(T), the flag (10)(F), and the driver (25)(D). Golfenhagen also mints bills, in the form of 100(O), 500(E), 1000(N), and 2500(Y). Recently, the price of metals has plumetted to an all time low, and so everybody is trying to give their coins away, as they are worth less than the bills.

A humble software engineer decides to write a program that will guarantee that those who pay with cash will always get at least 9 coins back on any purchase whose net difference is bigger than 3 cents.

Your challenge:

Take on the role of developer, and write a program that takes one input (the net difference of the money handed out and the purchase total) and outputs the correct change.

You must:


Make your program put out a nominal of 9 coins with any decimal, except where the difference is less than 5 cents (5).  
Make your program output a diverse set of coins, all coins MUST be able to be outputted by your program. no giving change in exclusively in halfcents.
Use the dollar bills where applicable.
This is a golf, the shortest code wins


Examples:


  301
  OODDDTTTTTP  


This is a valid output. There are two dollars ("OO"), and 9 coins ("DDDTTTTTP ").


  5693
  2Y1E1O2D3F2T3P  


This is also valid output, as it specifies the currency type and quantities, and has 10 coins.


  412
  OOOODPP  


This is not valid output, as it only uses 3 coins. 


  20
  10P20H  


This is not valid, see the second rule

Code example of a change counter for the least change possible. (as requested per cold golf)

package lookup;

public class Main {

    static void main(String[]s) {

        int changeincents = 53;
        int quartercount  =  0;
        int dimecount     =  0;
        int nickelcount   =  0;
        int pennycount    =  0;
        while(changeincents &gt;= 25){//value of a quarter
            quartercount++;
            changeincents-=25;
        }
        while(changeincents &gt;= 10){
            dimecount++;
            changeincents-=10;
        }
        while(changeincents &gt;= 5){
            nickelcount++;
            changeincents-=5;
        }
        while(changeincents &gt;= 1){
            pennycount++;
            changeincents--;
        }
    }
}


Good luck!
Haskell, 177 165 bytes

Thanks to @Lynn.

f n|n&gt;2504='Y':f(n-2500)|n&gt;1004='N':f(n-1000)|n&gt;504='E':f(n-500)|n&gt;104='O':f(n-100)|n&gt;29='D':f(n-25)|n&gt;14='F':f(n-10)|n&gt;9='T':f(n-5)|n&gt;6='P':f(n-1)|0&lt;1=[1..2*n]&gt;&gt;"H"


In a readable format:

f n
  | n &gt; 2504 = "Y" ++ f(n-2500)
  | n &gt; 1004 = "N" ++ f(n-1000)
  | n &gt; 504 = "E" ++ f(n-500)
  | n &gt; 104 = "O" ++ f(n-100)
  | n &gt; 29 = "D" ++ f(n-25)
  | n &gt; 14 = "F" ++ f(n-10)
  | n &gt; 9 = "T" ++ f(n-5)
  | n &gt; 6 = "P" ++ f(n-1)
  | 0 &lt; 1 = replicate (2*n) 'H'


Just give out the biggest denomination which still leaves more than 5 cents to fill with halfcoins.