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

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

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

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

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

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

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

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

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