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

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

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

l = A("l")
j = B("j")
b = C("b")
h = B("h")
m = C("m")
a = A("a")

l.t = h
l.r = b
j.s = h
j.t = h
j.o = m
b.u = a
b.v = m
b.s = j
h.s = j
h.t = j
h.o = m
m.u = l
m.v = b
m.s = j
a.t = j
a.r = b
assert h.t.o.v.v.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.txt = txt

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

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

l = A("l")
j = B("j")
b = C("b")
h = B("h")
m = C("m")
a = A("a")

l.t = h
l.r = b
j.s = h
j.t = h
j.o = m
b.u = a
b.v = m
b.s = j
h.s = j
h.t = j
h.o = m
m.u = l
m.v = b
m.s = j
a.t = j
a.r = b
assert h.t.o.v.v.v.u.txt == "a"