class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: D = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: D = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

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

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

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

c.t = f
c.z = f
l.w = f
l.z = i
l.v = k
l.t = c
m.o = i
m.u = l
i.s = m
j.t = m
j.z = m
k.s = m
n.t = f
n.z = f
f.o = i
f.u = l
assert m.u.w.o.s.o.s.u.txt == "l"