import std.stdio, std.conv, std.string, std.range, std.array, std.algorithm;

void main()
{
  int n = readln().chomp().to!int;
  string minS = readln().chomp();

  for (int i = 0; i < n - 1; i++){
    string dic = readln().chomp();
    if (dic < minS){
      minS = dic;
    }
  }

  writeln(minS);
}