#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int l, r, m, a, b, c, n, rr;
    cin >> l >> r >> m;
    long long int dif = r - l;
    long long int m1, m2;
    m1 = m - dif;
    m2 = m + dif;
    long long int eee = 1;
    for (int i = l; i <= r; i++) {
      if (((m2) / i) * i >= max(eee, m1)) {
        cout << i << " ";
        rr = i;
        break;
      }
    }
    rr = (m2 / rr) * rr;
    if (rr == m) {
      cout << l << " " << l << endl;
    } else if (rr > m) {
      long long int jj = rr - m;
      cout << r - jj << " ";
      cout << r << endl;
    } else {
      long long int jj = m - rr;
      cout << r << " ";
      cout << r - jj << endl;
    }
  }
}
