#include <stdio.h>

int main(void)
{
    int x;

    for(x = 0; x < 20; x++) {

        if(x % 3 == 0 && x % 5 == 0) {
            printf("%d#\n", x);
        }
        else if(x % 3 == 0) {
            printf("%d?\n", x);
        }
        else if(x % 5 == 0) {
            printf("%d!\n", x);
        }
        else {
            printf("%d\n", x);
        }

    }

    return 0;
}