POJ 2105 - Format IP Address

Input:
Numbers of lines of binary strings
one string per line
Output:
Human-readable IP

Sample:
Input:
4
00000000000000000000000000000000 
00000011100000001111111111111111 
11001011100001001110010110000000 
01010000000100000000000000000001 

Output:
0.0.0.0
3.128.255.255
203.132.229.128
80.16.0.1

======

Using sstream