#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> t;
  while (t--) {
    long long int i, j, k, m, n, ans = 0;
    string s;
    cin >> s;
    n = s.length();
    long long int c0 = 0, c1 = 0;
    for (i = 0; i < n; i++)
      if (s[i] == '0')
        c0++;
      else
        c1++;
    if (c0 == 0 || c1 == 0)
      cout << s << "\n";
    else {
      string s1;
      if (s[0] == '0') {
        for (i = 0; i < n; i++) s1 += "01";
      } else
        for (i = 0; i < n; i++) s1 += "10";
      cout << s1 << "\n";
    }
  }
  return 0;
}
