import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{
  public static void main(String[] args) throws NumberFormatException, IOException
  {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    while (input.ready())
    {
      String[] dataStr = input.readLine().split(" ");
      int[] dataInt = new int[dataStr.length];
      for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      }
      System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
    }
  }

  public static int getGCD(int num1, int num2)
  {
    if (num1 == num2)
      return num1;

    int a  = Math.max(num1, num2);
    int b = Math.min(num1, num2);
    int c = 1;

    while (true)
    {
      c = a % b;
      if(c == 0) {
        break;
      }
      a = b;
      b = c;
    }
    return b;
  }

  public static int getLCM(int a, int b)
  {
    int productA = a;
    int productB = b;
    while (productA <= 2000000000)
    {
      if (productA == productB)
      {
        return productA;
      }
      if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      }
    }
    return 0;
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main
{
  public static void main(String[] args) throws NumberFormatException, IOException
  {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    while (input.ready())
    {
      String[] dataStr = input.readLine().split(" ");
      int[] dataInt = new int[dataStr.length];
      for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      }
      System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
    }
  }

  public static int getGCD(int num1, int num2)
  {
    if (num1 == num2)
      return num1;

    int a  = Math.max(num1, num2);
    int b = Math.min(num1, num2);
    int c = 1;

    while (true)
    {
      c = a % b;
      if(c == 0) {
        break;
      }
      a = b;
      b = c;
    }
    return b;
  }

  public static int getLCM(int a, int b)
  {
    int productA = a;
    int productB = b;
    while (productA <= 2000000000)
    {
      if (productA == productB)
      {
        return productA;
      }
      if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      }
    }
    return 0;
  }
} Main public static void main(String[] args) throws NumberFormatException, IOException
  {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    while (input.ready())
    {
      String[] dataStr = input.readLine().split(" ");
      int[] dataInt = new int[dataStr.length];
      for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      }
      System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
    }
  } main {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    while (input.ready())
    {
      String[] dataStr = input.readLine().split(" ");
      int[] dataInt = new int[dataStr.length];
      for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      }
      System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
    }
  } BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) while (input.ready())
    {
      String[] dataStr = input.readLine().split(" ");
      int[] dataInt = new int[dataStr.length];
      for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      }
      System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
    } input.ready() input.ready input {
      String[] dataStr = input.readLine().split(" ");
      int[] dataInt = new int[dataStr.length];
      for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      }
      System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
    } String[] dataStr = input.readLine().split(" "); dataStr input.readLine().split(" ") input.readLine().split input.readLine() input.readLine input " " int[] dataInt = new int[dataStr.length]; dataInt new int[dataStr.length] dataStr.length dataStr dataStr.length for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      } int i = 0; int i = 0; i 0 i < dataStr.length i dataStr.length dataStr dataStr.length i++ i++ i {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      } {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      } dataInt[i] = Integer.valueOf(dataStr[i]) dataInt[i] dataInt i Integer.valueOf(dataStr[i]) Integer.valueOf Integer dataStr[i] dataStr i System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1])) System.out.println System.out System System.out getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]) getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]) getGCD(dataInt[0], dataInt[1]) getGCD dataInt[0] dataInt 0 dataInt[1] dataInt 1 " " getLCM(dataInt[0], dataInt[1]) getLCM dataInt[0] dataInt 0 dataInt[1] dataInt 1 String[] args args public static int getGCD(int num1, int num2)
  {
    if (num1 == num2)
      return num1;

    int a  = Math.max(num1, num2);
    int b = Math.min(num1, num2);
    int c = 1;

    while (true)
    {
      c = a % b;
      if(c == 0) {
        break;
      }
      a = b;
      b = c;
    }
    return b;
  } getGCD {
    if (num1 == num2)
      return num1;

    int a  = Math.max(num1, num2);
    int b = Math.min(num1, num2);
    int c = 1;

    while (true)
    {
      c = a % b;
      if(c == 0) {
        break;
      }
      a = b;
      b = c;
    }
    return b;
  } if (num1 == num2)
      return num1; num1 == num2 num1 num2 return num1; num1 int a  = Math.max(num1, num2); a Math.max(num1, num2) Math.max Math num1 num2 int b = Math.min(num1, num2); b Math.min(num1, num2) Math.min Math num1 num2 int c = 1; c 1 while (true)
    {
      c = a % b;
      if(c == 0) {
        break;
      }
      a = b;
      b = c;
    } true {
      c = a % b;
      if(c == 0) {
        break;
      }
      a = b;
      b = c;
    } c = a % b c a % b a b if(c == 0) {
        break;
      } c == 0 c 0 {
        break;
      } break; a = b a b b = c b c return b; b int num1 num1 int num2 num2 public static int getLCM(int a, int b)
  {
    int productA = a;
    int productB = b;
    while (productA <= 2000000000)
    {
      if (productA == productB)
      {
        return productA;
      }
      if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      }
    }
    return 0;
  } getLCM {
    int productA = a;
    int productB = b;
    while (productA <= 2000000000)
    {
      if (productA == productB)
      {
        return productA;
      }
      if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      }
    }
    return 0;
  } int productA = a; productA a int productB = b; productB b while (productA <= 2000000000)
    {
      if (productA == productB)
      {
        return productA;
      }
      if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      }
    } productA <= 2000000000 productA 2000000000 {
      if (productA == productB)
      {
        return productA;
      }
      if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      }
    } if (productA == productB)
      {
        return productA;
      } productA == productB productA productB {
        return productA;
      } return productA; productA if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      } productA < productB productA productB {
        productA += a;
      } productA += a productA a {
        productB += b;
      } productB += b productB b return 0; 0 int a a int b b public class Main
{
  public static void main(String[] args) throws NumberFormatException, IOException
  {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    while (input.ready())
    {
      String[] dataStr = input.readLine().split(" ");
      int[] dataInt = new int[dataStr.length];
      for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      }
      System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
    }
  }

  public static int getGCD(int num1, int num2)
  {
    if (num1 == num2)
      return num1;

    int a  = Math.max(num1, num2);
    int b = Math.min(num1, num2);
    int c = 1;

    while (true)
    {
      c = a % b;
      if(c == 0) {
        break;
      }
      a = b;
      b = c;
    }
    return b;
  }

  public static int getLCM(int a, int b)
  {
    int productA = a;
    int productB = b;
    while (productA <= 2000000000)
    {
      if (productA == productB)
      {
        return productA;
      }
      if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      }
    }
    return 0;
  }
} public class Main
{
  public static void main(String[] args) throws NumberFormatException, IOException
  {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    while (input.ready())
    {
      String[] dataStr = input.readLine().split(" ");
      int[] dataInt = new int[dataStr.length];
      for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      }
      System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
    }
  }

  public static int getGCD(int num1, int num2)
  {
    if (num1 == num2)
      return num1;

    int a  = Math.max(num1, num2);
    int b = Math.min(num1, num2);
    int c = 1;

    while (true)
    {
      c = a % b;
      if(c == 0) {
        break;
      }
      a = b;
      b = c;
    }
    return b;
  }

  public static int getLCM(int a, int b)
  {
    int productA = a;
    int productB = b;
    while (productA <= 2000000000)
    {
      if (productA == productB)
      {
        return productA;
      }
      if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      }
    }
    return 0;
  }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main
{
  public static void main(String[] args) throws NumberFormatException, IOException
  {
    BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

    while (input.ready())
    {
      String[] dataStr = input.readLine().split(" ");
      int[] dataInt = new int[dataStr.length];
      for (int i = 0; i < dataStr.length; i++)
      {
        dataInt[i] = Integer.valueOf(dataStr[i]);
      }
      System.out.println(getGCD(dataInt[0], dataInt[1]) + " " + getLCM(dataInt[0], dataInt[1]));
    }
  }

  public static int getGCD(int num1, int num2)
  {
    if (num1 == num2)
      return num1;

    int a  = Math.max(num1, num2);
    int b = Math.min(num1, num2);
    int c = 1;

    while (true)
    {
      c = a % b;
      if(c == 0) {
        break;
      }
      a = b;
      b = c;
    }
    return b;
  }

  public static int getLCM(int a, int b)
  {
    int productA = a;
    int productB = b;
    while (productA <= 2000000000)
    {
      if (productA == productB)
      {
        return productA;
      }
      if (productA < productB)
      {
        productA += a;
      }
      else
      {
        productB += b;
      }
    }
    return 0;
  }
}