class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.q: B = None
        self.v: A = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

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

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

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

d = A("d")
i = B("i")
n = C("n")
l = D("l")
a = E("a")
e = A("e")
f = B("f")

d.w = i
d.q = i
d.u = e
d.v = e
d.x = e
i.o = l
i.t = l
i.q = f
n.o = l
n.x = d
n.v = d
n.u = d
l.p = a
a.o = e
a.w = f
a.y = f
e.w = f
e.q = f
e.u = d
e.v = d
e.x = d
f.o = l
f.t = l
f.q = i
assert e.w.t.p.o.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.q: B = None
        self.v: A = None
        self.x: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.t: D = None
        self.txt = txt

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

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

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

d = A("d")
i = B("i")
n = C("n")
l = D("l")
a = E("a")
e = A("e")
f = B("f")

d.w = i
d.q = i
d.u = e
d.v = e
d.x = e
i.o = l
i.t = l
i.q = f
n.o = l
n.x = d
n.v = d
n.u = d
l.p = a
a.o = e
a.w = f
a.y = f
e.w = f
e.q = f
e.u = d
e.v = d
e.x = d
f.o = l
f.t = l
f.q = i
assert e.w.t.p.o.v.w.txt == "i"