Language: C++

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgrammingContest
{
    class MainClass : IDisposable
    {
        Scanner sc;
        Writer wr;
        string backPath = "..";
        char dirSep = System.IO.Path.DirectorySeparatorChar;
        string inFilePath = null;
        string outFilePath = null;
        public MainClass()
        {
            this.inFilePath = this.backPath
                            + this.dirSep
                            + this.backPath
                            + this.dirSep
                            + "in.txt";
            this.outFilePath = this.backPath
                             + this.dirSep
                             + this.backPath
                             + this.dirSep
                             + "out.txt";
        }
        static void Main(string[] args)
        {
            using (var mainClass = new MainClass())
            {
                //mainClass.MakeTestCase();
                mainClass.Solve();
            }
        }

        public void Dispose()
        {
            if (this.sc != null)
            {
                this.sc.Dispose();
                this.sc = null;
            }
            if (this.wr != null)
            {
                this.wr.Dispose();
                this.wr = null;
            }
        }

        void MakeTestCase()
        {
            Random rand = new Random();
            this.wr = new Writer(inFilePath);


        }

        void Solve()
        {
            this.wr = new Writer(this.isReactive);
            //this.wr = new Writer(this.outFilePath);
#if DEBUG
            if (!this.isReactive)
                this.sc = new Scanner(this.inFilePath);
            else
                this.sc = new Scanner();
#else
            this.sc = new Scanner();
#endif

            string s = sc.Next;
            for (int i = 0; i < 2; i++)
            {
                if (s[i] == s[i + 1] && s[i + 1] == s[i + 2])
                {
                    wr.WriteLine("Yes");
                    return;
                }
            }
            wr.WriteLine("No");
        }

        bool isReactive = false; // TODO: reactive check !!
    }

    class Writer : IDisposable
    {
        private System.IO.TextWriter writer;
        private StringBuilder sb;
        private bool isReactive;
        public Writer(string path) : this(new System.IO.StreamWriter(path))
        {
        }
        public Writer(bool isReactive) : this(null, isReactive)
        {
        }
        public Writer(System.IO.TextWriter writer = null, bool isReactive = false)
        {
            this.writer = (writer ?? Console.Out);
            this.isReactive = isReactive;
            if (!this.isReactive)
                this.sb = new StringBuilder();
        }
        public void Dispose()
        {
            if (!this.isReactive)
                this.writer.Write(sb.ToString());
            if (!this.writer.Equals(Console.Out))
                this.writer.Dispose();
        }
        public void Write(object val)
        {
            if (this.isReactive)
            {
                this.writer.Write(val.ToString());
                this.writer.Flush();
            }
            else
                this.sb.Append(val.ToString());
        }
        public void Write(string format, params object[] vals)
        {
            if (this.isReactive)
            {
                this.writer.Write(format, vals);
                this.writer.Flush();
            }
            else
                this.sb.AppendFormat(format, vals);
        }
        public void WriteLine(object val)
        {
            this.Write(val.ToString() + System.Environment.NewLine);
        }
        public void WriteLine(string format, params object[] vals)
        {
            this.Write(format + System.Environment.NewLine, vals);
        }
    }

    class Scanner : IDisposable
    {
        private Queue<string> buffer;
        private char[] sep;
        private System.IO.TextReader reader;
        public Scanner(string path) : this(new System.IO.StreamReader(path))
        {
        }
        public Scanner(System.IO.TextReader reader = null)
        {
            this.buffer = new Queue<string>();
            this.sep = new char[] { ' ' };
            this.reader = (reader ?? Console.In);
        }
        private void CheckBuffer()
        {
            if (this.buffer.Count == 0)
            {
                string str = string.Empty;
                while (string.IsNullOrEmpty(str))
                    str = this.reader.ReadLine();

                str.Split(this.sep).ToList()
                    .ForEach(el => this.buffer.Enqueue(el));
            }
        }

        public void Dispose()
        {
            if (!this.reader.Equals(Console.In))
                this.reader.Dispose();
        }

        public string Next
        {
            get
            {
                this.CheckBuffer();
                return this.buffer.Dequeue();
            }
        }

        public int NextInt
        {
            get
            {
                return int.Parse(this.Next);
            }
        }
        public double NextDouble
        {
            get
            {
                return double.Parse(this.Next);
            }
        }

        public long NextLong
        {
            get
            {
                return long.Parse(this.Next);
            }
        }

        public bool IsEnd
        {
            get
            {
                this.CheckBuffer();
                return this.buffer.Count == 0;
            }
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:9:5: error: expected class-name before '{' token
    9 |     {
      |     ^
a.cc:10:9: error: 'Scanner' does not name a type
   10 |         Scanner sc;
      |         ^~~~~~~
a.cc:11:9: error: 'Writer' does not name a type
   11 |         Writer wr;
      |         ^~~~~~
a.cc:12:9: error: 'string' does not name a type
   12 |         string backPath = "..";
      |         ^~~~~~
a.cc:14:9: error: 'string' does not name a type
   14 |         string inFilePath = null;
      |         ^~~~~~
a.cc:15:9: error: 'string' does not name a type
   15 |         string outFilePath = null;
      |         ^~~~~~
a.cc:16:15: error: expected ':' before 'MainClass'
   16 |         public MainClass()
      |               ^~~~~~~~~~
      |               :
a.cc:29:26: error: 'string' has not been declared
   29 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:29:35: error: expected ',' or '...' before 'args'
   29 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:38:15: error: expected ':' before 'void'
   38 |         public void Dispose()
      |               ^~~~~
      |               :
a.cc:86:6: error: expected ';' after class definition
   86 |     }
      |      ^
      |      ;
a.cc:13:23: error: 'System' was not declared in this scope
   13 |         char dirSep = System.IO.Path.DirectorySeparatorChar;
      |                       ^~~~~~
a.cc: In constructor 'ProgrammingContest::MainClass::MainClass()':
a.cc:18:18: error: request for member 'inFilePath' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   18 |             this.inFilePath = this.backPath
      |                  ^~~~~~~~~~
a.cc:18:36: error: request for member 'backPath' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   18 |             this.inFilePath = this.backPath
      |                                    ^~~~~~~~
a.cc:19:36: error: request for member 'dirSep' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   19 |                             + this.dirSep
      |                                    ^~~~~~
a.cc:20:36: error: request for member 'backPath' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   20 |                             + this.backPath
      |                                    ^~~~~~~~
a.cc:21:36: error: request for member 'dirSep' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   21 |                             + this.dirSep
      |                                    ^~~~~~
a.cc:23:18: error: request for member 'outFilePath' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   23 |             this.outFilePath = this.backPath
      |                  ^~~~~~~~~~~
a.cc:23:37: error: request for member 'backPath' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   23 |             this.outFilePath = this.backPath
      |                                     ^~~~~~~~
a.cc:24:37: error: request for member 'dirSep' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   24 |                              + this.dirSep
      |                                     ^~~~~~
a.cc:25:37: error: request for member 'backPath' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   25 |                              + this.backPath
      |                                     ^~~~~~~~
a.cc:26:37: error: request for member 'dirSep' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   26 |                              + this.dirSep
      |                                     ^~~~~~
a.cc: In static member function 'static void ProgrammingContest::MainClass::Main(int*)':
a.cc:31:19: error: expected nested-name-specifier before '(' token
   31 |             using (var mainClass = new MainClass())
      |                   ^
a.cc: In member function 'void ProgrammingContest::MainClass::Dispose()':
a.cc:40:22: error: request for member 'sc' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   40 |             if (this.sc != null)
      |                      ^~
a.cc:40:28: error: 'null' was not declared in this scope
   40 |             if (this.sc != null)
      |                            ^~~~
a.cc:42:22: error: request for member 'sc' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   42 |                 this.sc.Dispose();
      |                      ^~
a.cc:43:22: error: request for member 'sc' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   43 |                 this.sc = null;
      |                      ^~
a.cc:45:22: error: request for member 'wr' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   45 |             if (this.wr != null)
      |                      ^~
a.cc:45:28: error: 'null' was not declared in this scope
   45 |             if (this.wr != null)
      |                            ^~~~
a.cc:47:22: error: request for member 'wr' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   47 |                 this.wr.Dispose();
      |                      ^~
a.cc:48:22: error: request for member 'wr' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   48 |                 this.wr = null;
      |                      ^~
a.cc: In member function 'void ProgrammingContest::MainClass::MakeTestCase()':
a.cc:54:13: error: 'Random' was not declared in this scope
   54 |             Random rand = new Random();
      |             ^~~~~~
a.cc:55:18: error: request for member 'wr' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   55 |             this.wr = new Writer(inFilePath);
      |                  ^~
a.cc:55:27: error: expected type-specifier before 'Writer'
   55 |             this.wr = new Writer(inFilePath);
      |                           ^~~~~~
a.cc: In member function 'void ProgrammingContest::MainClass::Solve()':
a.cc:62:18: error: request for member 'wr' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   62 |             this.wr = new Writer(this.isReactive);
      |                  ^~
a.cc:62:27: error: expected type-specifier before 'Writer'
   62 |             this.wr = new Writer(this.isReactive);
      |                           ^~~~~~
a.cc:70:18: error: request for member 'sc' in '(ProgrammingContest::MainClass*)this', which is of pointer type 'ProgrammingContest::MainClass*' (maybe you meant to use '->' ?)
   70 |             this.sc = new Scanner();
      |                  ^~
a.cc:70:27: error: expected type-specifier before 'Scanner'
   70 |             this.sc = new Scanner();
      |                           ^~~~~~~
a.cc:73:13: error: 'string' was not declared in this scope
   73 |             string s = sc.Next;
      |             ^~~~~~
a.cc:76:21: error: 's' was not declared in this scope
   76 |                 if (s[i] == s[i + 1] && s[i + 1] == s[i + 2])
      |                     ^
a.cc:78:21: error: 'wr' was not declared in this scope
   78 |                     wr.WriteLine("Yes");
      |                     ^~
a.cc:82:13: error: 'wr' was not declared in this scope
   82 |             wr.WriteLine("No");
      |             ^~
a.cc: At global scope:
a.cc:89:5: error: expected class-name before '{' token
   89 |     {
      |     ^
a.cc:90:16: error: expected ':' before 'System'
   90 |         private System.IO.TextWriter writer;
      |                ^~~~~~~
      |                :
a.cc:90:17: error: 'System' does not name a type
   90 |         private System.IO.TextWriter writer;
      |                 ^~~~~~
a.cc:91:16: error: expected ':' before 'StringBuilder'
   91 |         private StringBuilder sb;
      |                ^~~~~~~~~~~~~~
      |                :
a.cc:91:17: error: 'StringBuilder' does not name a type
   91 |         private StringBuilder sb;
      |                 ^~~~~~~~~~~~~
a.cc:92:16: error: expected ':' before 'bool'
   92 |         private bool isReactive;
      |                ^~~~~
      |                :
a.cc:93:15: error: expected ':' before 'Writer'
   93 |         public Writer(string path) : this(new System.IO.StreamWriter(path))
      |               ^~~~~~~
      |               :
a.cc:93:29: error: expected ')' before 'path'
   93 |         public Writer(string path) : this(new System.IO.StreamWriter(path))
      |                      ~      ^~~~~
      |                             )
a.cc:96:15: error: expected ':' before 'Writer'
   96 |         public Writer(boo