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

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

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

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

k = A("k")
b = B("b")
d = C("d")
m = D("m")
n = D("n")
h = A("h")
j = A("j")

k.o = d
k.z = d
b.v = d
b.q = d
b.s = d
d.v = m
d.x = h
m.s = d
m.q = b
m.t = n
m.x = n
n.s = d
n.q = b
n.t = m
n.x = m
h.o = d
h.z = d
j.o = d
j.z = d
assert d.v.q.q.v.s.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.txt = txt

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

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

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

k = A("k")
b = B("b")
d = C("d")
m = D("m")
n = D("n")
h = A("h")
j = A("j")

k.o = d
k.z = d
b.v = d
b.q = d
b.s = d
d.v = m
d.x = h
m.s = d
m.q = b
m.t = n
m.x = n
n.s = d
n.q = b
n.t = m
n.x = m
h.o = d
h.z = d
j.o = d
j.z = d
assert d.v.q.q.v.s.v.q.txt == "b"