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

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

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

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

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

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

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

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

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

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

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

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

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