import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.Iterator;

public class Solution{

    static final int mod = 998244353;
    static int[] p;

    public static void main(String[] args) {

    	FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);

    	int tt = 1;
    	while(tt-->0) {

    		int n = fs.nextInt();

    		int[] cnt = new int[11];

    		int[] a = new int[n];

    		for(int i=0;i<n;i++) {
    			a[i] = fs.nextInt();
    			cnt[count(a[i])]++;
    		}

    		p = new int[21];
    		p[0] = 1;
    		for(int i=1;i<=20;i++)
    			p[i] = mul(p[i-1], 10);

    		int[] orig = new int[10];
    		orig[0] = 1;
    		for(int i=1;i<10;i++)
    			orig[i] = orig[i-1]*10;

    		int ans = 0;

    		for(int i=0;i<n;i++) {
    			int dig = count(a[i]);

    			for(int j=1;j<=10;j++	) {
    				int num = Math.max(0, dig-j);
    				int rem = dig - num;

    				if(num!=0)
    					ans = add(ans, mul(mul(a[i]/p[rem], p[rem*2]), cnt[j]*2));

    				int newNum = a[i]%p[rem];

    				ans = add(ans, mul(cal(newNum), cnt[j]));

    			}

    		}

    		out.println(ans);

    	}

    	out.close();

    }

    static int count(int n) {
    	int res = 0;
    	while(n>0) {
    		n /= 10;
    		res++;
    	}
    	return res;
    }

    static int cal(int n) {
    	ArrayDeque<Integer> queue = new ArrayDeque<Integer>();
    	while(n>0) {
    		int dig = n%10;
    		queue.addFirst(dig); queue.addFirst(dig);
    		n /= 10;
    	}
    	int ans = 0;
    	Iterator<Integer> iter = queue.descendingIterator();
    	int ind = 0;
    	while(iter.hasNext()) {
    		ans = add(ans, mul(iter.next(), p[ind++]));
    	}
    	return ans;
    }

    static int mul(int a, int b) {
    	return (int)(((long)a*b)%mod);
    }

    static int add(int a, int b) {
    	return (a+b)%mod;
    }

    static final Random random=new Random();

    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }

    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");

    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}

    	public String nextLine() throws IOException {
    		return br.readLine();
    	}

    	public int nextInt(){
    		return Integer.parseInt(next());
    	}

    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}

    	public long nextLong() {
    		return Long.parseLong(next());
    	}

    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.Iterator;

public class Solution{

    static final int mod = 998244353;
    static int[] p;

    public static void main(String[] args) {

    	FastScanner fs = new FastScanner();
    	PrintWriter out = new PrintWriter(System.out);

    	int tt = 1;
    	while(tt-->0) {

    		int n = fs.nextInt();

    		int[] cnt = new int[11];

    		int[] a = new int[n];

    		for(int i=0;i<n;i++) {
    			a[i] = fs.nextInt();
    			cnt[count(a[i])]++;
    		}

    		p = new int[21];
    		p[0] = 1;
    		for(int i=1;i<=20;i++)
    			p[i] = mul(p[i-1], 10);

    		int[] orig = new int[10];
    		orig[0] = 1;
    		for(int i=1;i<10;i++)
    			orig[i] = orig[i-1]*10;

    		int ans = 0;

    		for(int i=0;i<n;i++) {
    			int dig = count(a[i]);

    			for(int j=1;j<=10;j++	) {
    				int num = Math.max(0, dig-j);
    				int rem = dig - num;

    				if(num!=0)
    					ans = add(ans, mul(mul(a[i]/orig[rem], p[rem*2]), cnt[j]*2));

    				int newNum = a[i];
    				if(rem!=10) {
    					newNum = a[i]%orig[rem];
    				}
    				ans = add(ans, mul(cal(newNum), cnt[j]));

    			}

    		}

    		out.println(ans);

    	}

    	out.close();

    }

    static int count(int n) {
    	int res = 0;
    	while(n>0) {
    		n /= 10;
    		res++;
    	}
    	return res;
    }

    static int cal(int n) {
    	ArrayDeque<Integer> queue = new ArrayDeque<Integer>();
    	while(n>0) {
    		int dig = n%10;
    		queue.addFirst(dig); queue.addFirst(dig);
    		n /= 10;
    	}
    	int ans = 0;
    	Iterator<Integer> iter = queue.descendingIterator();
    	int ind = 0;
    	while(iter.hasNext()) {
    		ans = add(ans, mul(iter.next(), p[ind++]));
    	}
    	return ans;
    }

    static int mul(int a, int b) {
    	return (int)(((long)a*b)%mod);
    }

    static int add(int a, int b) {
    	return (a+b)%mod;
    }

    static final Random random=new Random();

    static void ruffleSort(int[] a) {
    	int n=a.length;//shuffle, then sort
    	for (int i=0; i<n; i++) {
    		int oi=random.nextInt(n); int temp=a[oi];
    		a[oi]=a[i]; a[i]=temp;
    	}
    	Arrays.sort(a);
    }

    static class FastScanner{
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringTokenizer st = new StringTokenizer("");

    	public String next(){
    		while(!st.hasMoreElements()){
    			try{
    				st = new StringTokenizer(br.readLine());
    			} catch(IOException e){
    				e.printStackTrace();
    			}
    		}
    		return st.nextToken();
    	}

    	public String nextLine() throws IOException {
    		return br.readLine();
    	}

    	public int nextInt(){
    		return Integer.parseInt(next());
    	}

    	public int[] readArray(int n){
    		int[] a = new int[n];
    		for(int i=0;i<n;i++)
    			a[i] = nextInt();
    		return a;
    	}

    	public long nextLong() {
    		return Long.parseLong(next());
    	}

    	public char nextChar() {
    		return next().toCharArray()[0];
    	}
    }

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class Solve7 {

    public static void main(String[] args) throws IOException {
        PrintWriter pw = new PrintWriter(System.out);
        new Solve7().solve(pw);
        pw.flush();
        pw.close();
    }

    public void solve(PrintWriter pw) throws IOException {
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        int[] a = new int[n];
        int[][] freq = new int[11][10];
        int[] num = new int[11];
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            a[i] = x;
            int c = 0;
            int len = 0;
            while (x != 0) {
                ++freq[c++][x % 10];
                x /= 10;
                ++len;
            }
            ++num[len];
        }
        final int MOD = 998244353;
        long ans = 0;
        for (int i = 0; i < n; i++) {
            int x = a[i];
            int c = 0;
            int digits = 0;
            for (int k = 0; k < 10; k++) {
                int count = 0;
                for (int j = 0; j < 10; j++) {
                    ans += (j * powerWithMod(10, c, MOD)) * freq[digits][j];
                    count += freq[digits][j];
                    ans %= MOD;
                }
                ++digits;
                if (count == 0) {
                    break;
                }
                ++c;
                if (x != 0) {
                    ans += 1l * (x % 10) * powerWithMod(10, c, MOD) * count;
                    ans %= MOD;
                    ++c;
                    x /= 10;
                    ans += 1l * x * powerWithMod(10, c, MOD) * num[digits];
                    ans %= MOD;
                }
            }
        }
        pw.println(ans);
    }

    public long powerWithMod(long a, long n, long mod) {
        if (n == 0) {
            return 1;
        }
        if (n == 1) {
            return a % mod;
        }
        long y = powerWithMod(a, n / 2, mod);
        if ((n & 1) == 1) {
            return (((y * y) % mod) * a) % mod;
        } else {
            return (y * y) % mod;
        }
    }

