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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: C = None
        self.x: B = None
        self.z: E = None
        self.q: D = None
        self.txt = txt

c = A("c")
g = B("g")
j = C("j")
e = D("e")
a = E("a")
i = E("i")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: C = None
        self.x: B = None
        self.z: E = None
        self.q: D = None
        self.txt = txt

c = A("c")
g = B("g")
j = C("j")
e = D("e")
a = E("a")
i = E("i")

c.p = j
g.o = i
j.s = e
j.u = g
e.z = g
e.t = i
e.v = a
e.p = j
a.p = g
a.x = g
a.u = j
a.z = i
a.q = e
i.p = g
i.x = g
i.u = j
i.z = a
i.q = e
assert c.p.s.z.o.u.txt == "j"