#include <iostream>
#include <string>
#include <vector>
class C {
std::vector<char> line[2];
public:
C(std::string s) {
int j = 0;
for (unsigned int i = 0; i < s.length(); i++)
if (s[i] != ' ')
line[(j++ % 2)].push_back(s[i]);
}
friend std::ostream &operator<<(std::ostream &s, C obj) {
std::vector<char>::iterator p = obj.line[0].begin();
for (;p != obj.line[0].end(); p++)
s << *p << ' ';
s << std::endl << ' ';
p = obj.line[1].begin();
for (;p != obj.line[1].end(); p++)
s << *p << ' ';
return s;
}
};
int main() {
C a("123456789"), b("The earth turns around the sun.");
std::cout << a << std::endl;
std::cout << b << std::endl;
return 0;
}
/* end */