#include <stdio.h>

int main() {
    int N, digit;
    
    // Input the number
    printf("Enter a natural number: ");
    scanf("%d", &N);
    
    // Process each digit
    while (N > 0) {
        digit = N % 10; // Extract the last digit
        
        // Check if the digit is not a square of 2 (1 or 4)
        if (digit != 1 && digit != 4) {
            printf("%d ", digit); // Print the digit
        }
        
        N = N / 10; // Remove the last digit
    }
    
    return 0;
}