text: #include <iostream>
  #include <algorithm>
  using namespace std;
  
  class Rational
  {
  public:
      Rational()
      {
          // Ð ÐµÐ°Ð»Ð¸Ð·ÑƒÐ¹Ñ‚Ðµ ÐºÐ¾Ð½ÑÑ‚Ñ€ÑƒÐºÑ‚Ð¾Ñ€ Ð¿Ð¾ ÑƒÐ¼Ð¾Ð»Ñ‡Ð°Ð½Ð¸ÑŽ
          numerator = 0;
          denominator = 1;
      }
  
      Rational(int numerator, int denominator)
      {
          // Ð ÐµÐ°Ð»Ð¸Ð·ÑƒÐ¹Ñ‚Ðµ ÐºÐ¾Ð½ÑÑ‚Ñ€ÑƒÐºÑ‚Ð¾Ñ€
          this->numerator = numerator;
          this->denominator = denominator;
          int gcd = __gcd(numerator, denominator);
          this->numerator /= gcd;
          this->denominator /= gcd;
          if (this->numerator < 0 && this->denominator < 0)
          {
              this->numerator *= -1;
              this->denominator *= -1;
          }
          else if (this->denominator < 0)
          {
              this->numerator *= -1;
              this->denominator *= -1;
          }
          else if (this->numerator == 0)
          {
              this->denominator = 1;
          }
      }
  
      int Numerator() const
      {
          // Ð ÐµÐ°Ð»Ð¸Ð·ÑƒÐ¹Ñ‚Ðµ ÑÑ‚Ð¾Ñ‚ Ð¼ÐµÑ‚Ð¾Ð´
          return numerator;
      }
  
      int Denominator() const
      {
          // Ð ÐµÐ°Ð»Ð¸Ð·ÑƒÐ¹Ñ‚Ðµ ÑÑ‚Ð¾Ñ‚ Ð¼ÐµÑ‚Ð¾Ð´
          return denominator;
      }
  
  private:
      // Ð”Ð¾Ð±Ð°Ð²ÑŒÑ‚Ðµ Ð¿Ð¾Ð»Ñ
      int numerator;
      int denominator;
  };
  
  int main()
  {
      {
          const Rational r(3, 10);
          if (r.Numerator() != 3 || r.Denominator() != 10)
          {
  
              cout << "Rational(3, 10) != 3/10" << endl;
              return 1;
          }
      }
  
      {
          const Rational r(8, 12);
          if (r.Numerator() != 2 || r.Denominator() != 3)
          {
              cout << "Rational(8, 12) != 2/3" << endl;
              return 2;
          }
      }
  
      {
          const Rational r(-4, 6);
          if (r.Numerator() != -2 || r.Denominator() != 3)
          {
              cout << "Rational(-4, 6) != -2/3" << endl;
              return 3;
          }
      }
  
      {
          const Rational r(4, -6);
          if (r.Numerator() != -2 || r.Denominator() != 3)
          {
              cout << "Rational(4, -6) != -2/3" << endl;
              return 3;
          }
      }
  
      {
          const Rational r(0, 15);
          if (r.Numerator() != 0 || r.Denominator() != 1)
          {
              cout << "Rational(0, 15) != 0/1" << endl;
              return 4;
          }
      }
  
      {
          const Rational defaultConstructed;
          if (defaultConstructed.Numerator() != 0 || defaultConstructed.Denominator() != 1)
          {
              cout << "Rational() != 0/1" << endl;
              return 5;
          }
      }
  
      cout << "OK" << endl;
      return 0;
  }