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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: D = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

b = A("b")
d = B("d")
c = C("c")
a = D("a")
g = C("g")
j = C("j")
i = B("i")
l = D("l")
e = C("e")

b.v = a
b.u = a
b.p = e
b.t = l
d.z = b
d.t = g
d.u = g
d.q = c
c.p = e
a.s = d
a.z = l
a.q = b
a.u = j
g.p = j
j.p = g
i.z = b
i.t = j
i.q = c
i.u = e
l.s = d
l.z = a
l.q = b
l.u = j
e.p = c
assert d.z.t.s.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: C = None
        self.u: D = None
        self.t: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: D = None
        self.q: A = None
        self.u: C = None
        self.txt = txt

b = A("b")
d = B("d")
c = C("c")
a = D("a")
g = C("g")
j = C("j")
i = B("i")
l = D("l")
e = C("e")

b.v = a
b.u = a
b.p = e
b.t = l
d.z = b
d.t = g
d.u = g
d.q = c
c.p = e
a.s = d
a.z = l
a.q = b
a.u = j
g.p = j
j.p = g
i.z = b
i.t = j
i.q = c
i.u = e
l.s = d
l.z = a
l.q = b
l.u = j
e.p = c
assert d.z.t.s.q.p.txt == "e"