#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tc;
  cin >> tc;
  while (tc--) {
    string s;
    cin >> s;
    int l = s.size(), t1 = count(s.begin(), s.end(), '1'), t2 = l - t1;
    if (t1 == 0 || t2 == 0)
      cout << s << "\n";
    else {
      string res;
      if (s[0] == '1') {
        while (l--) res += "10";
      } else {
        while (l--) res += "01";
      }
      cout << res << "\n";
    }
  }
  return 0;
}
