class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

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

c.u = m
m.s = f
m.t = i
i.y = e
i.w = e
j.t = m
j.v = k
f.u = m
k.y = j
k.w = e
e.t = m
e.v = k
assert c.u.s.u.s.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

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

c.u = m
m.s = f
m.t = i
i.y = e
i.w = e
j.t = m
j.v = k
f.u = m
k.y = j
k.w = e
e.t = m
e.v = k
assert c.u.s.u.s.u.s.txt == "f"