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

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

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

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

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

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

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

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

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

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

f.o = d
f.t = c
k.x = a
k.w = a
c.u = j
c.v = d
j.z = c
j.t = d
i.o = d
i.t = c
l.z = c
l.t = d
d.x = a
d.w = a
a.x = k
a.w = k
n.o = d
n.t = c
assert a.x.w.x.x.w.x.x.x.x.txt == "k"