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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: C = None
        self.v: A = None
        self.r: E = None
        self.q: E = None
        self.txt = txt

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

c = A("c")
b = B("b")
i = C("i")
n = D("n")
d = E("d")
f = C("f")
l = E("l")

c.z = l
c.s = b
c.t = b
c.w = n
b.p = l
i.y = c
n.o = c
n.v = c
n.x = f
n.r = d
n.q = l
d.o = n
d.x = l
d.v = l
f.y = c
l.o = n
l.x = d
l.v = d
assert f.y.z.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: B = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: C = None
        self.v: A = None
        self.r: E = None
        self.q: E = None
        self.txt = txt

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

c = A("c")
b = B("b")
i = C("i")
n = D("n")
d = E("d")
f = C("f")
l = E("l")

c.z = l
c.s = b
c.t = b
c.w = n
b.p = l
i.y = c
n.o = c
n.v = c
n.x = f
n.r = d
n.q = l
d.o = n
d.x = l
d.v = l
f.y = c
l.o = n
l.x = d
l.v = d
assert f.y.z.o.o.txt == "c"