Hungary is a lot poorer than Poland. So Hungary would be far cheaper. However the standard of living is lower in Hungary, so a holiday would be less luxurious. Unless your staying in tourist areas, then you will pay tourist prices any how.
I personally prefer Poland, very clean stylish and better public transport.
(been their, don it. Poland has changed the most over the last 15 years, it now is a little like Scandinavian country's.
Also note, Unless you like football, make sure your not arriving during the football season. they celebrate it in a big way).
You would find it hard to spend a grand in only four days in either country. Unless you decided to stay in 4 or 5 star hotels.
Generally accommodation will be the biggest cost, often an apartment will work out cheaper, than hotels.
Ukraine is cheaper than Hungary or Poland. Beer cost 20p a large bottle in outside taverns, or around £1 in expensive places.
Ukraine and Hungary suffer from more pick pocket crime, so be careful with your cash. best to use cash point machines (ATM), to avoided carrying large amounts of cash.