#include <bits/stdc++.h>
using namespace std;
int main() {
  int cases;
  cin >> cases;
  for (int i = 0; i < cases; i++) {
    bool isSame = true;
    string str;
    cin >> str;
    for (int j = 1; j < str.length(); j++) {
      if (str[j - 1] == str[j])
        continue;
      else
        isSame = false;
    }
    if (isSame)
      cout << str << endl;
    else {
      if (str.length() <= 2)
        cout << str << endl;
      else {
        for (int k = 0; k < str.length() - 1; k++) {
          cout << "10";
        }
        cout << "10" << endl;
      }
    }
  }
}
