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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.p: C = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.u: E = None
        self.z: A = None
        self.txt = txt

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

c = A("c")
g = B("g")
i = C("i")
f = D("f")
b = E("b")
l = C("l")
e = E("e")
h = E("h")

c.r = b
g.t = e
i.y = f
i.v = f
i.p = l
i.z = l
i.x = b
f.t = g
f.o = b
f.u = e
f.z = c
b.q = i
l.y = f
l.v = f
l.p = i
l.z = i
l.x = h
e.q = l
h.q = l
assert h.q.y.o.q.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.p: C = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.u: E = None
        self.z: A = None
        self.txt = txt

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

c = A("c")
g = B("g")
i = C("i")
f = D("f")
b = E("b")
l = C("l")
e = E("e")
h = E("h")

c.r = b
g.t = e
i.y = f
i.v = f
i.p = l
i.z = l
i.x = b
f.t = g
f.o = b
f.u = e
f.z = c
b.q = i
l.y = f
l.v = f
l.p = i
l.z = i
l.x = h
e.q = l
h.q = l
assert h.q.y.o.q.y.z.txt == "c"