#include <bits/stdc++.h>
using namespace std;
vector<int> p(1000007);
vector<bool> vs(1000007);
vector<int> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int on = 0;
    int zr = 0;
    int sz = s.length();
    int i;
    for (i = 0; i < sz; i++) {
      if (s[i] == '1')
        on++;
      else
        zr++;
    }
    if (on == 0 || zr == 0) {
      cout << s << endl;
      continue;
    }
    string t1 = "";
    string t2 = "";
    int x = 0;
    for (i = 0; i < 2 * sz; i++) {
      t1 += char(x + 48);
      x ^= 1;
    }
    x = 1;
    for (i = 0; i < 2 * sz; i++) {
      t2 += char(x + 48);
      x ^= 1;
    }
    if (s[0] == '0') {
      cout << t1 << endl;
    } else {
      cout << t2 << endl;
    }
  }
}
