#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)(1e17);
const int N = 1e9;
const int MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int tc;
  cin >> tc;
  while (tc--) {
    string t;
    cin >> t;
    int n = t.length();
    bool z = false, o = false;
    for (int i = 0; i < n; i++) {
      if (t[i] == '1')
        o |= true;
      else
        z |= true;
    }
    if (z & o) {
      string s = string(2 * n, '0');
      for (int i = 1; i < 2 * n; i += 2) {
        s[i] = '1';
      }
      cout << s << endl;
    } else {
      cout << t << endl;
    }
  }
}
