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

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

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

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

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

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

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

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

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

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

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

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

b.p = d
b.w = l
b.z = c
i.w = g
i.y = j
i.o = j
g.z = c
g.y = j
d.r = b
j.u = c
j.p = l
j.t = g
j.x = k
j.s = b
l.z = c
l.y = j
c.p = d
c.w = g
c.z = b
k.r = c
assert l.z.p.r.p.r.w.y.t.txt == "g"