class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: A = None
        self.v: A = None
        self.q: A = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: A = None
        self.v: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: B = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

e = A("e")
a = B("a")
h = C("h")
i = D("i")
b = E("b")
k = A("k")
g = C("g")

e.z = g
e.t = k
e.v = k
e.q = k
e.u = a
a.q = b
a.v = b
a.x = e
a.p = g
h.s = g
h.o = g
i.o = a
i.w = a
i.r = a
i.s = h
b.w = g
k.z = h
k.t = e
k.v = e
k.q = e
k.u = a
g.s = h
g.o = h
assert g.s.o.s.o.o.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.t: A = None
        self.v: A = None
        self.q: A = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: A = None
        self.v: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: B = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

e = A("e")
a = B("a")
h = C("h")
i = D("i")
b = E("b")
k = A("k")
g = C("g")

e.z = g
e.t = k
e.v = k
e.q = k
e.u = a
a.q = b
a.v = b
a.x = e
a.p = g
h.s = g
h.o = g
i.o = a
i.w = a
i.r = a
i.s = h
b.w = g
k.z = h
k.t = e
k.v = e
k.q = e
k.u = a
g.s = h
g.o = h
assert g.s.o.s.o.o.s.o.txt == "h"