Language: C++

using AtCoderBeginnerContest154.Questions;
using AtCoderBeginnerContest154.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace AtCoderBeginnerContest154.Questions
{
    public class QuestionA : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var st = inputStream.ReadStringArray();
            var ab = inputStream.ReadIntArray();
            var u = inputStream.ReadLine();

            if (st[0] == u)
            {
                yield return $"{ab[0] - 1} {ab[1]}";
            }
            else
            {
                yield return $"{ab[0]} {ab[1] - 1}";
            }
        }
    }
}


namespace AtCoderBeginnerContest154
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionA();    // 問題に合わせて書き換え
            var answers = question.Solve(Console.In);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
        }
    }
}

#region Base Classes

namespace AtCoderBeginnerContest154.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }

}

#endregion

#region Extensions

namespace AtCoderBeginnerContest154.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);
    }
}

#endregion

Compiler output:
a.cc:48:2: error: invalid preprocessing directive #region
   48 | #region Base Classes
      |  ^~~~~~
a.cc:74:2: error: invalid preprocessing directive #endregion
   74 | #endregion
      |  ^~~~~~~~~
a.cc:76:2: error: invalid preprocessing directive #region
   76 | #region Extensions
      |  ^~~~~~
a.cc:94:2: error: invalid preprocessing directive #endregion
   94 | #endregion
      |  ^~~~~~~~~
a.cc:1:7: error: expected nested-name-specifier before 'AtCoderBeginnerContest154'
    1 | using AtCoderBeginnerContest154.Questions;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'AtCoderBeginnerContest154'
    2 | using AtCoderBeginnerContest154.Extensions;
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.IO;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Linq;
      |       ^~~~~~
a.cc:7:7: error: expected nested-name-specifier before 'System'
    7 | using System.Text;
      |       ^~~~~~
a.cc:9:36: error: expected '{' before '.' token
    9 | namespace AtCoderBeginnerContest154.Questions
      |                                    ^
a.cc:9:36: error: expected unqualified-id before '.' token
a.cc:36:26: error: 'string' has not been declared
   36 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:36:35: error: expected ',' or '...' before 'args'
   36 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:45:6: error: expected ';' after class definition
   45 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void AtCoderBeginnerContest154::Program::Main(int*)':
a.cc:38:13: error: 'IAtCoderQuestion' was not declared in this scope
   38 |             IAtCoderQuestion question = new QuestionA();    // 問題に合わせて書き換え
      |             ^~~~~~~~~~~~~~~~
a.cc:39:13: error: 'var' was not declared in this scope
   39 |             var answers = question.Solve(Console.In);
      |             ^~~
a.cc:40:26: error: expected ')' before 'answer'
   40 |             foreach (var answer in answers)
      |                          ^~~~~~
a.cc:40:21: note: to match this '('
   40 |             foreach (var answer in answers)
      |                     ^
a.cc:40:13: error: 'foreach' was not declared in this scope
   40 |             foreach (var answer in answers)
      |             ^~~~~~~
a.cc: At global scope:
a.cc:50:36: error: expected '{' before '.' token
   50 | namespace AtCoderBeginnerContest154.Questions
      |                                    ^
a.cc:50:36: error: expected unqualified-id before '.' token
a.cc:78:36: error: expected '{' before '.' token
   78 | namespace AtCoderBeginnerContest154.Extensions
      |                                    ^
a.cc:78:36: error: expected unqualified-id before '.' token