// Arup Guha
// 3/6/2021
// Solution to 2020 SER Problem: Rainbow Numbers

import java.util.*;

public class rainbow {

	final public static long MOD = 998244353;

	public static void main(String[] args) {
	
		// Get input.
		Scanner stdin = new Scanner(System.in);
		char[] low = stdin.next().toCharArray();
		char[] high = stdin.next().toCharArray();
		
		// So we start with equal lengthed numbers.
		if (low.length < high.length) low = fix(low, high.length);
		
		// Find # of Rainbow #s less than or equal to each bound.
		long f1 = solve(low);
		long f2 = solve(high);
		
		// Then subtract.
		long tmp = (f2-f1+MOD)%MOD;
		
		// Special case because of how I do it.
		if (isRainbow(low)) tmp = (tmp+1)%MOD;
		System.out.println(tmp);
	}
	
	// Returns true iff this number is a rainbow number.
	public static boolean isRainbow(char[] arr) {
		for (int i=0; i<arr.length-1; i++)
			if (arr[i] == arr[i+1])
				return false;
		return true;
	}
	
	// Pads a with 0s so it's length n.
	public static char[] fix(char[] a, int n) {
		int extra = n - a.length;
		char[] res = new char[n];
		for (int i=0; i<extra; i++) res[i] = '0';
		for (int i=extra; i<n; i++) res[i] = a[i-extra];
		return res;
	}
	
	public static long solve(char[] arr) {
	
		int n = arr.length;
		long[][][] dp = new long[2][10][n];
		
		// First digit strictly less than arr...
		for (int i=0; i<arr[0]-'0'; i++)
			dp[0][i][0] = 1;
			
		// This one is equal.
		dp[1][arr[0]-'0'][0] = 1;
		
		// i is the index we are considering.
		for (int i=1; i<n; i++) {

			// Previous digit we build off of.
			for (int pd=0; pd<10; pd++) {
			
				// Next digit...building off strictly less than only.
				for (int nd=0; nd<10; nd++) {
					if (nd == pd) continue;
					dp[0][nd][i] = (dp[0][nd][i] + dp[0][pd][i-1])%MOD;
				}
				
				// Next digit is less, making this number less than the bound.
				for (int nd=0; nd<arr[i]-'0'; nd++) {
					if (nd == pd) continue;
					dp[0][nd][i] = (dp[0][nd][i] + dp[1][pd][i-1])%MOD;
				}
			}
			
			// There is really at most 1 that would be equal.
			if (dp[1][arr[i-1]-'0'][i-1] == 1 && arr[i] != arr[i-1])
				dp[1][arr[i]-'0'][i] = 1;	
		}
		
		// This is for the equal number.
		long res = dp[1][arr[n-1]-'0'][n-1];
		
		// This is the rest.
		for (int i=0; i<10; i++) res = (res + dp[0][i][n-1])%MOD;
	
		return res;
	}
}