#include <bits/stdc++.h>
using namespace std;
int main() {
  int q;
  cin >> q;
  while (q--) {
    string a;
    string s;
    cin >> s;
    int z = 0, o = 0;
    for (int i = 0; i < s.size(); ++i) {
      z += s[i] == '0';
      o += s[i] == '1';
    }
    if (z == 0 || o == 0) {
      cout << s << '\n';
    } else {
      for (int i = 0; i < s.size(); ++i) {
        a += "10";
      }
      cout << a << '\n';
    }
  }
  return 0;
}
