#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 9;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int len = s.length();
    bool flag = true;
    for (int i = 0; i < len; i++) {
      if (s[i] != s[0]) {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << s;
    } else {
      for (int i = 1; i <= len; i++) {
        cout << s[0] << !(s[0] - '0');
      }
    }
    cout << "\n";
  }
  return 0;
}
