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

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

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

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

f.r = d
f.v = j
h.r = i
d.y = j
d.u = j
d.t = n
b.r = i
j.y = c
j.t = c
j.u = d
n.y = c
n.t = d
n.u = d
i.r = b
l.r = n
l.v = d
c.y = d
c.t = d
c.u = j
assert i.r.r.r.r.r.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: C = None
        self.txt = txt

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

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

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

f.r = d
f.v = j
h.r = i
d.y = j
d.u = j
d.t = n
b.r = i
j.y = c
j.t = c
j.u = d
n.y = c
n.t = d
n.u = d
i.r = b
l.r = n
l.v = d
c.y = d
c.t = d
c.u = j
assert i.r.r.r.r.r.r.r.txt == "b"