document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int n,oneCount=0,twoCount=0,threeCount=0;
  9. cin>>n;
  10. for(int i=0;i<n;i++)
  11. {
  12. int input;
  13. cin>>input;
  14. switch(input)
  15. {
  16. case 1:
  17. oneCount++;
  18. break;
  19. case 2:
  20. twoCount++;
  21. break;
  22. case 3:
  23. threeCount++;
  24. break;
  25. }
  26. }
  27. for(int i1=0;i1<oneCount;i1++)
  28. {
  29. cout<<"1"<<" ";
  30. }
  31. for(int i2=0;i2<twoCount;i2++)
  32. {
  33. cout<<"2"<<" ";
  34. }
  35. for(int i3=0;i3<threeCount;i3++)
  36. {
  37. cout<<"3"<<" ";
  38. }
  39. return 0;
  40. }
');