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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: D = None
        self.y: E = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: D = None
        self.y: E = None
        self.r: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

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

j.x = i
h.z = d
h.s = d
h.y = n
h.r = f
f.v = h
f.y = n
f.p = i
f.w = c
f.o = c
d.x = c
b.s = d
b.r = i
b.o = j
b.u = c
i.x = c
n.s = d
n.r = i
n.o = j
n.u = c
c.v = h
c.y = b
c.p = i
c.w = f
c.o = f
assert d.x.p.x.v.z.x.p.x.txt == "c"