    static class FastReader {

        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
            }
        }

        public String next() {
            if (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (Exception e) {
            }
            return null;
        }

        public boolean hasNext() throws IOException {
            if (st != null && st.hasMoreTokens()) {
                return true;
            }
            String s = br.readLine();
            if (s == null || s.isEmpty()) {
                return false;
            }
            st = new StringTokenizer(s);
            return true;
        }
    }
}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class cf1195d2 {

    public static void main(String[] args) throws IOException {
        int n = ri(), a[] = ria(n), cnt_len[] = new int[11], suf_cnt_len[] = new int[12];
        for (int i : a) {
            ++cnt_len[len(i)];
        }
        // suf_cnt_len[i] = #(len >= i)
        for (int i = 10; i > 0; --i) {
            suf_cnt_len[i] = suf_cnt_len[i + 1] + cnt_len[i];
        }
        int pow10[] = new int[20], ans = 0;
        pow10[0] = 1;
        for (int i = 1; i <= 19; ++i) {
            pow10[i] = mmul(10, pow10[i - 1]);
        }
        for (int i : a) {
            int x = 0;
            while (i > 0) {
                int d = i % 10, sum = 0;
                i /= 10;
                for (int l = 1; l <= x; ++l) {
                    sum = madd(sum, mmul(pow10[l + x], d, cnt_len[l]));
                }
                sum = mmul(2, sum);
                sum = madd(sum, mmul(11, pow10[2 * x], d, suf_cnt_len[x + 1]));
                ans = madd(ans, sum);
                ++x;
            }
        }
        prln(ans);
        close();
    }

    static int mmod = 998244353;

    static int madd(int a, int b) {
        return (a + b) % mmod;
    }

    static int madd(int... a) {
        int ans = a[0];
        for (int i = 1; i < a.length; ++i) {
            ans = madd(ans, a[i]);
        }
        return ans;
    }

    static int msub(int a, int b) {
        return (a - b + mmod) % mmod;
    }

    static int mmul(int a, int b) {
        return (int) ((long) a * b % mmod);
    }

    static int mmul(int... a) {
        int ans = a[0];
        for (int i = 1; i < a.length; ++i) {
            ans = mmul(ans, a[i]);
        }
        return ans;
    }

    static int minv(int x) {
        return mpow(x, mmod - 2);
    }

    static int mpow(int a, int b) {
        if (a == 0) {
            return 0;
        }
        int ans = 1;
        while (b > 0) {
            if ((b & 1) > 0) {
                ans = mmul(ans, a);
            }
            a = mmul(a, a);
            b >>= 1;
        }
        return ans;
    }

    static int len(int x) {
        int ans = 0;
        while (x > 0) {
            ++ans;
            x /= 10;
        }
        return ans;
    }

    static BufferedReader __in = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter __out = new PrintWriter(new OutputStreamWriter(System.out));
    static StringTokenizer input;
    static Random __rand = new Random();

    // references
    // IBIG = 1e9 + 7
    // IMAX ~= 2e9
    // LMAX ~= 9e18

    // constants
    static final int IBIG = 1000000007;
    static final int IMAX = 2147483647;
    static final int IMIN = -2147483648;
    static final long LMAX = 9223372036854775807L;
    static final long LMIN = -9223372036854775808L;
    // math util
    static int minof(int a, int b, int c) {return min(a, min(b, c));}
    static int minof(int... x) {if(x.length == 1) return x[0]; if(x.length == 2) return min(x[0], x[1]); if(x.length == 3) return min(x[0], min(x[1], x[2])); int min = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] < min) min = x[i]; return min;}
    static long minof(long a, long b, long c) {return min(a, min(b, c));}
    static long minof(long... x) {if(x.length == 1) return x[0]; if(x.length == 2) return min(x[0], x[1]); if(x.length == 3) return min(x[0], min(x[1], x[2])); long min = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] < min) min = x[i]; return min;}
    static int maxof(int a, int b, int c) {return max(a, max(b, c));}
    static int maxof(int... x) {if(x.length == 1) return x[0]; if(x.length == 2) return max(x[0], x[1]); if(x.length == 3) return max(x[0], max(x[1], x[2])); int max = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] > max) max = x[i]; return max;}
    static long maxof(long a, long b, long c) {return max(a, max(b, c));}
    static long maxof(long... x) {if(x.length == 1) return x[0]; if(x.length == 2) return max(x[0], x[1]); if(x.length == 3) return max(x[0], max(x[1], x[2])); long max = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] > max) max = x[i]; return max;}
    static int powi(int a, int b) {if(a == 0) return 0; int ans = 1; while(b > 0) {if((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static long powl(long a, int b) {if(a == 0) return 0; long ans = 1; while(b > 0) {if((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static int fli(double d) {return (int)d;}
    static int cei(double d) {return (int)ceil(d);}
    static long fll(double d) {return (long)d;}
    static long cel(double d) {return (long)ceil(d);}
    static int gcf(int a, int b) {return b == 0 ? a : gcf(b, a % b);}
    static long gcf(long a, long b) {return b == 0 ? a : gcf(b, a % b);}
    static int lcm(int a, int b) {return a * b / gcf(a, b);}
    static long lcm(long a, long b) {return a * b / gcf(a, b);}
    static int randInt(int min, int max) {return __rand.nextInt(max - min + 1) + min;}
    static long mix(long x) {x += 0x9e3779b97f4a7c15L; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9L; x = (x ^ (x >> 27)) * 0x94d049bb133111ebL; return x ^ (x >> 31);}
    // array util
    static void reverse(int[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {int swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(long[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {long swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(double[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {double swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(char[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {char swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void shuffle(int[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); int swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(long[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); long swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(double[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); double swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void rsort(int[] a) {shuffle(a); sort(a);}
    static void rsort(long[] a) {shuffle(a); sort(a);}
    static void rsort(double[] a) {shuffle(a); sort(a);}
    static int[] copy(int[] a) {int[] ans = new int[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static long[] copy(long[] a) {long[] ans = new long[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static double[] copy(double[] a) {double[] ans = new double[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static char[] copy(char[] a) {char[] ans = new char[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    // graph util
    static List<List<Integer>> g(int n) {List<List<Integer>> g = new ArrayList<>(); for(int i = 0; i < n; ++i) g.add(new ArrayList<>()); return g;}
    static List<Set<Integer>> sg(int n) {List<Set<Integer>> g = new ArrayList<>(); for(int i = 0; i < n; ++i) g.add(new HashSet<>()); return g;}
    static void c(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v); g.get(v).add(u);}
    static void cto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v);}
    static void dc(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v); g.get(v).remove(u);}
    static void dcto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v);}
    // input
    static void r() throws IOException {input = new StringTokenizer(rline());}
    static int ri() throws IOException {return Integer.parseInt(rline());}
    static long rl() throws IOException {return Long.parseLong(rline());}
    static int[] ria(int n) throws IOException {int[] a = new int[n]; r(); for(int i = 0; i < n; ++i) a[i] = ni(); return a;}
    static int[] riam1(int n) throws IOException {int[] a = new int[n]; r(); for(int i = 0; i < n; ++i) a[i] = ni() - 1; return a;}
    static long[] rla(int n) throws IOException {long[] a = new long[n]; r(); for(int i = 0; i < n; ++i) a[i] = nl(); return a;}
    static char[] rcha() throws IOException {return rline().toCharArray();}
    static String rline() throws IOException {return __in.readLine();}
    static String n() {return input.nextToken();}
    static int rni() throws IOException {r(); return ni();}
    static int ni() {return Integer.parseInt(n());}
    static long rnl() throws IOException {r(); return nl();}
    static long nl() {return Long.parseLong(n());}
    static double rnd() throws IOException {r(); return nd();}
    static double nd() {return Double.parseDouble(n());}
    static List<List<Integer>> rg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for(int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rg(List<List<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<List<Integer>> rdg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for(int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdg(List<List<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for(int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rsg(List<Set<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rdsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for(int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdsg(List<Set<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    // output
    static void pr(int i) {__out.print(i);}
    static void prln(int i) {__out.println(i);}
    static void pr(long l) {__out.print(l);}
    static void prln(long l) {__out.println(l);}
    static void pr(double d) {__out.print(d);}
    static void prln(double d) {__out.println(d);}
    static void pr(char c) {__out.print(c);}
    static void prln(char c) {__out.println(c);}
    static void pr(char[] s) {__out.print(new String(s));}
    static void prln(char[] s) {__out.println(new String(s));}
    static void pr(String s) {__out.print(s);}
    static void prln(String s) {__out.println(s);}
    static void pr(Object o) {__out.print(o);}
    static void prln(Object o) {__out.println(o);}
    static void prln() {__out.println();}
    static void pryes() {__out.println("yes");}
    static void pry() {__out.println("Yes");}
    static void prY() {__out.println("YES");}
    static void prno() {__out.println("no");}
    static void prn() {__out.println("No");}
    static void prN() {__out.println("NO");}
    static void pryesno(boolean b) {__out.println(b ? "yes" : "no");};
    static void pryn(boolean b) {__out.println(b ? "Yes" : "No");}
    static void prYN(boolean b) {__out.println(b ? "YES" : "NO");}
    static void prln(int... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static void prln(long... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static void prln(double... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static <T> void prln(Collection<T> c) {int n = c.size() - 1; Iterator<T> iter = c.iterator(); for(int i = 0; i < n; __out.print(iter.next()), __out.print(' '), ++i); if(n >= 0) __out.println(iter.next()); else __out.println();}
    static void h() {__out.println("hlfd"); flush();}
    static void flush() {__out.flush();}
    static void close() {__out.close();}
}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class cf1195d2 {

    public static void main(String[] args) throws IOException {
        int n = ri(), a[] = ria(n), cnt_len[] = new int[10], suf_cnt_len[] = new int[11];
        for (int i : a) {
            ++cnt_len[len(i)];
        }
        // suf_cnt_len[i] = #(len >= i)
        for (int i = 9; i > 0; --i) {
            suf_cnt_len[i] = suf_cnt_len[i + 1] + cnt_len[i];
        }
        int pow10[] = new int[20], ans = 0;
        pow10[0] = 1;
        for (int i = 1; i <= 19; ++i) {
            pow10[i] = mmul(10, pow10[i - 1]);
        }
        for (int i : a) {
            int x = 0;
            while (i > 0) {
                int d = i % 10, sum = 0;
                i /= 10;
                for (int l = 1; l <= x; ++l) {
                    sum = madd(sum, mmul(pow10[l + x], d, cnt_len[l]));
                }
                sum = mmul(2, sum);
                sum = madd(sum, mmul(11, pow10[2 * x], d, suf_cnt_len[x + 1]));
                ans = madd(ans, sum);
                ++x;
            }
        }
        prln(ans);
        close();
    }

    static int mmod = 998244353;

    static int madd(int a, int b) {
        return (a + b) % mmod;
    }

    static int madd(int... a) {
        int ans = a[0];
        for (int i = 1; i < a.length; ++i) {
            ans = madd(ans, a[i]);
        }
        return ans;
    }

    static int msub(int a, int b) {
        return (a - b + mmod) % mmod;
    }

    static int mmul(int a, int b) {
        return (int) ((long) a * b % mmod);
    }

    static int mmul(int... a) {
        int ans = a[0];
        for (int i = 1; i < a.length; ++i) {
            ans = mmul(ans, a[i]);
        }
        return ans;
    }

    static int minv(int x) {
        return mpow(x, mmod - 2);
    }

    static int mpow(int a, int b) {
        if (a == 0) {
            return 0;
        }
        int ans = 1;
        while (b > 0) {
            if ((b & 1) > 0) {
                ans = mmul(ans, a);
            }
            a = mmul(a, a);
            b >>= 1;
        }
        return ans;
    }

    static int len(int x) {
        int ans = 0;
        while (x > 0) {
            ++ans;
            x /= 10;
        }
        return ans;
    }

    static BufferedReader __in = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter __out = new PrintWriter(new OutputStreamWriter(System.out));
    static StringTokenizer input;
    static Random __rand = new Random();

    // references
    // IBIG = 1e9 + 7
    // IMAX ~= 2e9
    // LMAX ~= 9e18

    // constants
    static final int IBIG = 1000000007;
    static final int IMAX = 2147483647;
    static final int IMIN = -2147483648;
    static final long LMAX = 9223372036854775807L;
    static final long LMIN = -9223372036854775808L;
    // math util
    static int minof(int a, int b, int c) {return min(a, min(b, c));}
    static int minof(int... x) {if(x.length == 1) return x[0]; if(x.length == 2) return min(x[0], x[1]); if(x.length == 3) return min(x[0], min(x[1], x[2])); int min = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] < min) min = x[i]; return min;}
    static long minof(long a, long b, long c) {return min(a, min(b, c));}
    static long minof(long... x) {if(x.length == 1) return x[0]; if(x.length == 2) return min(x[0], x[1]); if(x.length == 3) return min(x[0], min(x[1], x[2])); long min = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] < min) min = x[i]; return min;}
    static int maxof(int a, int b, int c) {return max(a, max(b, c));}
    static int maxof(int... x) {if(x.length == 1) return x[0]; if(x.length == 2) return max(x[0], x[1]); if(x.length == 3) return max(x[0], max(x[1], x[2])); int max = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] > max) max = x[i]; return max;}
    static long maxof(long a, long b, long c) {return max(a, max(b, c));}
    static long maxof(long... x) {if(x.length == 1) return x[0]; if(x.length == 2) return max(x[0], x[1]); if(x.length == 3) return max(x[0], max(x[1], x[2])); long max = x[0]; for(int i = 1; i < x.length; ++i) if(x[i] > max) max = x[i]; return max;}
    static int powi(int a, int b) {if(a == 0) return 0; int ans = 1; while(b > 0) {if((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static long powl(long a, int b) {if(a == 0) return 0; long ans = 1; while(b > 0) {if((b & 1) > 0) ans *= a; a *= a; b >>= 1;} return ans;}
    static int fli(double d) {return (int)d;}
    static int cei(double d) {return (int)ceil(d);}
    static long fll(double d) {return (long)d;}
    static long cel(double d) {return (long)ceil(d);}
    static int gcf(int a, int b) {return b == 0 ? a : gcf(b, a % b);}
    static long gcf(long a, long b) {return b == 0 ? a : gcf(b, a % b);}
    static int lcm(int a, int b) {return a * b / gcf(a, b);}
    static long lcm(long a, long b) {return a * b / gcf(a, b);}
    static int randInt(int min, int max) {return __rand.nextInt(max - min + 1) + min;}
    static long mix(long x) {x += 0x9e3779b97f4a7c15L; x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9L; x = (x ^ (x >> 27)) * 0x94d049bb133111ebL; return x ^ (x >> 31);}
    // array util
    static void reverse(int[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {int swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(long[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {long swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(double[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {double swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void reverse(char[] a) {for(int i = 0, n = a.length, half = n / 2; i < half; ++i) {char swap = a[i]; a[i] = a[n - i - 1]; a[n - i - 1] = swap;}}
    static void shuffle(int[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); int swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(long[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); long swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void shuffle(double[] a) {int n = a.length - 1; for(int i = 0; i < n; ++i) {int ind = randInt(i, n); double swap = a[i]; a[i] = a[ind]; a[ind] = swap;}}
    static void rsort(int[] a) {shuffle(a); sort(a);}
    static void rsort(long[] a) {shuffle(a); sort(a);}
    static void rsort(double[] a) {shuffle(a); sort(a);}
    static int[] copy(int[] a) {int[] ans = new int[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static long[] copy(long[] a) {long[] ans = new long[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static double[] copy(double[] a) {double[] ans = new double[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    static char[] copy(char[] a) {char[] ans = new char[a.length]; for(int i = 0; i < a.length; ++i) ans[i] = a[i]; return ans;}
    // graph util
    static List<List<Integer>> g(int n) {List<List<Integer>> g = new ArrayList<>(); for(int i = 0; i < n; ++i) g.add(new ArrayList<>()); return g;}
    static List<Set<Integer>> sg(int n) {List<Set<Integer>> g = new ArrayList<>(); for(int i = 0; i < n; ++i) g.add(new HashSet<>()); return g;}
    static void c(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v); g.get(v).add(u);}
    static void cto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).add(v);}
    static void dc(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v); g.get(v).remove(u);}
    static void dcto(List<? extends Collection<Integer>> g, int u, int v) {g.get(u).remove(v);}
    // input
    static void r() throws IOException {input = new StringTokenizer(rline());}
    static int ri() throws IOException {return Integer.parseInt(rline());}
    static long rl() throws IOException {return Long.parseLong(rline());}
    static int[] ria(int n) throws IOException {int[] a = new int[n]; r(); for(int i = 0; i < n; ++i) a[i] = ni(); return a;}
    static int[] riam1(int n) throws IOException {int[] a = new int[n]; r(); for(int i = 0; i < n; ++i) a[i] = ni() - 1; return a;}
    static long[] rla(int n) throws IOException {long[] a = new long[n]; r(); for(int i = 0; i < n; ++i) a[i] = nl(); return a;}
    static char[] rcha() throws IOException {return rline().toCharArray();}
    static String rline() throws IOException {return __in.readLine();}
    static String n() {return input.nextToken();}
    static int rni() throws IOException {r(); return ni();}
    static int ni() {return Integer.parseInt(n());}
    static long rnl() throws IOException {r(); return nl();}
    static long nl() {return Long.parseLong(n());}
    static double rnd() throws IOException {r(); return nd();}
    static double nd() {return Double.parseDouble(n());}
    static List<List<Integer>> rg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for(int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rg(List<List<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<List<Integer>> rdg(int n, int m) throws IOException {List<List<Integer>> g = g(n); for(int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdg(List<List<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for(int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1); return g;}
    static void rsg(List<Set<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) c(g, rni() - 1, ni() - 1);}
    static List<Set<Integer>> rdsg(int n, int m) throws IOException {List<Set<Integer>> g = sg(n); for(int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1); return g;}
    static void rdsg(List<Set<Integer>> g, int m) throws IOException {for(int i = 0; i < m; ++i) cto(g, rni() - 1, ni() - 1);}
    // output
    static void pr(int i) {__out.print(i);}
    static void prln(int i) {__out.println(i);}
    static void pr(long l) {__out.print(l);}
    static void prln(long l) {__out.println(l);}
    static void pr(double d) {__out.print(d);}
    static void prln(double d) {__out.println(d);}
    static void pr(char c) {__out.print(c);}
    static void prln(char c) {__out.println(c);}
    static void pr(char[] s) {__out.print(new String(s));}
    static void prln(char[] s) {__out.println(new String(s));}
    static void pr(String s) {__out.print(s);}
    static void prln(String s) {__out.println(s);}
    static void pr(Object o) {__out.print(o);}
    static void prln(Object o) {__out.println(o);}
    static void prln() {__out.println();}
    static void pryes() {__out.println("yes");}
    static void pry() {__out.println("Yes");}
    static void prY() {__out.println("YES");}
    static void prno() {__out.println("no");}
    static void prn() {__out.println("No");}
    static void prN() {__out.println("NO");}
    static void pryesno(boolean b) {__out.println(b ? "yes" : "no");};
    static void pryn(boolean b) {__out.println(b ? "Yes" : "No");}
    static void prYN(boolean b) {__out.println(b ? "YES" : "NO");}
    static void prln(int... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static void prln(long... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static void prln(double... a) {for(int i = 0, len = a.length - 1; i < len; __out.print(a[i]), __out.print(' '), ++i); __out.println(a[a.length - 1]);}
    static <T> void prln(Collection<T> c) {int n = c.size() - 1; Iterator<T> iter = c.iterator(); for(int i = 0; i < n; __out.print(iter.next()), __out.print(' '), ++i); if(n >= 0) __out.println(iter.next()); else __out.println();}
    static void h() {__out.println("hlfd"); flush();}
    static void flush() {__out.flush();}
    static void close() {__out.close();}
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[11], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = res * 10 + x / bit[i / 2];
			x %= bit[i / 2];
		} else {
			res = res * 10;
		}
	}
	return res % MOD;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = res * 10 + x / bit[i / 2 + 1];
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10;
		}
	}
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 20; i++) bit[i] = bit[i - 1] * 10 % MOD;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 9; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[12], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = (res * 10 + x / bit[i / 2]) % MOD;
			x %= bit[i / 2];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = (res * 10 + x / bit[i / 2 + 1]) % MOD;
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

ll getbit(int x) {
	x--;
	ll res = 1;
	while (x--) res = res * 10;
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 18; i++) bit[i] = bit[i - 1] * 10;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++)
		for (int j = 10; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = ((a[i] / bit[j + 1]) * bit[2 * j + 1] % MOD + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1]))) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = ((a[i] / bit[j + 1]) * bit[2 * j + 1]  % MOD + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1]))) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[12], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = (res * 10 + x / bit[i / 2]) % MOD;
			x %= bit[i / 2];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = (res * 10 + x / bit[i / 2 + 1]) % MOD;
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

ll getbit(int x) {
	x--;
	ll res = 1;
	while (x--) res = res * 10 % MOD;
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 18; i++) bit[i] = bit[i - 1] * 10;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++)
		for (int j = 10; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = ((a[i] / bit[j + 1]) * getbit(2 * j + 1) % MOD + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1]))) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = ((a[i] / bit[j + 1]) * getbit(2 * j + 1) % MOD + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1]))) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[11], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = (res * 10 + x / bit[i / 2]) % MOD;
			x %= bit[i / 2];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = (res * 10 + x / bit[i / 2 + 1]) % MOD;
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 20; i++) bit[i] = bit[i - 1] * 10 % MOD;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++)
		for (int j = 10; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[11], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = (res * 10 + x / bit[i / 2]) % MOD;
			x %= bit[i / 2];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = (res * 10 + x / bit[i / 2 + 1]) % MOD;
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 20; i++) bit[i] = bit[i - 1] * 10 % MOD;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 9; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[11], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = res * 10 + x / bit[i / 2];
			x %= bit[i / 2];
		} else {
			res = res * 10;
		}
	}
	return res;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = res * 10 + x / bit[i / 2 + 1];
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10;
		}
	}
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 20; i++) bit[i] = bit[i - 1] * 10 % MOD;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 9; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[12], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = (res * 10 + x / bit[i / 2]) % MOD;
			x %= bit[i / 2];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = (res * 10 + x / bit[i / 2 + 1]) % MOD;
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 20; i++) bit[i] = bit[i - 1] * 10 % MOD;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++)
		for (int j = 10; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = ((a[i] / bit[j + 1]) * bit[2 * j + 1] % MOD + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1]))) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = ((a[i] / bit[j + 1]) * bit[2 * j + 1]  % MOD + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1]))) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[12], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = (res * 10 + x / bit[i / 2]) % MOD;
			x %= bit[i / 2];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = (res * 10 + x / bit[i / 2 + 1]) % MOD;
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 20; i++) bit[i] = bit[i - 1] * 10 % MOD;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++)
		for (int j = 10; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = (a[i] / bit[j + 1]) * bit[2 * j + 1] % MOD + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = (a[i] / bit[j + 1]) * bit[2 * j + 1]  % MOD + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[12], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = (res * 10 + x / bit[i / 2]) % MOD;
			x %= bit[i / 2];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = (res * 10 + x / bit[i / 2 + 1]) % MOD;
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 18; i++) bit[i] = bit[i - 1] * 10;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++)
		for (int j = 10; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = ((a[i] / bit[j + 1]) * bit[2 * j + 1] % MOD + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1]))) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = ((a[i] / bit[j + 1]) * bit[2 * j + 1]  % MOD + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1]))) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[11], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = res * 10 + x / bit[i / 2];
			x %= bit[i / 2];
		} else {
			res = res * 10;
		}
	}
	return res % MOD;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = res * 10 + x / bit[i / 2 + 1];
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10;
		}
	}
	return res % MOD;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 20; i++) bit[i] = bit[i - 1] * 10 % MOD;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 9; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
				now = (a[i] / bit[j + 1]) * bit[2 * j + 1] + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;

template<typename T>
inline void read(T &x) {
	x = 0; T f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') { x = x * 10 + ch - 48; ch = getchar() ;}
	x *= f;
}

const int N = 1e5 + 10;
const int MOD = 998244353;
int cnt[11], len[N], n;
ll bit[22];
ll a[N];

inline int getlen(ll x) {
	int cnt = 0;
	while (x) cnt++, x /= 10;
	return cnt;
}

inline ll constr1(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 0) {
			res = (res * 10 + x / bit[i / 2]) % MOD;
			x %= bit[i / 2];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

inline ll constr2(ll x, int len) {
	ll res = 0;
	for (int i = len * 2; i >= 1; i--) {
		if (i % 2 == 1) {
			res = (res * 10 + x / bit[i / 2 + 1]) % MOD;
			x %= bit[i / 2 + 1];
		} else {
			res = res * 10 % MOD;
		}
	}
	return res;
}

int main() {
	read(n);
	bit[1] = 1;
	for (int i = 2; i <= 20; i++) bit[i] = bit[i - 1] * 10 % MOD;
	for (int i = 1; i <= n; i++) {
		read(a[i]);
		len[i] = getlen(a[i]);
		cnt[len[i]]++;
	}
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 9; j >= 1; j--) {
			if (!cnt[j]) continue;
			if (j >= len[i]) {
				ans = (ans + cnt[j] * (constr1(a[i], len[i]) + constr2(a[i], len[i]))) % MOD;
			} else {
				ll now = ((a[i] / bit[j + 1]) * bit[2 * j + 1] % MOD + constr1(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1]) % MOD + constr2(a[i] % bit[j + 1], getlen(a[i] % bit[j + 1])))) % MOD;
				ans = (ans + cnt[j] * now) % MOD;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
int32_t main(){
    int no_of_input;
    string input;
    vector<int> count(12,0);
    vector<int> pow(22,0);
    pow[0] = 1;
    for(int i=1;i<19;i++){
        pow[i] = pow[i-1]*10;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<=10;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
int32_t main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int no_of_input;
    string input;
    vector<int> count(12,0);
    vector<int> pow(22,0);
    pow[0] = 1;
    for(int i=1;i<22;i++){
        pow[i] = pow[i-1]*10;
        pow[i] %= mod;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<10;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                //currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
int32_t main(){
    int no_of_input;
    string input;
    vector<int> count(12,0);
    vector<int> pow(22,0);
    pow[0] = 1;
    for(int i=1;i<22;i++){
        pow[i] = pow[i-1]*10;
        pow[i] %= mod;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<=10;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                //currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int unsigned long long
#define mod 998244353
int32_t main(){
    int no_of_input;
    string input;
    vector<int> count(11,0);
    vector<int> pow(20,0);
    pow[0] = 1;
    for(int i=1;i<19;i++){
        pow[i] = pow[i-1]*10;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<=9;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
int32_t main(){
    int no_of_input;
    string input;
    vector<int> count(12,0);
    vector<int> pow(22,0);
    pow[0] = 1;
    for(int i=1;i<=19;i++){
        pow[i] = pow[i-1]*10;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<=10;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
int32_t main(){
    int no_of_input;
    string input;
    vector<int> count(11,0);
    vector<int> pow(22,0);
    pow[0] = 1;
    for(int i=1;i<pos.size();i++){
        pow[i] = pow[i-1]*10;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<=10;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
int32_t main(){
    int no_of_input;
    string input;
    vector<int> count(12,0);
    vector<int> pow(22,0);
    pow[0] = 1;
    for(int i=1;i<pow.size();i++){
        pow[i] = pow[i-1]*10;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<=10;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
int32_t main(){
    int no_of_input;
    string input;
    vector<int> count(12,0);
    vector<int> pow(22,0);
    pow[0] = 1;
    for(int i=1;i<19;i++){
        pow[i] = pow[i-1]*10;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<=10;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<=(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
int32_t main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int no_of_input;
    string input;
    vector<int> count(12,0);
    vector<int> pow(22,0);
    pow[0] = 1;
    for(int i=1;i<22;i++){
        pow[i] = pow[i-1]*10;
        pow[i] %= mod;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<=10;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                //currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 998244353
int32_t main(){
    int no_of_input;
    string input;
    vector<int> count(12,0);
    vector<int> pow(22,0);
    pow[0] = 1;
    for(int i=1;i<19;i++){
        pow[i] = pow[i-1]*10;
    }
    vector<string> vect1;
    cin >> no_of_input;
    for(int i=0;i<no_of_input;i++){
        cin >> input;
        vect1.push_back(input);
        count[input.length()]++;
    }
    int ans = 0;
    for(int i=0;i<vect1.size();i++){
            //cout << i << endl;
        for(int j=1;j<=10;j++){
                //cout << j << " ";
            int currsum = 0;
            if((int)j<=a(int)(vect1[i].length())){
                for(int k=0;k<vect1[i].length()-j;k++){
                    currsum += (vect1[i].at(k)-'0')*pow[vect1[i].length()+j-k-1];
                    currsum %= mod;
                }
                currsum *= 2;
                currsum %= mod;
            }
            for(int k=0;k<min((int)j,(int)vect1[i].length());k++){
                //if(k*2<vect1[i].length()){
                  currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2]);
                    currsum %= mod;
                //}
                //if(k*2+1<vect1[i].length()){
                    currsum += (vect1[i].at(vect1[i].length()-k-1)-'0')*(pow[k*2+1]);
                    currsum %= mod;
                //}
            }
            currsum *= count[j];
            currsum %= mod;
            ans += currsum;
            ans %= mod;
        }
        //cout << endl;
    }
    cout << ans;

}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define float  long double
#define pb push_back
#define ld long double
#define f(i,a,b) for(int i=a;i<b;i++)
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define debug(x)    cout<<#x<<" is "<<(x)<<endl
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define txt freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
int inf=99999999999;
const int mod=998244353 ;
void inp(int *arr,int n)
{
    for(int i=0;i<n;i++) cin>>arr[i];
}
main()
{
    IOS;
   int n;
   cin>>n;
   int a[n];
   int s[11];
   memset(s,0,sizeof(s));
   vector< vector<int> > v(n);
   f(i,0,n)
   {
       int k;cin>>k;
       a[i]=k;
       while(k>0)
       {
         v[i].pb(k%10);
         k/=10;
       }
     //  reverse(all(v[i]));

       s[v[i].size()]++;
   }
   int ans=0;
   int print =0;
   f(i,0,n)
   {
      // debug(i);
       for(int j=1;j<=10;j++)
       {
       //    debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=10;
               for(int p=0;p<v[i].size();p++)
               {
                   num=num+v[i][p]*mul;
                  // debug(num);
                   if(p<j-1)
                   {
                       mul=mul*100;
                    }
                    else mul*=10;
               }
           }
           num=(num*s[j])%mod;
      //     debug(num);
           print=(print+num)%mod;

       }
   }
   f(i,0,n)
   {
    //   debug(i);
        for(int j=1;j<=10;j++)
       {
      //     debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=1;
               for(int p=0;p<v[i].size();p++)
               {
                   num=num+v[i][p]*mul;
                   if(p<j)
                   {
                       mul=mul*100;
                   }
                    else mul*=10;
               }
           }
          // debug(num);
           num=(num*s[j])%mod;
           print=(print+num)%mod;

       }
   }
cout<<print;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define float  long double
#define pb push_back
#define ld long double
#define f(i,a,b) for(int i=a;i<b;i++)
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define debug(x)    cout<<#x<<" is "<<(x)<<endl
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define txt freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
int inf=99999999999;
const int mod=998244353 ;
void inp(int *arr,int n)
{
    for(int i=0;i<n;i++) cin>>arr[i];
}
main()
{
    IOS;
   int n;
   cin>>n;
   int a[n];
   int s[7];
   memset(s,0,sizeof(s));
   vector< vector<int> > v(n);
   f(i,0,n)
   {
       int k;cin>>k;
       a[i]=k;
       while(k>0)
       {
         v[i].pb(k%10);
         k/=10;
       }
     //  reverse(all(v[i]));

       s[v[i].size()]++;
   }
   int ans=0;
   int print =0;
   f(i,0,n)
   {
      // debug(i);
       for(int j=1;j<=6;j++)
       {
       //    debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=10;
               for(int p=0;p<v[i].size();p++)
               {
                   num=num+v[i][p]*mul;
                  // debug(num);
                   if(p<j-1)
                   {
                       mul=mul*100;
                    }
                    else mul*=10;
               }
           }
           num=(num*s[j])%mod;
      //     debug(num);
           print=(print+num)%mod;

       }
   }
   f(i,0,n)
   {
    //   debug(i);
        for(int j=1;j<=6;j++)
       {
      //     debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=1;
               for(int p=0;p<v[i].size();p++)
               {
                   num=num+v[i][p]*mul;
                   if(p<j)
                   {
                       mul=mul*100;
                   }
                    else mul*=10;
               }
           }
          // debug(num);
           num=(num*s[j])%mod;
           print=(print+num)%mod;

       }
   }
cout<<print;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define float  long double
#define pb push_back
#define ld long double
#define f(i,a,b) for(int i=a;i<b;i++)
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define debug(x)    cout<<#x<<" is "<<(x)<<endl
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define txt freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
int inf=99999999999;
const int mod=998244353 ;
void inp(int *arr,int n)
{
    for(int i=0;i<n;i++) cin>>arr[i];
}
main()
{
    IOS;
   int n;
   cin>>n;
   int a[n];
   int s[11];
   memset(s,0,sizeof(s));
   vector< vector<int> > v(n);
   f(i,0,n)
   {
       int k;cin>>k;
       a[i]=k;
       while(k>0)
       {
         v[i].pb(k%10);
         k/=10;
       }
     //  reverse(all(v[i]));

       s[v[i].size()]++;
   }
   int ans=0;
   int print =0;
   f(i,0,n)
   {
      // debug(i);
       for(int j=1;j<=10;j++)
       {
       //    debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=10;
               for(int p=0;p<v[i].size();p++)
               {
                   num=(num+v[i][p]*mul)%mod;
                  // debug(num);
                   if(p<j-1)
                   {
                       mul=mul*100;
                    }
                    else mul*=10;
               }
           }
           num=(num*s[j])%mod;
      //     debug(num);
           print=(print+num)%mod;

       }
   }
   f(i,0,n)
   {
    //   debug(i);
        for(int j=1;j<=10;j++)
       {
      //     debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=1;
               for(int p=0;p<v[i].size();p++)
               {
                   num=(num+v[i][p]*mul)%mod;
                   if(p<j)
                   {
                       mul=mul*100;
                   }
                    else mul*=10;
               }
           }
          // debug(num);
           num=(num*s[j])%mod;
           print=(print+num)%mod;

       }
   }
cout<<print;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define float  long double
#define pb push_back
#define ld long double
#define f(i,a,b) for(int i=a;i<b;i++)
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define debug(x)    cout<<#x<<" is "<<(x)<<endl
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define txt freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
int inf=99999999999;
const int mod=998244353 ;
void inp(int *arr,int n)
{
    for(int i=0;i<n;i++) cin>>arr[i];
}
main()
{
    IOS;
   int n;
   cin>>n;
   int a[n];
   int s[11];
   memset(s,0,sizeof(s));
   vector< vector<int> > v(n);
   f(i,0,n)
   {
       int k;cin>>k;
       a[i]=k;
       while(k>0)
       {
         v[i].pb(k%10);
         k/=10;
       }
     //  reverse(all(v[i]));

       s[v[i].size()]++;
   }
   int ans=0;
   int print =0;
   f(i,0,n)
   {
      // debug(i);
       for(int j=1;j<=10;j++)
       {
       //    debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=10;
               for(int p=0;p<v[i].size();p++)
               {
                   num=(num+v[i][p]*mul)%mod;
                  // debug(num);
                   if(p<j-1)
                   {
                       mul=mul*100;
                    }
                    else mul*=10;
                    mul%=mod;
               }
           }
           num=(num*s[j])%mod;
      //     debug(num);
           print=(print+num)%mod;

       }
   }
   f(i,0,n)
   {
    //   debug(i);
        for(int j=1;j<=10;j++)
       {
      //     debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=1;
               for(int p=0;p<v[i].size();p++)
               {
                   num=(num+v[i][p]*mul)%mod;
                   if(p<j)
                   {
                       mul=mul*100;
                   }
                    else mul*=10;
                    mul%=mod;
               }
           }
          // debug(num);
           num=(num*s[j])%mod;
           print=(print+num)%mod;

       }
   }
cout<<print;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long
#define float  long double
#define pb push_back
#define ld long double
#define f(i,a,b) for(int i=a;i<b;i++)
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define debug(x)    cout<<#x<<" is "<<(x)<<endl
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define txt freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
int inf=99999999999;
const int mod=998244353 ;
void inp(int *arr,int n)
{
    for(int i=0;i<n;i++) cin>>arr[i];
}
main()
{
    IOS;
   int n;
   cin>>n;
   int a[n];
   int s[11];
   memset(s,0,sizeof(s));
   vector< vector<int> > v(n);
   f(i,0,n)
   {
       int k;cin>>k;
       a[i]=k;
       while(k>0)
       {
         v[i].pb(k%10);
         k/=10;
       }
     //  reverse(all(v[i]));

       s[v[i].size()]++;
   }
   int ans=0;
   int print =0;
   f(i,0,n)
   {
      // debug(i);
       for(int j=1;j<=1;j++)
       {
       //    debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=10;
               for(int p=0;p<v[i].size();p++)
               {
                   num=num+v[i][p]*mul;
                  // debug(num);
                   if(p<j-1)
                   {
                       mul=mul*100;
                    }
                    else mul*=10;
               }
           }
           num=(num*s[j])%mod;
      //     debug(num);
           print=(print+num)%mod;

       }
   }
   f(i,0,n)
   {
    //   debug(i);
        for(int j=1;j<=1;j++)
       {
      //     debug(j);
           int num=0;
           if(s[j]!=0)
           {

               int mul=1;
               for(int p=0;p<v[i].size();p++)
               {
                   num=num+v[i][p]*mul;
                   if(p<j)
                   {
                       mul=mul*100;
                   }
                    else mul*=10;
               }
           }
          // debug(num);
           num=(num*s[j])%mod;
           print=(print+num)%mod;

       }
   }
cout<<print;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

long long fast_mod(long long input, long long ceil) {
    // apply the modulo operator only when needed
    // (i.e. when the input is greater than the ceiling)
    return input >= ceil ? input % ceil : input;
    // NB: the assumption here is that the numbers are positive
}

int main()
{
    long long n;
    scanf("%lld",&n);
    long long a[n];
    long long rez=0;
    unordered_multiset<int> s;
    vector<int> v[n];
    long long maxl=-1;
    for(int i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
        while(a[i])
        {
            int ss=fast_mod(a[i],10);
            v[i].push_back(ss);
            a[i]/=10;
        }
        s.insert(v[i].size());
        long long sss=v[i].size();
        maxl=max(maxl,sss);
    }
    long long step[19];
    step[1]=1;
    for(int i=2;i<19;i++)
        step[i]=step[i-1]*10;

    for(long long i=0;i<n;i++)
    {
        for(int j=1;j<=maxl;j++)
            if(s.count(j)!=0)
            {
                long long l=0,r=0;
                int brci=v[i].size();
                if(j>=brci)
                {
                    int ind=0;
                    int inx=1;
                    while(ind<v[i].size())
                    {
                        //l+=v[i][ind]*step[inx+1];
                        r+=v[i][ind]*step[inx]*11;
                        l=fast_mod(l,998244353);
                        r=fast_mod(r,998244353);
                        inx+=2;
                        ind++;
                    }
                }
                else
                {
                    long long x=a[i];
                    int inx=1;
                    int ind=0;
                    int k=j;
                    while(k)
                    {
                        //l+=v[i][ind]*step[inx+1];
                        r+=v[i][ind]*step[inx]*11;
                        l=fast_mod(l,998244353);
                        r=fast_mod(r,998244353);
                        inx+=2;
                        ind++;
                        k--;
                    }
                    for(int l1=(2*j+1);l1<=(j+brci);l1++)
                    {
                        //l+=v[i][ind]*step[l1];
                        r+=v[i][ind]*step[l1]*2;
                        l=fast_mod(l,998244353);
                        r=fast_mod(r,998244353);
                        ind++;
                    }
                }
                rez+=s.count(j)*(l+r);
                rez=fast_mod(rez,998244353);
            }

    }
    printf("%lld",rez);
    return 0;
}


#include <iostream>
#include <set>
#include <iterator>
using namespace std;

int brc(int x)
{
    int rez=0;
    while(x)
    {
        x/=10;
        rez++;
    }
    return rez;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    long long n;
    cin>>n;
    long long a[n];
    long long rez=0;
    multiset<int> s;
    int maxl=-1;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        s.insert(brc(a[i]));
        maxl=max(maxl,brc(a[i]));
    }
    long long step[50];
    step[1]=1;
    for(int i=2;i<19;i++)
        step[i]=step[i-1]*10;

    for(int i=0;i<n;i++)
    {
        for(int j=1;j<=maxl;j++)
            if(s.count(j)!=0)
            {
                long long l=0,r=0;
                int brci=brc(a[i]);
                if(j>=brci)
                {
                    long long x=a[i];
                    int inx=1;
                    while(x)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        inx+=2;
                        x/=10;
                        l=l%998244353;
                        r=r%998244353;
                    }
                }
                else
                {
                    long long x=a[i];
                    int inx=1;
                    int k=j;
                    while(k)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        inx+=2;
                        x/=10;
                        k--;
                        l=l%998244353;
                        r=r%998244353;
                    }
                    for(int l1=(2*j+1);l1<=(j+brci);l1++)
                    {
                        l+=(x%10)*step[l1];
                        r+=(x%10)*step[l1];
                        x/=10;
                        l=l%998244353;
                        r=r%998244353;
                    }
                }
                long long s1=s.count(j);
                rez+=s1*(l+r);
                rez=rez%998244353;
            }

    }
    cout<<rez<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int brc(long long x)
{
    int rex=0;
    while(x)
    {
        x/=10;
        rex++;
    }
    return rex;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    long long n;
    cin>>n;
    long long a[n];
    long long rez=0;
    multiset<int> s;
    int maxl=-1;
    for(int i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
        s.insert(brc(a[i]));
        maxl=max(maxl,brc(a[i]));
    }
    long long step[19];
    step[1]=1;
    for(int i=2;i<19;i++)
        step[i]=step[i-1]*10;

    for(int i=0;i<n;i++)
    {
        for(int j=1;j<=maxl;j++)
            if(s.count(j)!=0)
            {
                long long l=0,r=0;
                int brci=brc(a[i]);
                if(j>=brci)
                {
                    long long x=a[i];
                    int inx=1;
                    while(x)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        inx+=2;
                        x/=10;
                        l=l%998244353;
                        r=r%998244353;
                    }
                }
                else
                {
                    long long x=a[i];
                    int inx=1;
                    int k=j;
                    while(k)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        inx+=2;
                        x/=10;
                        k--;
                        l=l%998244353;
                        r=r%998244353;
                    }
                    for(int l1=(2*j+1);l1<=(j+brci);l1++)
                    {
                        l+=(x%10)*step[l1];
                        r+=(x%10)*step[l1];
                        x/=10;
                        l=l%998244353;
                        r=r%998244353;
                    }
                }
                rez+=s.count(j)*(l+r);
                rez=rez%998244353;
            }

    }
    cout<<rez<<endl;
    return 0;
}


#include <stdio.h>
#include <set>
#include <iterator>
using namespace std;

int brc(long long x)
{
    int rez=0;
    while(x)
    {
        x/=10;
        rez++;
    }
    return rez;
}

long long fast_mod(long long input, long long ceil) {
    // apply the modulo operator only when needed
    // (i.e. when the input is greater than the ceiling)
    return input >= ceil ? input % ceil : input;
    // NB: the assumption here is that the numbers are positive
}

int main()
{
    long long n;
    scanf("%lld",&n);
    long long a[n];
    long long rez=0;
    multiset<int> s;
    int maxl=-1;
    for(int i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
        s.insert(brc(a[i]));
        maxl=max(maxl,brc(a[i]));
    }
    long long step[19];
    step[1]=1;
    for(int i=2;i<19;i++)
        step[i]=step[i-1]*10;

    for(int i=0;i<n;i++)
    {
        for(int j=1;j<=maxl;j++)
            if(s.count(j)!=0)
            {
                long long l=0,r=0;
                int brci=brc(a[i]);
                if(j>=brci)
                {
                    long long x=a[i];
                    int inx=1;
                    while(x)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        fast_mod(l,998244353);
                        fast_mod(r,998244353);
                        inx+=2;
                        x/=10;
                    }
                }
                else
                {
                    long long x=a[i];
                    int inx=1;
                    int k=j;
                    while(k)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        fast_mod(l,998244353);
                        fast_mod(r,998244353);
                        inx+=2;
                        x/=10;
                        k--;
                    }
                    for(int l1=(2*j+1);l1<=(j+brci);l1++)
                    {
                        l+=(x%10)*step[l1];
                        r+=(x%10)*step[l1];
                        fast_mod(l,998244353);
                        fast_mod(r,998244353);
                        x/=10;
                    }
                }
                rez+=s.count(j)*(l+r);
                fast_mod(rez,998244353);
            }

    }
    printf("%lld",rez);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int brc(long long x)
{
    int rez=0;
    while(x)
    {
        x/=10;
        rez++;
    }
    return rez;
}

int main()
{
    long long n;
    scanf("%lld",&n);
    long long a[n];
    long long rez=0;
    multiset<int> s;
    int maxl=-1;
    for(int i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
        s.insert(brc(a[i]));
        maxl=max(maxl,brc(a[i]));
    }
    long long step[19];
    step[1]=1;
    for(int i=2;i<19;i++)
        step[i]=step[i-1]*10;

    for(int i=0;i<n;i++)
    {
        for(int j=1;j<=maxl;j++)
            if(s.count(j)!=0)
            {
                long long l=0,r=0;
                int brci=brc(a[i]);
                if(j>=brci)
                {
                    long long x=a[i];
                    int inx=1;
                    while(x)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        inx+=2;
                        x/=10;
                        if(l>=998244353)
                            l-=998244353;
                        if(r>=998244353)
                            r-=998244353;
                    }
                }
                else
                {
                    long long x=a[i];
                    int inx=1;
                    int k=j;
                    while(k)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        inx+=2;
                        x/=10;
                        k--;
                        if(l>=998244353)
                            l-=998244353;
                        if(r>=998244353)
                            r-=998244353;
                    }
                    for(int l1=(2*j+1);l1<=(j+brci);l1++)
                    {
                        l+=(x%10)*step[l1];
                        r+=(x%10)*step[l1];
                        x/=10;
                        if(l>=998244353)
                            l-=998244353;
                        if(r>=998244353)
                            r-=998244353;
                    }
                }
                rez+=s.count(j)*(l+r);
                if(rez>=998244353)
                    rez-=998244353;
            }

    }
    cout<<rez<<endl;
    return 0;
}


#include <stdio.h>
#include <set>
#include <iterator>
using namespace std;

int brc(long long x)
{
    int rez=0;
    while(x)
    {
        x/=10;
        rez++;
    }
    return rez;
}

int main()
{
    long long n;
    scanf("%lld",&n);
    long long a[n];
    long long rez=0;
    multiset<int> s;
    int maxl=-1;
    for(int i=0;i<n;i++)
    {
        scanf("%lld",&a[i]);
        s.insert(brc(a[i]));
        maxl=max(maxl,brc(a[i]));
    }
    long long step[19];
    step[1]=1;
    for(int i=2;i<19;i++)
        step[i]=step[i-1]*10;

    for(int i=0;i<n;i++)
    {
        for(int j=1;j<=maxl;j++)
            if(s.count(j)!=0)
            {
                long long l=0,r=0;
                int brci=brc(a[i]);
                if(j>=brci)
                {
                    long long x=a[i];
                    int inx=1;
                    while(x)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        l=l%998244353;
                        r=r%998244353;
                        inx+=2;
                        x/=10;
                    }
                }
                else
                {
                    long long x=a[i];
                    int inx=1;
                    int k=j;
                    while(k)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        l=l%998244353;
                        r=r%998244353;
                        inx+=2;
                        x/=10;
                        k--;
                    }
                    for(int l1=(2*j+1);l1<=(j+brci);l1++)
                    {
                        l+=(x%10)*step[l1];
                        r+=(x%10)*step[l1];
                        l=l%998244353;
                        r=r%998244353;
                        x/=10;
                    }
                }
                rez+=s.count(j)*(l+r);
                rez=rez%998244353;
            }

    }
    printf("%lld",rez);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int brc(int x)
{
    int rez=0;
    while(x)
    {
        x/=10;
        rez++;
    }
    return rez;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);

    long long n;
    cin>>n;
    long long a[n];
    long long rez=0;
    multiset<int> s;
    int maxl=-1;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        s.insert(brc(a[i]));
        maxl=max(maxl,brc(a[i]));
    }
    long long step[50];
    step[1]=1;
    for(int i=2;i<19;i++)
        step[i]=step[i-1]*10;

    for(int i=0;i<n;i++)
    {
        for(int j=1;j<=maxl;j++)
            if(s.count(j)!=0)
            {
                long long l=0,r=0;
                if(j>=brc(a[i]))
                {
                    long long x=a[i];
                    int inx=1;
                    while(x)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        inx+=2;
                        x/=10;
                    }
                }
                else
                {
                    long long x=a[i];
                    int inx=1;
                    int k=j;
                    while(k)
                    {
                        l+=(x%10)*step[inx+1];
                        r+=(x%10)*step[inx];
                        inx+=2;
                        x/=10;
                        k--;
                    }
                    for(int l1=(2*j+1);l1<=(j+brc(a[i]));l1++)
                    {
                        l+=(x%10)*step[l1];
                        r+=(x%10)*step[l1];
                        x/=10;
                    }
                }
                long long s1=s.count(j);
                rez+=s1*(l+r);
                rez=rez%998244353;
            }

    }

    cout<<rez<<endl;
    return 0;
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <ctime>
#include <cstring>
#include <cassert>
#include <bitset>
#include <sstream>

using namespace std;

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define last(a) int(a.size() - 1)
#define all(a) a.begin(), a.end()
#define seta(a,x) memset (a, x, sizeof (a))
#define I (int)

typedef long long int64;
typedef pair <int, int> pii;
typedef long double ldb;

const long double eps = 1e-9;
const int inf = (1 << 30) - 1;
const int64 inf64 = ((int64)1 << 62) - 1;
const long double pi = 3.1415926535897932384626433832795;
const string task = "";

template <class T> T sqr (T x) {return x * x;}

const int nmax = 300300;

int n;
double l , v1, v2;
double res[nmax], a[nmax];

int main ()
{
    cin >> n >> l >> v1 >> v2;
    forn(i, n) {
         int x;
        scanf("%d", &x);
        a[i] = x;
        a[n + i] = x + 2. * l;
    }
    a[2 * n] = 1e10;

    double len = 1.0 * v2 * l / (v1 + v2);
    vector<double> st;
    forn(i, n * 2){
        st.pb(a[i]);
        st.pb(a[i] - len);
    }
    st.pb(0);
    st.pb(len);
    st.pb(2 * l - len);
    forn(i, st.size())
        st[i] = fmod(st[i] + 4 * l, 2 * l);
    sort(all(st));
    st.pb(2 * l);
    int p1, p2;
    p1 = p2 = 0;
    forn(i, st.size()-1){
        while (a[p1] < st[i] + 1e-9)
            p1 ++;
        p2 = max(p2, p1-1);
        while (a[p2 + 1] - st[i] < len + 1e-9)
            p2 ++;
        res[p2-p1 + 1] += st[i+1] - st[i];
    }
    forn(i, n + 1)
        printf("%0.15lf\n", (double)res[i] / (2. * l));

    return 0;
}