package cn.ifiv5.IP;
*
* @author fanghao
public class Main {
new Main().go();
}
String IP = null;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try{
IP = br.readLine();
}catch(IOException ex){
ex.printStackTrace();
}
IP = IP.replace(" ", "");
String []sIP = temp[0].split("\\.");
int Mask = Integer.parseInt(temp[1]);
int []ip = new int[4];
for(int i=0;i<sIP.length;i++)
{
ip[i] = Integer.parseInt(sIP[i]);
}
int b=0;
int a = Mask%8;
b=Mask/8;
StringBuffer sb = new StringBuffer();
for(int i=0;i<a;i++)
sb.append('1');
for(int i=0;i<8-a;i++)
sb.append('0');
int end =Integer.parseInt(sb.toString(),2);
ip[i] = 0;
for(int i=0;i<4;i++)
{
System.out.print(ip[i]);
if(i!=3)
System.out.print(".");
}
}
}