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

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

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

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

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

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

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

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

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

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

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

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

b.w = l
b.u = g
b.v = g
b.r = c
b.x = j
d.z = b
d.w = i
d.s = j
c.t = g
e.w = c
e.z = l
e.o = l
e.x = l
e.p = j
i.v = g
i.z = e
i.p = n
i.r = b
j.v = g
j.z = e
j.p = f
j.r = b
f.t = b
l.w = n
l.z = e
l.o = e
l.x = e
l.p = i
g.w = e
g.u = b
g.v = b
g.r = c
g.x = i
n.t = b
assert b.r.t.x.p.t.txt == "b"