public void solve() throws IOException {
    String input = nextLine();
    BigInteger a = BigInteger.valueOf(nextInt());
    BigInteger b = BigInteger.valueOf(nextInt());
    
    if (input.charAt(0) == '0') {
      System.out.println("NO");
      return;
    }
    
    for (int x = 1; x < input.length(); x++) {
      String first = input.substring(0, x);
      String second = input.substring(x, input.length());
      if (second.charAt(0) != '0') {
        BigInteger n = new BigInteger(first);
        BigInteger m = new BigInteger(second);
        if (n.mod(a).equals(BigInteger.ZERO) && m.mod(b).equals(BigInteger.ZERO)) {
          System.out.println("YES");
          System.out.println(first);
          System.out.println(second);
          return;
        }
      }
    }
    System.out.println("NO");
  }