Polycarpus participates in a competition for hacking into a new secure messenger. He's almost won.

Having carefully studied the interaction protocol, Polycarpus came to the conclusion that the secret key can be obtained if he properly cuts the public key of the application into two parts. The public key is a long integer which may consist of even a million digits!

Polycarpus needs to find such a way to cut the public key into two nonempty parts, that the first (left) part is divisible by a as a separate number, and the second (right) part is divisible by b as a separate number. Both parts should be positive integers that have no leading zeros. Polycarpus knows values a and b.

Help Polycarpus and find any suitable method to cut the public key.

Input

The first line of the input contains the public key of the messenger — an integer without leading zeroes, its length is in range from 1 to 106 digits. The second line contains a pair of space-separated positive integers a, b (1 ≤ a, b ≤ 108).

Output

In the first line print "YES" (without the quotes), if the method satisfying conditions above exists. In this case, next print two lines — the left and right parts after the cut. These two parts, being concatenated, must be exactly identical to the public key. The left part must be divisible by a, and the right part must be divisible by b. The two parts must be positive integers having no leading zeros. If there are several answers, print any of them.

If there is no answer, print in a single line "NO" (without the quotes).

Examples

Input

116401024
97 1024


Output

YES
11640
1024


Input

284254589153928171911281811000
1009 1000


Output

YES
2842545891539
28171911281811000


Input

120
12 1


Output

NO
import java.io.BufferedInputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;


@SuppressWarnings("unused")
public final class Main {

	public static void main(String[] args) throws IOException {

//		long startTime = new Date().getTime();
		
		InputReader in = new InputReader(System.in);
//		InputReader in = new InputReader(new FileInputStream(new File("inputs/simple.in")));
		
		PrintWriter writer = new PrintWriter(System.out);
//		PrintWriter writer = new PrintWriter("outputs/simple.out");

		solveTheProblem(in, writer);
		
//		long endTime = new Date().getTime();
//		System.err.println("Time: " + (endTime - startTime) + " millis");
		
	}

	public static void solveTheProblem(InputReader in, PrintWriter writer) throws IOException {

		
		String pubkey = in.nstr();
		
		int len = pubkey.length();
		
		int[] pubdigits = new int[len];
		for (int i = 0; i < len; i++)
			pubdigits[i] = Integer.valueOf(pubkey.substring(i, i+1));
		
		int A = in.ni();
		int B = in.ni();
		
		boolean[] fromLeft = new boolean[len];
		boolean[] fromRight = new boolean[len];
		
		// left part
		int mod = 0;
		int factor = 10 % A;
		for (int i = 0; i < len; i++) {
			mod = (mod * factor) % A;
			mod = (mod + pubdigits[i]) % A;
			if (mod == 0) {
				fromLeft[i] = true;
			}
		}
		
		// right part
		mod = 0;
		factor = 1;
		for (int i = 0; i < len; i++) {
			
			factor = (factor * 10) % B;
			int j = (factor * pubdigits[len-1-i]) % B;
			
			mod = (mod + j) % B;
			if (mod == 0 && pubdigits[len-1-i] != 0) {
				fromRight[len-1-i] = true;
			}
		}
		
		int ans = -1;
		for (int i = 0; i < len-1; i++)
			if (fromLeft[i] && fromRight[i+1])
				ans = i;
		
		if (ans == -1) {
			writer.println("NO");
		} else {
			writer.println("YES");
			for (int i = 0; i <= ans; i++)
				writer.print(pubdigits[i]);
			writer.println();
			for (int i = ans + 1; i < len; i++)
				writer.print(pubdigits[i]);
			writer.println();
		}
		
		// don't forget partial flushes!
		writer.flush();
		
	}
	
	/** Utils **/

	private static final long MOD = (long) Math.pow(10, 9)+7;

	private static long mod(long n) {
		return n % MOD;
	}
	
	private static int pow(int n, int p) {
		return (int) Math.pow(n, p);
	}

