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

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

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

j = A("j")
l = B("l")
m = C("m")
n = C("n")
h = A("h")
i = B("i")

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

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

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

j = A("j")
l = B("l")
m = C("m")
n = C("n")
h = A("h")
i = B("i")

j.w = l
j.v = l
j.q = m
l.s = i
l.u = m
m.v = l
m.o = h
n.v = i
n.o = h
h.w = l
h.v = l
h.q = n
i.s = l
i.u = n
assert i.u.o.q.v.u.v.txt == "i"