I don't know what's wrong Even it is working for negative numbers too but still 4th req is not paasing
package com.codegym.task.task05.task0532;
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n= Integer.parseInt(reader.readLine());
int maximum =0;
int first; int temp=0;
for(int i=0;i<n;i++){
first = Integer.parseInt(reader.readLine());
if(first<=temp){
maximum=temp;
}
else {
maximum=first;
temp=first;
}
}
System.out.println(maximum);
}
}