// tab2space (c) 2011 org100h.com
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char * argv[]) {
try {
if(argc > 2) throw "too many parameters.";
auto tabstop = (argc == 2) ? atol(argv[1]) : 4;
for(;;) {
string line;
getline(cin, line);
if(!cin) break;
string newline;
auto index = 0;
for(auto I = line.begin(); I != line.end(); ++I) {
if(*I == '\t') {
do {
newline.push_back(' ');
index++;
} while(index % tabstop != 0);
} else {
newline.push_back(*I);
index++;
}
}
cout << newline << endl;
}
return EXIT_SUCCESS;
} catch(const char * cause) {
cout << "error: " << cause << endl;
} catch(...) {
cout << "unknown error." << endl;
}
return EXIT_FAILURE;
}