I must transform this part of C++ program into HASKELL. Must use IO and STATE monade. Anyone who can help me? Thanx alot!

Code:
class A {

public: 
   int x_A;

   void setX_A (int newx) {
        x_A = newx;
   }
  
   void printX_A() {
      printf("x_A is %d", x_A);
   }
};

class B : public A {
public:
   int x_B;
 
  void setX_B (int newx) {
      x_B = newx;
  }
 
  void printX_B() {
     printf("x_B is %d", x_B);
  }

};

main() {
  A objA;
  B objB;
  objA.setX_A(2);
  objA.printX_A();
  objB.printX_A();
  objB.setX_B(5);
  objB.printX_B();
}