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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: A = None
        self.y: B = None
        self.o: B = None
        self.x: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: A = None
        self.y: B = None
        self.o: B = None
        self.x: B = None
        self.txt = txt

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

c.z = a
c.p = b
i.u = n
i.v = a
e.x = i
e.r = d
a.p = d
n.p = e
n.t = c
n.y = i
n.o = i
n.x = i
d.z = a
d.p = j
b.x = i
b.r = c
j.x = i
j.r = d
assert a.p.p.r.p.r.p.x.u.txt == "n"