#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  int n = s.length();
  int zeros = 0;
  int ones = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0')
      zeros++;
    else
      ones++;
  }
  if (zeros == 0 || ones == 0) {
    cout << s;
    return;
  }
  int k = n - 1;
  if (s[0] == '0') {
    for (int i = 0; i < k; i++) {
      cout << 0 << 1;
    }
  } else {
    for (int i = 0; i < k; i++) {
      cout << 1 << 0;
    }
  }
}
int main(int args, char** argv) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    solve();
    cout << endl;
  }
  return 0;
}
