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

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

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

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

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

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

l.x = n
l.s = n
l.y = b
l.z = e
m.o = n
m.w = n
m.x = k
e.u = c
n.v = c
n.o = f
j.s = e
b.u = n
k.o = n
k.w = n
k.x = m
f.x = n
f.s = n
f.y = e
f.z = b
c.v = n
c.o = f
i.o = c
i.w = n
i.x = k
assert j.s.u.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: D = None
        self.y: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

l.x = n
l.s = n
l.y = b
l.z = e
m.o = n
m.w = n
m.x = k
e.u = c
n.v = c
n.o = f
j.s = e
b.u = n
k.o = n
k.w = n
k.x = m
f.x = n
f.s = n
f.y = e
f.z = b
c.v = n
c.o = f
i.o = c
i.w = n
i.x = k
assert j.s.u.v.o.txt == "f"