Although the code runs well and it gives out the maximum of the 4 numbers the last 2 conditions are not being satisfied. help!
package com.codegym.task.task04.task0419;
/*
Maximum of four numbers
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader n = new BufferedReader(new InputStreamReader(System.in));
String P = n.readLine();
int p = Integer.parseInt(P);
String Q = n.readLine();
int q = Integer.parseInt(Q);
String R = n.readLine();
int r = Integer.parseInt(R);
String S = n.readLine();
int s = Integer.parseInt(S);
if(p>q||r>s){
if(p>r)
System.out.println(p);
else
System.out.println(r);
}
else if(q>p||s>r){
if(q>s)
System.out.println(q);
else
System.out.println(s);
}
else if(p>q||s>r){
if(p>s)
System.out.println(p);
else
System.out.println(s);
}
else if(q>p||r>s){
if(q>r)
System.out.println(q);
else
System.out.println(r);
}
else if(p==q||r==s){
if(p==q)
System.out.println(p);
else
System.out.println(s);
}
else
System.out.println("khkh");
//write your code here
}
}