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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

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

i.y = e
i.q = j
f.o = n
l.z = j
l.s = j
l.u = n
l.x = i
l.v = d
n.z = j
j.t = d
j.r = c
j.v = c
j.s = l
e.z = j
c.o = e
d.z = j
d.s = j
d.u = n
d.x = i
d.v = l
assert n.z.v.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.v: B = None
        self.s: C = None
        self.txt = txt

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

i.y = e
i.q = j
f.o = n
l.z = j
l.s = j
l.u = n
l.x = i
l.v = d
n.z = j
j.t = d
j.r = c
j.v = c
j.s = l
e.z = j
c.o = e
d.z = j
d.s = j
d.u = n
d.x = i
d.v = l
assert n.z.v.o.z.txt == "j"