Help me in solving MAXTHREE problem

I am getting a SIGHUP error with the code. Pls help me

import java.util.;
import java.lang.
;
import java.io.*;

class Codechef
{
public static void main (String args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
System.out.println(n);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
if(a>b && a>c)
System.out.print(a);
else if(b>c && b>a)
System.out.print(b);
else{
System.out.print(c);
}
}
}

@srihitha6
Plzz refer my c++ code for better understanding of the logic

#include <iostream>
using namespace std;


void maxi(){
    int a, b, c;
    cin >> a >> b >> c;
    int max_value = a;
    if (b > max_value) {
        max_value = b;
    }
    if (c > max_value) {
        max_value = c;
    }
    cout<< max_value <<endl;
}

int main() {
    int N;
    cin>>N;
    while(N--)
    {
        maxi();
    }
}