import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by IntelliJ IDEA.
 * User: gloyaute
 * Date: 10 16 2011
 * Time: 10:35:04
 * To change this template use File | Settings | File Templates.
 */

public class IPv4 {
    private static Pattern p = Pattern.compile("(([0-9]*).([0-9]*).([0-9]*).([0-9]*))");


    private static byte[] ipv4(String s) {
        byte[] returned = new byte[4];

        Matcher m = p.matcher(s);
        if(m.matches()) {
            for(int i = 0; i < 4; ++i) {
                returned[i] = Byte.parseByte(m.group(i + 2));
            }
        }
        return returned;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);


        while(scanner.hasNext()) {
            String s = scanner.next();
            byte[] t = ipv4(s);
            for(int i = 0; i < 4; ++i) {
                System.out.println(t[i]);
            }
        }

        scanner.close();
    }
}
