include [HTML_REMOVED]
using namespace std;
const int N = 100010;
int a[N], b[N];
int m, n, x;
int main()
{
cin >> n >> m >> x;
for(int i = 0; i < n; i ) cin >> a[i];
for(int i = 0; i < m; i ) cin >> b[i];
int i = 0, j = m - 1;
while(a[i] + b[j] != x)
{
while(a[i] + b[j] > x) j –;
while(a[i] + b[j] < x) i ++;
}
cout << i << ” ” << j <<endl;
}