#include <stdio.h> int main() { long num; while( scanf("%ld",&num)==1 && num!=0 ) { if( num/100%10 == 6 ) printf( "%ld\n", num ); } return 0; }