#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long int zero = 0, one = 0;
    for (long long int i = 0; i < s.length(); i++) {
      if (s[i] == '0')
        zero++;
      else
        one++;
    }
    if (zero == 0 || one == 0)
      cout << s << endl;
    else {
      string p;
      if (s[0] == '0')
        p = "0";
      else
        p = "1";
      long long int i = 1;
      while (i < s.length()) {
        if (s[i] == s[i - 1]) {
          if (s[i] == '1')
            p = p + "0" + s[i];
          else
            p = p + "1" + s[i];
        } else
          p = p + s[i];
        i++;
      }
      cout << p << endl;
    }
  }
  return 0;
}
