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

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

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

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

i = A("i")
j = B("j")
n = C("n")
d = D("d")
b = B("b")
h = C("h")
l = C("l")

i.o = j
i.u = b
j.s = i
j.o = i
j.q = b
j.v = b
n.o = d
n.s = i
d.z = l
d.q = l
b.s = i
b.o = i
b.q = j
b.v = j
h.o = d
h.s = i
l.o = d
l.s = i
assert i.o.s.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.txt = txt

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

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

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

i = A("i")
j = B("j")
n = C("n")
d = D("d")
b = B("b")
h = C("h")
l = C("l")

i.o = j
i.u = b
j.s = i
j.o = i
j.q = b
j.v = b
n.o = d
n.s = i
d.z = l
d.q = l
b.s = i
b.o = i
b.q = j
b.v = j
h.o = d
h.s = i
l.o = d
l.s = i
assert i.o.s.o.v.txt == "b"