	private static long pow(long n, long p) {
		return (long) Math.pow(n, p);
	}
	
	private static class BIT {
		
		private int n;
		private long[] freqs;
		private long[] cumulativeFreqs;
		
		public BIT(int n) {
			this.n = n;
			this.freqs = new long[n];
			this.cumulativeFreqs = new long[n];
		}
		
		public void add(int idx, long v) {
			
			this.freqs[idx] = mod(this.freqs[idx] + v);
			
			int i = idx;
			while (i < n) {
				
				this.cumulativeFreqs[i] = mod(this.cumulativeFreqs[i] + v);
				
				int lastDigit = i & -i;
				i += lastDigit;
				
			}
			
		}
		
		public long getCumulativeSum(int idx) {
			
			long ans = 0;
			
			int i = idx;
			while (i > 0) {
				
				ans = mod(ans + this.cumulativeFreqs[i]);
				
				int lastDigit = i & -i;
				i -= lastDigit;
				
			}
			
			return ans;
		}
		
	}
	
	private static String joinWithSpaces(Object... a) {
		StringBuilder str = new StringBuilder();
		if (a.length > 0) {
			str.append(a[0]);
			for (int i = 1; i < a.length; i++) {
				str.append(' ');
				str.append(a[i]);
			}
		}
		return str.toString();
	}

	private static String joinWithSpaces(long[] a) {
		StringBuilder str = new StringBuilder();
		if (a.length > 0) {
			str.append(a[0]);
			for (int i = 1; i < a.length; i++) {
				str.append(' ');
				str.append(a[i]);
			}
		}
		return str.toString();
	}
	
    private static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }
    
    private static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }
    
    private static boolean[] createPrimeSieve(int n) {
        boolean[] sieve = new boolean[n+1];
        Arrays.fill(sieve, true);
        for (int i = 2; i <= n; i++) {
            if (sieve[i]) {
                for (int j = i+i; j <= n; j += i)
                    sieve[j] = false;
            }
        }
        return sieve;
    }
    
    private static int countPrimes(boolean[] sieve) {
        int ans = 0;
        for (int i = 2; i < sieve.length; i++)
            if (sieve[i]) ans++;
        return ans;
    }

	public static class InputReader implements Closeable {
		
//		private InputStream in;
		private Scanner in;
		private StringBuilder sb = new StringBuilder();
		
//		public InputReader(File file) throws FileNotFoundException {
//			this(new FileInputStream(file));
//		}
//		
//		public InputReader(InputStream wrapped) {
//			this.in = new BufferedInputStream(wrapped);
//		}

		public InputReader(InputStream wrapped) {
			this.in = new Scanner(wrapped);
		}
		
		@Override
		public void close() throws IOException {
			this.in.close();
		}

		public int ni() throws IOException {
//			sb.setLength(0);
//		mainloop:
//			for (;;) {
//				int b = this.in.read();
//				while (b == -1 || !((b >= '0' && b <= '9') || b == '-')) {
//					if (sb.length() > 0) break mainloop;
//					else b = this.in.read();
//				}
//				sb.append((char) b);
//			}
//			return new Integer(sb.toString());
			return in.nextInt();
		}

		public String nstr() throws IOException {
//			sb.setLength(0);
//			int ans = 0;
//		mainloop:
//			for (;;) {
//				int b = this.in.read();
//				while (b == -1 || !((b >= 'a' && b <= 'z') || (b >= 'A' && b < 'Z'))) {
//					if (sb.length() > 0) break mainloop;
//					else b = this.in.read();
//				}
//				sb.append((char) b);
//			}
//			return sb.toString();
			return in.next();
		}
		
		public long nl() throws IOException {
			return in.nextLong();
		}
		
		public char[] nca(int n) throws IOException {
			char[] ca = new char[n];
			String str = nstr();
			for (int i = 0; i < n; i++)
				ca[i] = str.charAt(i);
			return ca;
		}
		
	}
	
}
