#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    string s;
    cin >> s;
    int flag0 = 0, flag1 = 0;
    for (int i = 0; i < s.length(); ++i) {
      if (s[i] == '0' && flag0 == 0) {
        flag0 = 1;
      }
      if (s[i] == '1' && flag1 == 0) {
        flag1 = 1;
      }
    }
    if (flag1 && !flag0) {
      cout << s << endl;
    } else if (!flag1 && flag0) {
      cout << s << endl;
    } else {
      char prev = s[0];
      cout << s[0];
      for (int i = 1; i < s.length(); ++i) {
        if (s[i] == prev) {
          if (prev == '0') {
            cout << '1';
          } else {
            cout << '0';
          }
          cout << s[i];
          prev = s[i];
        } else {
          cout << s[i];
          prev = s[i];
        }
      }
      cout << endl;
    }
  }
}
