#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    char q[2 * s.size()];
    long long k = 0;
    long long flag = 0;
    for (long long i = 1; i < s.size(); i++) {
      if (s[i] != s[i - 1]) {
        flag = 1;
        break;
      }
    }
    if (!flag) {
      cout << s << "\n";
    } else {
      long long f = 0;
      if (s[0] == '0') {
        q[k++] = '0';
        q[k++] = '1';
        f = 1;
      } else {
        q[k++] = '1';
        q[k++] = '0';
        f = 0;
      }
      for (long long i = 1; i < s.size(); i++) {
        if (s[i] == '0' && f == 0) {
          q[k++] = '1';
          q[k++] = '0';
          f = 0;
        } else if (s[i] == '1' && f == 0) {
          q[k++] = '1';
          q[k++] = '0';
          f = 0;
        } else if (s[i] == '0' && f == 1) {
          q[k++] = '0';
          q[k++] = '1';
          f = 1;
        } else {
          q[k++] = '0';
          q[k++] = '1';
          f = 1;
        }
      }
      for (long long i = 0; i < 2 * s.size(); i++) {
        cout << q[i];
      }
      cout << "\n";
    }
  }
  return 0;
}
