#include<bits/stdc++.h>
using namespace std;
int FIND_ELE(int *ARR,int &N)
{
int K=1,SMALL=ARR[0],LARGE=ARR[0];
while(K<N)
{
if(ARR[K]<SMALL)
SMALL=ARR[K];
if(ARR[K]>LARGE)
LARGE=ARR[K];
K++;
}
cout<<"Smallest Element Is: "<<SMALL<<endl;
cout<<"Largest Element Is: "<<LARGE<<endl;
return 0;
}
int main()
{
int N;
cin>>N;
int ARR[N];
for(int i=0;i<N;i++)
cin>>ARR[i];
FIND_ELE(ARR,N);
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBGSU5EX0VMRShpbnQgKkFSUixpbnQgJk4pCnsKICAgIGludCBLPTEsU01BTEw9QVJSWzBdLExBUkdFPUFSUlswXTsKICAgIHdoaWxlKEs8TikKICAgIHsKICAgICAgICBpZihBUlJbS108U01BTEwpCiAgICAgICAgICAgIFNNQUxMPUFSUltLXTsKICAgICAgICBpZihBUlJbS10+TEFSR0UpCiAgICAgICAgICAgIExBUkdFPUFSUltLXTsKICAgICAgICBLKys7CiAgICB9CiAgICBjb3V0PDwiU21hbGxlc3QgRWxlbWVudCBJczogIjw8U01BTEw8PGVuZGw7CiAgICBjb3V0PDwiTGFyZ2VzdCBFbGVtZW50IElzOiAiPDxMQVJHRTw8ZW5kbDsKICAgIHJldHVybiAwOwp9CgoKaW50IG1haW4oKQp7CiAgICBpbnQgTjsKICAgIGNpbj4+TjsKICAgIGludCBBUlJbTl07CiAgICBmb3IoaW50IGk9MDtpPE47aSsrKQogICAgICAgIGNpbj4+QVJSW2ldOwoKICAgIEZJTkRfRUxFKEFSUixOKTsKCiAgICByZXR1cm4gMDsKfQ==