#include <iostream>
using namespace std;

void func(int* p, int n);

int main() {

    int arr[6] = { 0 };
    for (int i = 0; i < 6; i++) {
        cin >> arr[i];
    }

    func(arr, 6);

    for (int i = 0; i < 6; i++) {
        if (i == 5) {
            cout << arr[i] << endl;
        }
        else {
            cout << arr[i] << " ";
        }
    }

    return 0;
}

void func(int* p, int n) {

    int count0=0;
    int tmp;
    // write your code here......
    for (int i=0;i<n-count0;i++)
    {
        if(p[i] == 0)
        {
            for(int j=i;j<n-1;j++)
            {
                tmp=p[j];
                p[j]=p[j+1];
                p[j+1]=tmp;

            }


        }
    }

    }