class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.txt = txt

e = A("e")
c = B("c")
n = C("n")
g = C("g")
d = C("d")
k = A("k")
j = C("j")
h = A("h")
b = B("b")
i = A("i")

e.o = c
e.w = c
c.z = k
c.p = b
c.r = j
n.o = c
n.u = k
g.o = b
g.u = h
d.o = b
d.u = h
k.o = b
k.w = c
j.o = c
j.u = h
h.o = c
h.w = c
b.z = k
b.p = c
b.r = j
i.o = b
i.w = c
assert g.u.w.r.o.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: B = None
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.txt = txt

e = A("e")
c = B("c")
n = C("n")
g = C("g")
d = C("d")
k = A("k")
j = C("j")
h = A("h")
b = B("b")
i = A("i")

e.o = c
e.w = c
c.z = k
c.p = b
c.r = j
n.o = c
n.u = k
g.o = b
g.u = h
d.o = b
d.u = h
k.o = b
k.w = c
j.o = c
j.u = h
h.o = c
h.w = c
b.z = k
b.p = c
b.r = j
i.o = b
i.w = c
assert g.u.w.r.o.p.z.txt == "k"