#include using namespace std; #include using namespace atcoder; using mint = modint; using ll = long long; #define rep(i, n) for(int i = 0; i < n; i++) int main() { int N; cin >> N; vector a(N); rep(i, N) cin >> a[i]; sort(a.begin(), a.end()); mint x = 0; rep(i, N) x = x * 10 + a[i]; cout << x.val() << endl; }