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

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

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

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

f = A("f")
l = B("l")
m = C("m")
b = D("b")
j = D("j")
k = C("k")
a = A("a")
n = D("n")

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

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

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

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

f = A("f")
l = B("l")
m = C("m")
b = D("b")
j = D("j")
k = C("k")
a = A("a")
n = D("n")

f.t = m
f.v = l
f.u = k
l.z = k
l.x = f
m.x = f
m.o = l
m.p = a
b.r = n
b.w = j
j.r = b
j.w = n
k.x = a
k.p = a
k.o = l
a.t = k
a.v = l
a.u = m
n.r = j
n.w = b
assert k.o.x.v.txt == "l"