#include <bits/stdc++.h>
std::string s;
int main() {
  int t;
  std::cin >> t;
  while (t--) {
    std::cin >> s;
    bool sf = false, tf = false;
    for (auto u : s)
      if (u == '1') {
        sf = true;
      } else {
        tf = true;
      }
    if (sf && tf) {
      for (int i = 1, x = s.length(); i <= x; ++i) {
        std::cout << "01";
      }
    } else {
      std::cout << s;
    }
    std::cout << std::endl;
  }
  return 0;
}
