import std.stdio,std.string,std.conv,std.array,std.algorithm;
void main(){
	string[] arr;
	readln();
	for(;;){
		auto rc = readln().chomp();
		if(!rc){	break;	}
		arr ~= rc;
	}
	sort( arr );
	writeln( arr[0] );
}