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