#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    bool a = 0;
    int len_s = s.size();
    for (int i = 0; i < len_s - 1; i++) {
      if (s[i] != s[i + 1]) a = 1;
    }
    if (a == 1) {
      for (int i = 0; i < len_s; i++) cout << "10";
      cout << endl;
    } else
      cout << s << endl;
  }
  return 0;
}
