import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int i;
		int ar[] = new int[100];
		
		int idx = 0;
		
		while ( sc.hasNext() ) {
			int n = sc.nextInt();
			i = idx - 1;
			while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			}
			ar[i + 1] = n;
			++idx;
		}
		for ( i = idx - 1 ; i >= 0 && i >= idx - 3 ; --i ) {
			System.out.println(ar[i]);
		}
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int i;
		int ar[] = new int[100];
		
		int idx = 0;
		
		while ( sc.hasNext() ) {
			int n = sc.nextInt();
			i = idx - 1;
			while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			}
			ar[i + 1] = n;
			++idx;
		}
		for ( i = idx - 1 ; i >= 0 && i >= idx - 3 ; --i ) {
			System.out.println(ar[i]);
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int i;
		int ar[] = new int[100];
		
		int idx = 0;
		
		while ( sc.hasNext() ) {
			int n = sc.nextInt();
			i = idx - 1;
			while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			}
			ar[i + 1] = n;
			++idx;
		}
		for ( i = idx - 1 ; i >= 0 && i >= idx - 3 ; --i ) {
			System.out.println(ar[i]);
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int i;
		int ar[] = new int[100];
		
		int idx = 0;
		
		while ( sc.hasNext() ) {
			int n = sc.nextInt();
			i = idx - 1;
			while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			}
			ar[i + 1] = n;
			++idx;
		}
		for ( i = idx - 1 ; i >= 0 && i >= idx - 3 ; --i ) {
			System.out.println(ar[i]);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int i; i int ar[] = new int[100]; ar new int[100] 100 int idx = 0; idx 0 while ( sc.hasNext() ) {
			int n = sc.nextInt();
			i = idx - 1;
			while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			}
			ar[i + 1] = n;
			++idx;
		} sc.hasNext() sc.hasNext sc {
			int n = sc.nextInt();
			i = idx - 1;
			while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			}
			ar[i + 1] = n;
			++idx;
		} int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc i = idx - 1 i idx - 1 idx 1 while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			} i >= 0 && n < ar[i] i >= 0 i 0 n < ar[i] n ar[i] ar i {
				ar[i + 1] = ar[i];
				--i;
			} ar[i + 1] = ar[i] ar[i + 1] ar i + 1 i 1 ar[i] ar i --i i ar[i + 1] = n ar[i + 1] ar i + 1 i 1 n ++idx idx for ( i = idx - 1 ; i >= 0 && i >= idx - 3 ; --i ) {
			System.out.println(ar[i]);
		} i = idx - 1 ; i = idx - 1 i idx - 1 idx 1 i >= 0 && i >= idx - 3 i >= 0 i 0 i >= idx - 3 i idx - 3 idx 3 --i --i i {
			System.out.println(ar[i]);
		} {
			System.out.println(ar[i]);
		} System.out.println(ar[i]) System.out.println System.out System System.out ar[i] ar i String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int i;
		int ar[] = new int[100];
		
		int idx = 0;
		
		while ( sc.hasNext() ) {
			int n = sc.nextInt();
			i = idx - 1;
			while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			}
			ar[i + 1] = n;
			++idx;
		}
		for ( i = idx - 1 ; i >= 0 && i >= idx - 3 ; --i ) {
			System.out.println(ar[i]);
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int i;
		int ar[] = new int[100];
		
		int idx = 0;
		
		while ( sc.hasNext() ) {
			int n = sc.nextInt();
			i = idx - 1;
			while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			}
			ar[i + 1] = n;
			++idx;
		}
		for ( i = idx - 1 ; i >= 0 && i >= idx - 3 ; --i ) {
			System.out.println(ar[i]);
		}
	}

} Main
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int i;
		int ar[] = new int[100];
		
		int idx = 0;
		
		while ( sc.hasNext() ) {
			int n = sc.nextInt();
			i = idx - 1;
			while (i >= 0 && n < ar[i]) {
				ar[i + 1] = ar[i];
				--i;
			}
			ar[i + 1] = n;
			++idx;
		}
		for ( i = idx - 1 ; i >= 0 && i >= idx - 3 ; --i ) {
			System.out.println(ar[i]);
		}
	}

}