#include <bits/stdc++.h>
using namespace std;
void run() {
  string t;
  cin >> t;
  int fl = 0;
  for (int i = 1; i < t.size(); ++i)
    if (t[i] != t[i - 1]) fl = 1;
  if (fl == 0) {
    cout << t << '\n';
    return;
  }
  string s;
  s.reserve(t.size() * 2);
  s.push_back(t[0]);
  for (int i = 1; i < t.size(); ++i) {
    if (s.back() == t[i]) s.push_back((!(t[i] - '0')) + '0');
    s.push_back(t[i]);
  }
  cout << s << '\n';
}
int main() {
  int T;
  cin >> T;
  while (T--) run();
  return 0;
}
