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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.r: E = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.y: C = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

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

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

n = A("n")
j = B("j")
g = C("g")
a = D("a")
h = E("h")
c = C("c")
i = E("i")
k = D("k")
d = A("d")

n.x = i
n.o = j
j.w = h
j.y = g
j.r = i
j.v = c
j.s = c
g.w = k
g.q = j
g.y = c
g.t = c
g.r = h
a.x = c
a.w = c
h.z = i
c.w = a
c.q = j
c.y = g
c.t = g
c.r = i
i.z = h
k.x = g
k.w = g
d.x = i
d.o = j
assert c.y.r.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.r: E = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: B = None
        self.y: C = None
        self.r: E = None
        self.t: C = None
        self.txt = txt

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

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

n = A("n")
j = B("j")
g = C("g")
a = D("a")
h = E("h")
c = C("c")
i = E("i")
k = D("k")
d = A("d")

n.x = i
n.o = j
j.w = h
j.y = g
j.r = i
j.v = c
j.s = c
g.w = k
g.q = j
g.y = c
g.t = c
g.r = h
a.x = c
a.w = c
h.z = i
c.w = a
c.q = j
c.y = g
c.t = g
c.r = i
i.z = h
k.x = g
k.w = g
d.x = i
d.o = j
assert c.y.r.z.z.z.z.txt == "h"