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