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

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

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

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

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

k.o = d
k.p = d
k.v = f
k.w = m
b.o = c
b.v = m
f.z = d
f.q = m
f.t = b
c.o = k
l.o = i
e.o = i
m.o = e
m.v = b
i.o = d
i.p = d
i.v = f
i.w = b
d.o = k
d.v = f
d.w = b
d.p = i
assert c.o.o.p.v.t.v.o.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.v: C = None
        self.w: B = None
        self.p: A = None
        self.txt = txt

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

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

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

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

k.o = d
k.p = d
k.v = f
k.w = m
b.o = c
b.v = m
f.z = d
f.q = m
f.t = b
c.o = k
l.o = i
e.o = i
m.o = e
m.v = b
i.o = d
i.p = d
i.v = f
i.w = b
d.o = k
d.v = f
d.w = b
d.p = i
assert c.o.o.p.v.t.v.o.o.v.txt == "f"