#line 1 "freespace/main.cpp" #include #line 2 "library/gandalfr/types.hpp" #line 5 "library/gandalfr/types.hpp" namespace gandalfr { using i8 = __int8_t; using i16 = __int16_t; using i32 = __int32_t; using i64 = __int64_t; using i128 = __int128_t; using u8 = __uint8_t; using u16 = __uint16_t; using u32 = __uint32_t; using u64 = __uint64_t; using u128 = __uint128_t; constexpr i8 IMAX8 = INT8_MAX; constexpr i16 IMAX16 = INT16_MAX; constexpr i32 IMAX32 = INT32_MAX; constexpr i64 IMAX64 = INT64_MAX; constexpr i8 IMIN8 = INT8_MIN; constexpr i16 IMIN16 = INT16_MIN; constexpr i32 IMIN32 = INT32_MIN; constexpr i64 IMIN64 = INT64_MIN; constexpr u8 UMAX8 = UINT8_MAX; constexpr u16 UMAX16 = UINT16_MAX; constexpr u32 UMAX32 = UINT32_MAX; constexpr u64 UMAX64 = UINT64_MAX; constexpr i64 MOD998 = 998244353; constexpr i64 MOD107 = 1000000007; constexpr double PI = M_PI; const i32 INF = 1001001001; const i64 INFLL = 1001001001001001001; #define rep(i, j, n) for (i64 i = (i64)(j); i < (i64)(n); i++) #define rrep(i, j, n) for (i64 i = (i64)(n - 1); i >= (i64)(j); i--) #define all(a) (a).begin(), (a).end() #define LF cout << endl template void print_debug(T t) { std::cerr << t << std::endl; } template void print_debug(First parm1, Rest... parm) { std::cerr << parm1 << ", ", print_debug(parm...); } #define debug(...) \ { \ std::cerr << #__VA_ARGS__ << ": "; \ print_debug(__VA_ARGS__); \ } template inline bool chmax(T &a, const T &b) { return a < b && (a = b, true); } template inline bool chmin(T &a, const T &b) { return a > b && (a = b, true); } template inline bool map_chmax(std::map &mp, const Key &a, const Value &b) { auto it = mp.find(a); return it == mp.end() ? (mp[a] = b, true) : chmax(it->second, b); } template inline bool map_chmin(std::map &mp, const Key &a, const Value &b) { auto it = mp.find(a); return it == mp.end() ? (mp[a] = b, true) : chmin(it->second, b); } void Yes(bool ok) { std::cout << (ok ? "Yes" : "No") << std::endl; } } // namespace gandalfr #line 10 "library/gandalfr/other/io.hpp" template std::ostream &operator<<(std::ostream &os, const std::vector &v) { for (size_t i = 0; i < v.size(); ++i) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; } template std::ostream &operator<<(std::ostream &os, const std::set &st) { for (auto it = st.begin(); it != st.end(); ++it) { os << *it << (std::next(it) != st.end() ? " " : ""); } return os; } template std::ostream &operator<<(std::ostream &os, const std::multiset &st) { for (auto it = st.begin(); it != st.end(); ++it) { os << *it << (std::next(it) != st.end() ? " " : ""); } return os; } template std::ostream &operator<<(std::ostream &os, const std::pair &p) { os << '(' << p.first << ", " << p.second << ')'; return os; } template std::ostream &operator<<(std::ostream &os, std::queue q) { while (!q.empty()) { os << q.front() << (q.size() > 1 ? " " : ""); q.pop(); } return os; } template std::ostream &operator<<(std::ostream &os, const std::deque &dq) { for (size_t i = 0; i < dq.size(); ++i) { os << dq[i] << (i + 1 != dq.size() ? " " : ""); } return os; } template std::ostream &operator<<(std::ostream &os, std::priority_queue q) { while (!q.empty()) { os << q.top() << (q.size() > 1 ? " " : ""); q.pop(); } return os; } template std::ostream &operator<<(std::ostream &os, const std::map &m) { for (auto it = m.begin(); it != m.end(); ++it) { os << *it << (std::next(it) != m.end() ? " " : ""); } return os; } template std::ostream &operator<<(std::ostream &os, const std::unordered_map &um) { for (auto it = um.begin(); it != um.end(); ++it) { os << *it << (std::next(it) != um.end() ? " " : ""); } return os; } ///////////////////// input ///////////////////// template std::istream &operator>>(std::istream &is, std::vector &v) { for (T &in : v) is >> in; return is; } template std::istream &operator>>(std::istream &is, std::pair &p) { is >> p.first >> p.second; return is; } #line 2 "library/gandalfr/standard/HashMap.hpp" #include #line 5 "library/gandalfr/standard/HashMap.hpp" namespace gandalfr { template , typename Eq = std::equal_to> using HashMap = __gnu_pbds::gp_hash_table; } #line 5 "freespace/main.cpp" using namespace std; using namespace gandalfr; int main(void) { i32 N; cin >> N; HashMap mp; rep(i,0,N) { string s; cin >> s; rep(c,0,26) { string tmp = s + char('a' + c); sort(all(tmp)); mp[tmp]++; } } for (auto [str, v] : mp) { if (v == 1) { cout << str << endl; return 0; } } cout<< -1 << endl; }