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

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

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

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

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

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

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

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

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

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

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

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

k.x = n
k.o = f
n.w = i
n.t = b
n.o = l
j.x = b
j.r = n
l.q = h
l.z = i
l.v = i
l.s = k
f.y = k
h.x = n
h.r = n
d.q = j
d.z = i
d.v = i
d.s = k
i.q = c
i.z = d
i.v = d
i.s = k
b.w = i
b.t = n
b.o = l
c.x = b
c.r = n
assert l.v.q.r.w.txt == "i"