#include <bits/stdc++.h>
using namespace std;
int main () { int a[1000],n,i;
cin >> n;
for (int i=1;i<=n;i++)
cin >> a[i];
for (int i=2;i<=n;i++)
if (((a[i]<0) and (a[i-1]<0)) or ((a[i]>0) and (a[i-1]>0))) {
cout << a[i-1] <<" " << a[i];
break; }
return 0;
}